AzureSasCredential Class

  • java.lang.Object
    • com.azure.core.credential.AzureSasCredential

public final class AzureSasCredential

Represents a credential that uses a shared access signature to authenticate to an Azure Service.

Constructor Summary

Constructor 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.

Method Summary

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.

Methods inherited from java.lang.Object

Constructor Details

AzureSasCredential

public AzureSasCredential(String signature)

Creates a credential that authorizes request with the given shared access signature.

The signature passed is assumed to be encoded. This constructor is effectively the same as calling AzureSasCredential(String signature, Function<String,String> signatureEncoder).

Parameters:

signature - The shared access signature used to authorize requests.

AzureSasCredential

public AzureSasCredential(String signature, Function signatureEncoder)

Creates a credential that authorizes request within the given shared access signature.

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.

Parameters:

signature - The shared access signature used to authorize requests.
signatureEncoder - An optional function which encodes the signature.

Method Details

getSignature

public String getSignature()

Retrieves the shared access signature associated to this credential.

Returns:

The shared access signature being used to authorize requests.

update

public AzureSasCredential update(String signature)

Rotates the shared access signature associated to this credential.

Parameters:

signature - The new shared access signature to be associated with this credential.

Returns:

The updated AzureSasCredential object.

Applies to