StorageCredentialsAccountAndKey.@Deprecated public final class StorageKey extends Object
| Constructor and Description |
|---|
StorageKey(byte[] key)
Deprecated.
Creates an instance of the
StorageKey class. |
| Modifier and Type | Method and Description |
|---|---|
static String |
computeMacSha256(StorageKey storageKey,
String stringToSign)
Deprecated.
Computes a signature for the specified string using the HMAC-SHA256 algorithm.
|
static String |
computeMacSha512(StorageKey storageKey,
String stringToSign)
Deprecated.
Computes a signature for the specified string using the HMAC-SHA512 algorithm.
|
String |
getBase64EncodedKey()
Deprecated.
Returns the Base64-encoded key.
|
byte[] |
getKey()
Deprecated.
Returns the key.
|
void |
setKey(byte[] key)
Deprecated.
Sets the key to be used, using the specified byte array as the key.
|
void |
setKey(String key)
Deprecated.
Sets the key to be used, using the specified
String as the key. |
public StorageKey(byte[] key)
StorageKey class.key - An array of bytes that represent the storage key.public static String computeMacSha256(StorageKey storageKey, String stringToSign) throws InvalidKeyException
storageKey - A StorageKey object that represents the storage key to use.stringToSign - The UTF-8-encoded string to sign.String that contains the HMAC-SHA256-encoded signature.IllegalArgumentException - If the string to sign is not a valid Base64-encoded string.InvalidKeyException - If the key is not a valid storage key.public static String computeMacSha512(StorageKey storageKey, String stringToSign) throws InvalidKeyException
storageKey - A StorageKey object that represents the storage key to use.stringToSign - The UTF-8-encoded string to sign.String that contains the HMAC-SHA512-encoded signature.IllegalArgumentException - If the string to sign is not a valid Base64-encoded string.InvalidKeyException - If the key is not a valid storage key.public String getBase64EncodedKey()
String that represents the Base64-encoded key.public byte[] getKey()
public void setKey(byte[] key)
key - A byte array that represents the key being assigned.public void setKey(String key)
String as the key.
This method is provided to support key rotation. This method is not thread-safe.key - A String that represents the key being assigned.Copyright © 2015. All Rights Reserved.