StorageCredentialsAccountAndKey Class
- java.
lang. Object - StorageCredentials
- com.
microsoft. azure. storage. StorageCredentialsAccountAndKey
- com.
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. |
Storage |
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:
String
that represents the name of the storage account.
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:
String
that represents the name of the storage account.
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:
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:
getAccountName
public String getAccountName()
Gets the account name.
Returns:
String
that contains the account name.getHmac256
public synchronized Mac getHmac256()
Gets the HmacSha256 associated with the account key.
Returns:
MAC
created with the account key.Throws:
setAccountName
public void setAccountName(String accountName)
Sets the account name.
Parameters:
String
that contains the account name.
toString
public String toString(final boolean exportSecrets)
Returns a that represents this instance, optionally including sensitive data.
Parameters:
true
to include sensitive data in the return string; otherwise, false
.
Returns:
String
that represents this object, optionally including sensitive data.transformUri
public StorageUri transformUri(StorageUri resourceUri, OperationContext opContext)
Parameters:
transformUri
public URI transformUri(URI resourceUri, OperationContext opContext)
Parameters:
updateKey
public synchronized void updateKey(final byte[] key)
Sets the name of the access key to be used when signing the request.
Parameters:
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:
String
that represents the name of the access key to be used when signing the request.
Applies to
Azure SDK for Java