public class StorageCredentialsHelper extends Object
| Constructor and Description |
|---|
StorageCredentialsHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canCredentialsSignRequest(StorageCredentials creds)
Reserved.
|
static boolean |
canCredentialsSignRequestLite(StorageCredentials creds)
Deprecated.
as of 2.0.0. Use
canCredentialsSignRequest(com.microsoft.azure.storage.StorageCredentials) instead. |
static String |
computeHmac256(StorageCredentials creds,
String value)
Computes a signature for the specified string using the HMAC-SHA256 algorithm.
|
static String |
computeHmac256(StorageCredentials creds,
String value,
OperationContext opContext)
Computes a signature for the specified string using the HMAC-SHA256 algorithm with the specified operation
context.
|
static void |
signBlobAndQueueRequest(StorageCredentials creds,
HttpURLConnection request,
long contentLength)
Signs a request under the Shared Key authentication scheme.
|
static void |
signBlobAndQueueRequest(StorageCredentials creds,
HttpURLConnection request,
long contentLength,
OperationContext opContext)
Signs a request using the specified operation context under the Shared Key authentication scheme.
|
static void |
signBlobAndQueueRequestLite(StorageCredentials creds,
HttpURLConnection request,
long contentLength)
Deprecated.
|
static void |
signBlobAndQueueRequestLite(StorageCredentials creds,
HttpURLConnection request,
long contentLength,
OperationContext opContext)
Deprecated.
|
static void |
signTableRequest(StorageCredentials creds,
HttpURLConnection request,
long contentLength)
Signs a request under the Shared Key authentication scheme.
|
static void |
signTableRequest(StorageCredentials creds,
HttpURLConnection request,
long contentLength,
OperationContext opContext)
Signs a request using the specified operation context under the Shared Key authentication scheme.
|
static void |
signTableRequestLite(StorageCredentials creds,
HttpURLConnection request,
long contentLength)
Deprecated.
as of 2.0.0. Use
signTableRequest(com.microsoft.azure.storage.StorageCredentials, java.net.HttpURLConnection, long) instead. |
static void |
signTableRequestLite(StorageCredentials creds,
HttpURLConnection request,
long contentLength,
OperationContext opContext)
Deprecated.
as of 2.0.0. Use
signTableRequest(com.microsoft.azure.storage.StorageCredentials, java.net.HttpURLConnection, long) instead. |
public static boolean canCredentialsSignRequest(StorageCredentials creds)
@Deprecated public static boolean canCredentialsSignRequestLite(StorageCredentials creds)
canCredentialsSignRequest(com.microsoft.azure.storage.StorageCredentials) instead.public static String computeHmac256(StorageCredentials creds, String value) throws InvalidKeyException
value - The UTF-8-encoded string to sign.String that contains the HMAC-SHA256-encoded signature.InvalidKeyException - If the key is not a valid Base64-encoded string.public static String computeHmac256(StorageCredentials creds, String value, OperationContext opContext) throws InvalidKeyException
value - The UTF-8-encoded string to sign.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.String that contains the HMAC-SHA256-encoded signature.InvalidKeyException - If the key is not a valid Base64-encoded string.public static void signBlobAndQueueRequest(StorageCredentials creds, HttpURLConnection request, long contentLength) throws InvalidKeyException, StorageException
request - An HttpURLConnection object that represents the request to sign.contentLength - The length of the content written to the output stream. If unknown, specify -1.InvalidKeyException - If the given key is invalid.StorageException - If a storage service error occurred.public static void signBlobAndQueueRequest(StorageCredentials creds, HttpURLConnection request, long contentLength, OperationContext opContext) throws InvalidKeyException, StorageException
request - An HttpURLConnection object that represents the request to sign.contentLength - The length of the content written to the output stream. If unknown, specify -1.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.InvalidKeyException - If the given key is invalid.StorageException - If a storage service error occurred.@Deprecated public static void signBlobAndQueueRequestLite(StorageCredentials creds, HttpURLConnection request, long contentLength) throws InvalidKeyException, StorageException
signBlobAndQueueRequest(com.microsoft.azure.storage.StorageCredentials, java.net.HttpURLConnection, long) instead.request - An HttpURLConnection object that represents the request to sign.contentLength - The length of the content written to the output stream. If unknown, specify -1.InvalidKeyException - If the given key is invalid.StorageException - If an unspecified storage exception occurs.@Deprecated public static void signBlobAndQueueRequestLite(StorageCredentials creds, HttpURLConnection request, long contentLength, OperationContext opContext) throws StorageException, InvalidKeyException
signBlobAndQueueRequest(com.microsoft.azure.storage.StorageCredentials, java.net.HttpURLConnection, long) instead.request - An HttpURLConnection object that represents the request to sign.contentLength - The length of the content written to the output stream. If unknown, specify -1.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.InvalidKeyException - If the given key is invalid.StorageException - If a storage service error occurred.public static void signTableRequest(StorageCredentials creds, HttpURLConnection request, long contentLength) throws InvalidKeyException, StorageException
request - An HttpURLConnection object that represents the request to sign.contentLength - The length of the content written to the output stream. If unknown, specify -1.InvalidKeyException - If the given key is invalid.StorageException - If a storage service error occurred.public static void signTableRequest(StorageCredentials creds, HttpURLConnection request, long contentLength, OperationContext opContext) throws InvalidKeyException, StorageException
request - An HttpURLConnection object that represents the request to sign.contentLength - The length of the content written to the output stream. If unknown, specify -1.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.InvalidKeyException - If the given key is invalid.StorageException - If a storage service error occurred.@Deprecated public static void signTableRequestLite(StorageCredentials creds, HttpURLConnection request, long contentLength) throws InvalidKeyException, StorageException
signTableRequest(com.microsoft.azure.storage.StorageCredentials, java.net.HttpURLConnection, long) instead.request - An HttpURLConnection object that represents the request to sign.contentLength - The length of the content written to the output stream. If unknown, specify -1.InvalidKeyException - If the given key is invalid.StorageException - If an unspecified storage exception occurs.@Deprecated public static void signTableRequestLite(StorageCredentials creds, HttpURLConnection request, long contentLength, OperationContext opContext) throws StorageException, InvalidKeyException
signTableRequest(com.microsoft.azure.storage.StorageCredentials, java.net.HttpURLConnection, long) instead.request - An HttpURLConnection object that represents the request to sign.contentLength - The length of the content written to the output stream. If unknown, specify -1.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.InvalidKeyException - If the given key is invalid.StorageException - If a storage service error occurred./**
* 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.
*/