Class CosmosKeyCredential


  • public class CosmosKeyCredential
    extends Object
    Cosmos Key Credential is used to store key credentials, in order to support dynamic key rotation. Singleton instance should be used to support multiple keys. Azure client library for Cosmos ensures to use the updated key provided in the same singleton instance which was used when building CosmosClient
    • Constructor Detail

      • CosmosKeyCredential

        public CosmosKeyCredential​(String key)
    • Method Detail

      • key

        public String key()
        Returns the key stored in Cosmos Key Credential
        Returns:
        key
      • key

        public CosmosKeyCredential key​(String key)
        Sets the key to be used in CosmosKeyCredential
        Parameters:
        key - key to be used in CosmosKeyCredential
        Returns:
        current CosmosKeyCredential
      • keyHashCode

        public int keyHashCode()
        CosmosKeyCredential stores the computed hashcode of the key for performance improvements.
        Returns:
        hashcode of the key