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

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

Best Java code snippets using com.microsoft.azure.storage.StorageCredentialsAccountAndKey.exportBase64EncodedKey (Showing top 5 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: com.microsoft.azure/azure-storage

/**
 * Returns a <code>String</code> that represents this instance, optionally including sensitive data.
 * 
 * @param exportSecrets
 *            <code>true</code> to include sensitive data in the return string; otherwise, <code>false</code>.
 * 
 * @return A <code>String</code> that represents this object, optionally including sensitive data.
 */
@Override
public String toString(final boolean exportSecrets) {
  return String.format("%s=%s;%s=%s", CloudStorageAccount.ACCOUNT_NAME_NAME, this.getAccountName(),
      CloudStorageAccount.ACCOUNT_KEY_NAME, exportSecrets ? this.exportBase64EncodedKey()
          : "[key hidden]");
}
origin: Azure/azure-storage-android

/**
 * Returns a <code>String</code> that represents this instance, optionally including sensitive data.
 * 
 * @param exportSecrets
 *            <code>true</code> to include sensitive data in the return string; otherwise, <code>false</code>.
 * 
 * @return A <code>String</code> that represents this object, optionally including sensitive data.
 */
@Override
public String toString(final boolean exportSecrets) {
  return String.format("%s=%s;%s=%s", CloudStorageAccount.ACCOUNT_NAME_NAME, this.getAccountName(),
      CloudStorageAccount.ACCOUNT_KEY_NAME, exportSecrets ? this.exportBase64EncodedKey()
          : "[key hidden]");
}
origin: Azure/azure-storage-android

@Test
public void testStorageCredentialsSharedKeyUpdateKey() throws URISyntaxException, StorageException {
  StorageCredentialsAccountAndKey cred = new StorageCredentialsAccountAndKey(ACCOUNT_NAME, ACCOUNT_KEY);
  assertEquals(ACCOUNT_KEY, cred.exportBase64EncodedKey());
  // Validate update with byte array
  byte[] dummyKey = { 0, 1, 2 };
  cred.updateKey(dummyKey);
  String base64EncodedDummyKey = Base64.encode(dummyKey);
  assertEquals(base64EncodedDummyKey, cred.exportBase64EncodedKey());
  // Validate update with string
  dummyKey[0] = 3;
  base64EncodedDummyKey = Base64.encode(dummyKey);
  cred.updateKey(base64EncodedDummyKey);
  assertEquals(base64EncodedDummyKey, cred.exportBase64EncodedKey());
}
origin: Azure/azure-storage-android

@Test
public void testStorageCredentialsSharedKey() throws URISyntaxException, StorageException {
  StorageCredentialsAccountAndKey cred = new StorageCredentialsAccountAndKey(ACCOUNT_NAME, ACCOUNT_KEY);
  assertEquals(ACCOUNT_NAME, cred.getAccountName());
  URI testUri = new URI("http://test/abc?querya=1");
  assertEquals(testUri, cred.transformUri(testUri));
  assertEquals(ACCOUNT_KEY, cred.exportBase64EncodedKey());
  byte[] dummyKey = { 0, 1, 2 };
  String base64EncodedDummyKey = Base64.encode(dummyKey);
  cred = new StorageCredentialsAccountAndKey(ACCOUNT_NAME, base64EncodedDummyKey);
  assertEquals(base64EncodedDummyKey, cred.exportBase64EncodedKey());
  dummyKey[0] = 3;
  base64EncodedDummyKey = Base64.encode(dummyKey);
  cred = new StorageCredentialsAccountAndKey(ACCOUNT_NAME, base64EncodedDummyKey);
  assertEquals(base64EncodedDummyKey, cred.exportBase64EncodedKey());
}
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);
  }
}
com.microsoft.azure.storageStorageCredentialsAccountAndKeyexportBase64EncodedKey

Javadoc

Exports the value of the access key to a Base64-encoded string.

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.
  • getAccountName
    Gets the account name.
  • getHmac256
    Gets the HmacSha256 associated with the account key.
  • exportKey
    Exports the value of the access key to an array of bytes.
  • transformUri

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JList (javax.swing)
  • JTextField (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
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