Codota Logo
StorageCredentialsAccountAndKey.exportKey
Code IndexAdd Codota to your IDE (free)

How to use
exportKey
method
in
com.microsoft.azure.storage.StorageCredentialsAccountAndKey

Best Java code snippets using com.microsoft.azure.storage.StorageCredentialsAccountAndKey.exportKey (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: Azure/azure-storage-android

  @Test
  public void testCloudStorageAccountExportKey() throws InvalidKeyException, URISyntaxException {
    String accountKeyString = "abc2564=";
    String accountString = "BlobEndpoint=http://blobs/;AccountName=test;AccountKey=" + accountKeyString;
    CloudStorageAccount account = CloudStorageAccount.parse(accountString);
    StorageCredentialsAccountAndKey accountAndKey = (StorageCredentialsAccountAndKey) account.getCredentials();
    String key = accountAndKey.exportBase64EncodedKey();
    assertEquals(accountKeyString, key);

    byte[] keyBytes = accountAndKey.exportKey();
    byte[] expectedKeyBytes = Base64.decode(accountKeyString);
    TestHelper.assertByteArrayEquals(expectedKeyBytes, keyBytes);
  }
}
origin: Azure/azure-storage-android

@Test
public void testStorageCredentialsNullKeyValue() {
  String nullKeyValueAsString = null;
  try {
    new StorageCredentialsAccountAndKey(ACCOUNT_NAME, nullKeyValueAsString);
    fail("Did not hit expected exception");
  }
  catch (IllegalArgumentException ex) {
    assertEquals(SR.STRING_NOT_VALID, ex.getMessage());
  }
  StorageCredentialsAccountAndKey credentials2 = new StorageCredentialsAccountAndKey(ACCOUNT_NAME, ACCOUNT_KEY);
  assertEquals(ACCOUNT_NAME, credentials2.getAccountName());
  assertEquals(ACCOUNT_KEY, Base64.encode(credentials2.exportKey()));
  byte[] nullKeyValueAsByteArray = null;
  try {
    new StorageCredentialsAccountAndKey(ACCOUNT_NAME, nullKeyValueAsByteArray);
    fail("Did not hit expected exception");
  }
  catch (IllegalArgumentException ex) {
    assertEquals(SR.INVALID_KEY, ex.getMessage());
  }
}
com.microsoft.azure.storageStorageCredentialsAccountAndKeyexportKey

Javadoc

Exports the value of the access key to an array of bytes.

Popular methods of StorageCredentialsAccountAndKey

  • <init>
    Creates an instance of the StorageCredentialsAccountAndKey class, using the specified storage accoun
  • updateKey
    Sets the name of the access key to be used when signing the request.
  • exportBase64EncodedKey
    Exports the value of the access key to a Base64-encoded string.
  • getAccountName
    Gets the account name.
  • getHmac256
    Gets the HmacSha256 associated with the account key.
  • transformUri

Popular in Java

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JTextField (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now