StorageCredentialsHelper Class
- java.
lang. Object - com.
microsoft. azure. storage. core. StorageCredentialsHelper
- com.
public class StorageCredentialsHelper
RESERVED FOR INTERNAL USE. A helper method for StorageCredentials.
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean |
canCredentialsGenerateClient(final StorageCredentials creds)
RESERVED, for internal use only. Gets a value indicating whether a client can be generated under the Shared Key or Shared Access Signature authentication schemes using the specified credentials. |
boolean |
canCredentialsSignRequest(final StorageCredentials creds)
RESERVED, for internal use only. Gets a value indicating whether a request can be signed under the Shared Key authentication scheme using the specified credentials. |
synchronized byte [] | computeHmac256(final byte[] data, final byte[] key) |
synchronized String |
computeHmac256(final StorageCredentials creds, final String value)
Computes a signature for the specified string using the HMAC-SHA256 algorithm. |
String |
signBlobQueueAndFileRequest(final StorageCredentials creds, final java.net.HttpURLConnection request, final long contentLength, OperationContext opContext)
Signs a request using the specified operation context under either the Shared Key or Token authentication scheme. While this method places the signature on the request, it also returns the signature it set. This is because java.net.HttpURLConnection does not let you read an authorization header once set, and batch needs to set this signature elsewhere. Non-batch-related functions can ignore this return value. |
void |
signTableRequest(final StorageCredentials creds, final java.net.HttpURLConnection request, final long contentLength, OperationContext opContext)
Signs a request using the specified operation context under the Shared Key authentication scheme. |
Method Details
canCredentialsGenerateClient
public static boolean canCredentialsGenerateClient(final StorageCredentials creds)
RESERVED, for internal use only. Gets a value indicating whether a client can be generated under the Shared Key or Shared Access Signature authentication schemes using the specified credentials.
Parameters:
Returns:
true
if a client can be generated with these credentials; otherwise, false
canCredentialsSignRequest
public static boolean canCredentialsSignRequest(final StorageCredentials creds)
RESERVED, for internal use only. Gets a value indicating whether a request can be signed under the Shared Key authentication scheme using the specified credentials.
Parameters:
Returns:
true
if a request can be signed with these credentials; otherwise, false
computeHmac256
public static synchronized byte [] computeHmac256(final byte[] data, final byte[] key)
Parameters:
computeHmac256
public static synchronized String computeHmac256(final StorageCredentials creds, final String value)
Computes a signature for the specified string using the HMAC-SHA256 algorithm.
Parameters:
Returns:
String
that contains the HMAC-SHA256-encoded signature.Throws:
signBlobQueueAndFileRequest
public static String signBlobQueueAndFileRequest(final StorageCredentials creds, final java.net.HttpURLConnection request, final long contentLength, OperationContext opContext)
Signs a request using the specified operation context under either the Shared Key or Token authentication scheme.
While this method places the signature on the request, it also returns the signature it set. This is because java.net.HttpURLConnection does not let you read an authorization header once set, and batch needs to set this signature elsewhere. Non-batch-related functions can ignore this return value.
Parameters:
HttpURLConnection
object that represents the request to sign.
Returns:
Throws:
signTableRequest
public static void signTableRequest(final StorageCredentials creds, final java.net.HttpURLConnection request, final long contentLength, OperationContext opContext)
Signs a request using the specified operation context under the Shared Key authentication scheme.
Parameters:
HttpURLConnection
object that represents the request to sign.
Throws: