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, tryParseCredentialspublic 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 StorageCredentialsString 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 StorageCredentialsexportSecrets - 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)
StorageCredentialstransformUri in class StorageCredentialsresourceUri - 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)
StorageCredentialstransformUri in class StorageCredentialsresourceUri - 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 Microsoft Corporation 
* 
* Licensed under the Apache License, Version 2.0 (the "License"); 
* you may not use this file except in compliance with the License. 
* You may obtain a copy of the License at 
* http://www.apache.org/licenses/LICENSE-2.0 
* 
* Unless required by applicable law or agreed to in writing, software 
* distributed under the License is distributed on an "AS IS" BASIS, 
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
* See the License for the specific language governing permissions and 
* limitations under the License. 
*/