StorageCredentialsAccountAndKey Class

  • java.lang.Object

public class StorageCredentialsAccountAndKey extends StorageCredentials

Represents storage account credentials, based on storage account and access key, for accessing the Microsoft Azure storage services.

Constructor Summary

Constructor Description
StorageCredentialsAccountAndKey(final String accountName, final byte[] key)

Creates an instance of the class, using the specified storage account name and access key; the specified access key is in the form of a byte array.

StorageCredentialsAccountAndKey(final String accountName, final String key)

Creates an instance of the class, using the specified storage account name and access key; the specified access key is stored as a .

Method Summary

Modifier and Type Method and Description
String exportBase64EncodedKey()

Exports the value of the access key to a Base64-encoded string.

byte [] exportKey()

Exports the value of the access key to an array of bytes.

String getAccountName()

Gets the account name.

synchronized Mac getHmac256()

Gets the HmacSha256 associated with the account key.

void setAccountName(String accountName)

Sets the account name.

String toString(final boolean exportSecrets)

Returns a that represents this instance, optionally including sensitive data.

StorageUri transformUri(StorageUri resourceUri, OperationContext opContext)
URI transformUri(URI resourceUri, OperationContext opContext)
synchronized void updateKey(final byte[] key)

Sets the name of the access key to be used when signing the request.

synchronized void updateKey(final String key)

Sets the name of the access key to be used when signing the request.

Inherited Members

Constructor Details

StorageCredentialsAccountAndKey

public StorageCredentialsAccountAndKey(final String accountName, final byte[] key)

Creates an instance of the class, using the specified storage account name and access key; the specified access key is in the form of a byte array.

Parameters:

accountName - A String that represents the name of the storage account.
key - An array of bytes that represent the account access key.

StorageCredentialsAccountAndKey

public StorageCredentialsAccountAndKey(final String accountName, final String key)

Creates an instance of the class, using the specified storage account name and access key; the specified access key is stored as a .

Parameters:

accountName - A String that represents the name of the storage account.
key - A String that represents the Base-64-encoded account access key.

Method Details

exportBase64EncodedKey

public String exportBase64EncodedKey()

Exports the value of the access key to a Base64-encoded string.

Returns:

A String that represents the Base64-encoded access key.

exportKey

public byte [] exportKey()

Exports the value of the access key to an array of bytes.

Returns:

A byte array that represents the access key.

getAccountName

public String getAccountName()

Gets the account name.

Returns:

A String that contains the account name.

getHmac256

public synchronized Mac getHmac256()

Gets the HmacSha256 associated with the account key.

Returns:

A MAC created with the account key.

Throws:

InvalidKeyException - If the key is not a valid storage key.

setAccountName

public void setAccountName(String accountName)

Sets the account name.

Parameters:

accountName - A String that contains the account name.

toString

public String toString(final boolean exportSecrets)

Returns a that represents this instance, optionally including sensitive data.

Parameters:

exportSecrets -

true to include sensitive data in the return string; otherwise, false.

Returns:

A String that represents this object, optionally including sensitive data.

transformUri

public StorageUri transformUri(StorageUri resourceUri, OperationContext opContext)

Parameters:

resourceUri
opContext

transformUri

public URI transformUri(URI resourceUri, OperationContext opContext)

Parameters:

resourceUri
opContext

updateKey

public synchronized void updateKey(final byte[] key)

Sets the name of the access key to be used when signing the request.

Parameters:

key - A String that represents the name of the access key to be used when signing the request.

updateKey

public synchronized void updateKey(final String key)

Sets the name of the access key to be used when signing the request.

Parameters:

key - A String that represents the name of the access key to be used when signing the request.

Applies to