public final class AzureSasCredential extends Object
Constructor and Description |
---|
AzureSasCredential(String signature)
Creates a credential that authorizes request with the given shared access signature.
|
AzureSasCredential(String signature,
Function<String,String> signatureEncoder)
Creates a credential that authorizes request within the given shared access signature.
|
Modifier and Type | Method and Description |
---|---|
String |
getSignature()
Retrieves the shared access signature associated to this credential.
|
AzureSasCredential |
update(String signature)
Rotates the shared access signature associated to this credential.
|
public AzureSasCredential(String signature)
The signature
passed is assumed to be encoded. This constructor is effectively the same as calling new AzureSasCredential(signature, null))
.
signature
- The shared access signature used to authorize requests.NullPointerException
- If signature
is null
.IllegalArgumentException
- If signature
is an empty string.public AzureSasCredential(String signature, Function<String,String> signatureEncoder)
If signatureEncoder
is non-null the signature
, and all updated
signatures
, will be encoded using the function. signatureEncoder
should be as idempotent as possible to
reduce the chance of double encoding errors.
signature
- The shared access signature used to authorize requests.signatureEncoder
- An optional function which encodes the signature
.NullPointerException
- If signature
is null
.IllegalArgumentException
- If signature
is an empty string.public String getSignature()
public AzureSasCredential update(String signature)
signature
- The new shared access signature to be associated with this credential.AzureSasCredential
object.NullPointerException
- If signature
is null
.IllegalArgumentException
- If signature
is an empty string.Copyright © 2021 Microsoft Corporation. All rights reserved.