public final class Credentials extends Object
| Constructor and Description |
|---|
Credentials(String accountName,
byte[] key)
Creates an instance of the
Credentials class, using the specified storage account name and access
key; the specified access key is in the form of a byte array. |
Credentials(String accountName,
String key)
Creates an instance of the
Credentials class, using the specified storage account name and access
key; the specified access key is stored as a Base64-encoded 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 to be used when signing the request.
|
StorageKey |
getKey()
Returns the access key to be used when signing the request.
|
String |
getKeyName()
Gets the name of the access key to be used when signing the request.
|
protected void |
setAccountName(String accountName)
Sets the account name to be used when signing the request.
|
protected void |
setKeyName(String keyName)
Sets the name of the access key to be used when signing the request.
|
public Credentials(String accountName, byte[] key)
Credentials 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 Credentials(String accountName, String key)
Credentials class, using the specified storage account name and access
key; the specified access key is stored as a Base64-encoded String.accountName - A String that represents the name of the storage account.key - A String that represents the Base64-encoded account access key.public String exportBase64EncodedKey()
String that represents the Base64-encoded access key.public byte[] exportKey()
public String getAccountName()
String that represents the account name to be used when signing the request.public String getKeyName()
public StorageKey getKey()
String that represents the access key to be used when signing the request.protected void setAccountName(String accountName)
accountName - A String that represents the account name being set.protected void setKeyName(String keyName)
keyName - A String that represents the name of the access key to be used when signing the request./**
* 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.
*/