Class AzureKeyCredential


  • public final class AzureKeyCredential
    extends java.lang.Object
    Represents a credential that uses a key to authenticate to an Azure Service.
    • Constructor Summary

      Constructors 
      Constructor Description
      AzureKeyCredential​(java.lang.String key)
      Creates a credential that authorizes request with the given key.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getKey()
      Retrieves the key associated to this credential.
      AzureKeyCredential update​(java.lang.String key)
      Rotates the key associated to this credential.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AzureKeyCredential

        public AzureKeyCredential​(java.lang.String key)
        Creates a credential that authorizes request with the given key.
        Parameters:
        key - The key used to authorize requests.
        Throws:
        java.lang.NullPointerException - If key is null.
        java.lang.IllegalArgumentException - If key is an empty string.
    • Method Detail

      • getKey

        public java.lang.String getKey()
        Retrieves the key associated to this credential.
        Returns:
        The key being used to authorize requests.
      • update

        public AzureKeyCredential update​(java.lang.String key)
        Rotates the key associated to this credential.
        Parameters:
        key - The new key to associated with this credential.
        Returns:
        The updated ApiKeyCredential object.
        Throws:
        java.lang.NullPointerException - If key is null.
        java.lang.IllegalArgumentException - If key is an empty string.