public final class AzureNamedKeyCredential extends Object
The named credential can be created for keys which have a name identifier associated with them.
Code Samples
Create a named credential for a service specific sas key.
AzureNamedKeyCredential azureNamedKeyCredential = new AzureNamedKeyCredential("AZURE-SERVICE-SAS-KEY-NAME", "AZURE-SERVICE-SAS-KEY");
Constructor and Description |
---|
AzureNamedKeyCredential(String name,
String key)
Creates a credential with specified
name that authorizes request with the given key . |
Modifier and Type | Method and Description |
---|---|
AzureNamedKey |
getAzureNamedKey()
Retrieves the
AzureNamedKey containing the name and key associated with this credential. |
AzureNamedKeyCredential |
update(String name,
String key)
Rotates the
name and key associated to this credential. |
public AzureNamedKeyCredential(String name, String key)
name
that authorizes request with the given key
.name
- The name of the key credential.key
- The key used to authorize requests.NullPointerException
- If key
or name
is null
.IllegalArgumentException
- If key
or name
is an empty string.public AzureNamedKey getAzureNamedKey()
AzureNamedKey
containing the name and key associated with this credential.AzureNamedKey
containing the name and key .public AzureNamedKeyCredential update(String name, String key)
name
and key
associated to this credential.name
- The new name of the key credential.key
- The new key to be associated with this credential.AzureNamedKeyCredential
object.NullPointerException
- If key
or name
is null
.IllegalArgumentException
- If key
or name
is an empty string.Copyright © 2021 Microsoft Corporation. All rights reserved.