Package com.azure.core.credential
Class AzureKeyCredential
java.lang.Object
com.azure.core.credential.KeyCredential
com.azure.core.credential.AzureKeyCredential
Represents a credential that uses a key to authenticate to an Azure Service.
-
Constructor Summary
ConstructorDescriptionAzureKeyCredential
(String key) Creates a credential that authorizes request with the given key. -
Method Summary
Modifier and TypeMethodDescriptionRotates the key associated to this credential.Methods inherited from class com.azure.core.credential.KeyCredential
getKey
-
Constructor Details
-
AzureKeyCredential
Creates a credential that authorizes request with the given key.- Parameters:
key
- The key used to authorize requests.- Throws:
NullPointerException
- Ifkey
isnull
.IllegalArgumentException
- Ifkey
is an empty string.
-
-
Method Details
-
update
Rotates the key associated to this credential.- Overrides:
update
in classKeyCredential
- Parameters:
key
- The new key to associated with this credential.- Returns:
- The updated
AzureKeyCredential
object. - Throws:
NullPointerException
- Ifkey
isnull
.IllegalArgumentException
- Ifkey
is an empty string.
-