public final class StorageCredentialsAccountAndKey extends StorageCredentials
Constructor and Description |
---|
StorageCredentialsAccountAndKey(String accountName,
byte[] key)
Creates an instance of the
StorageCredentialsAccountAndKey class, using the specified storage
account name and access key; the specified access key is in the form of a byte array. |
StorageCredentialsAccountAndKey(String accountName,
String key)
Creates an instance of the
StorageCredentialsAccountAndKey class, using the specified storage
account name and access key; the specified access key is stored as a String . |
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.
|
Mac |
getHmac256()
Gets the HmacSha256 associated with the account key.
|
void |
setAccountName(String accountName)
Sets the account name.
|
String |
toString(boolean exportSecrets)
Returns a
String that represents this instance, optionally including sensitive data. |
StorageUri |
transformUri(StorageUri resourceUri,
OperationContext opContext)
Transforms a resource URI into a shared access signature URI, by appending a shared access token and using the
specified operation context.
|
URI |
transformUri(URI resourceUri,
OperationContext opContext)
Transforms a resource URI into a shared access signature URI, by appending a shared access token and using the
specified operation context.
|
void |
updateKey(byte[] key)
Sets the name of the access key to be used when signing the request.
|
void |
updateKey(String key)
Sets the name of the access key to be used when signing the request.
|
isHttpsOnly, transformUri, transformUri, tryParseCredentials
public StorageCredentialsAccountAndKey(String accountName, byte[] key)
StorageCredentialsAccountAndKey
class, using the specified storage
account name and access key; the specified access key is in the form of a byte array.accountName
- A String
that represents the name of the storage account.key
- An array of bytes that represent the account access key.public StorageCredentialsAccountAndKey(String accountName, String key)
StorageCredentialsAccountAndKey
class, using the specified storage
account name and access key; the specified access key is stored as a String
.accountName
- A String
that represents the name of the storage account.key
- A String
that represents the Base-64-encoded account access key.public String getAccountName()
getAccountName
in class StorageCredentials
String
that contains the account name.public String exportBase64EncodedKey()
String
that represents the Base64-encoded access key.public byte[] exportKey()
public void setAccountName(String accountName)
accountName
- A String
that contains the account name.public void updateKey(String key)
key
- A String
that represents the name of the access key to be used when signing the request.public void updateKey(byte[] key)
key
- A String
that represents the name of the access key to be used when signing the request.public String toString(boolean exportSecrets)
String
that represents this instance, optionally including sensitive data.toString
in class StorageCredentials
exportSecrets
- true
to include sensitive data in the return string; otherwise, false
.String
that represents this object, optionally including sensitive data.public URI transformUri(URI resourceUri, OperationContext opContext)
StorageCredentials
transformUri
in class StorageCredentials
resourceUri
- A java.net.URI
object that represents the resource URI to be transformed.opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.java.net.URI
object that represents the signature, including the resource URI and the
shared access token.public StorageUri transformUri(StorageUri resourceUri, OperationContext opContext)
StorageCredentials
transformUri
in class StorageCredentials
resourceUri
- A StorageUri
object that represents the resource URI to be transformed.opContext
- An OperationContext
object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageUri
object that represents the signature, including the resource URI and the
shared access token.public Mac getHmac256() throws InvalidKeyException
MAC
created with the account key.InvalidKeyException
- If the key is not a valid storage key.Copyright © 2018. All Rights Reserved.