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

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

Best Java code snippets using com.microsoft.azure.storage.StorageCredentialsAccountAndKey.updateKey (Showing top 4 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

/**
 * Sets the name of the access key to be used when signing the request.
 * 
 * @param key
 *        A <code>String</code> that represents the name of the access key to be used when signing the request.
 */
public synchronized void updateKey(final String key) {
  this.updateKey(Base64.decode(key));
}
 
origin: Azure/azure-storage-android

/**
 * Sets the name of the access key to be used when signing the request.
 * 
 * @param key
 *        A <code>String</code> that represents the name of the access key to be used when signing the request.
 */
public synchronized void updateKey(final String key) {
  this.updateKey(Base64.decode(key));
}

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: iterate-ch/cyberduck

@Override
public void login(final Proxy proxy, final LoginCallback prompt, final CancelCallback cancel) throws BackgroundException {
  final StorageCredentials credentials = client.getCredentials();
  if(host.getCredentials().isPasswordAuthentication()) {
    // Update credentials
    ((StorageCredentialsAccountAndKey) credentials).updateKey(host.getCredentials().getPassword());
  }
  else if(host.getCredentials().isTokenAuthentication()) {
    if(!StringUtils.equals(host.getCredentials().getToken(), ((StorageCredentialsSharedAccessSignature) credentials).getToken())) {
      this.interrupt();
      this.open(proxy, new DisabledHostKeyCallback(), prompt);
    }
  }
  // Fetch reference for directory to check login credentials
  try {
    this.getFeature(ListService.class).list(new AzureHomeFinderService(this).find(), new DisabledListProgressListener() {
      @Override
      public void chunk(final Path parent, final AttributedList<Path> list) throws ListCanceledException {
        throw new ListCanceledException(list);
      }
    });
  }
  catch(ListCanceledException e) {
    // Success
  }
}
com.microsoft.azure.storageStorageCredentialsAccountAndKeyupdateKey

Javadoc

Sets the name of the access key to be used when signing the request.

Popular methods of StorageCredentialsAccountAndKey

  • <init>
    Creates an instance of the StorageCredentialsAccountAndKey class, using the specified storage accoun
  • 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.
  • exportKey
    Exports the value of the access key to an array of bytes.
  • transformUri

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • startActivity (Activity)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Notification (javax.management)
  • JTextField (javax.swing)
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