StorageSharedKeyCredential Class
- java.
lang. Object - com.
azure. storage. common. StorageSharedKeyCredential
- com.
public final class StorageSharedKeyCredential
SharedKey credential policy that is put into a header to authorize requests.
Constructor Summary
Constructor | Description |
---|---|
StorageSharedKeyCredential(String accountName, String accountKey) |
Initializes a new instance of Storage |
Method Summary
Methods inherited from java.lang.Object
Constructor Details
StorageSharedKeyCredential
public StorageSharedKeyCredential(String accountName, String accountKey)
Initializes a new instance of StorageSharedKeyCredential contains an account's name and its primary or secondary accountKey.
Parameters:
Method Details
computeHmac256
public String computeHmac256(String stringToSign)
Computes a signature for the specified string using the HMAC-SHA256 algorithm. Package-private because it is used to generate SAS signatures.
Parameters:
Returns:
String
that contains the HMAC-SHA256-encoded signature.fromAzureNamedKeyCredential
public static StorageSharedKeyCredential fromAzureNamedKeyCredential(AzureNamedKeyCredential azureNamedKeyCredential)
Creates a SharedKey credential from the passed AzureNamedKeyCredential.
Parameters:
Returns:
fromConnectionString
public static StorageSharedKeyCredential fromConnectionString(String connectionString)
Creates a SharedKey credential from the passed connection string.
Code Samples
StorageSharedKeyCredential credential = StorageSharedKeyCredential.fromConnectionString(connectionString);
Parameters:
Returns:
generateAuthorizationHeader
public String generateAuthorizationHeader(URL requestURL, String httpMethod, HttpHeaders headers, boolean logStringToSign)
Generates the SharedKey Authorization value from information in the request.
Parameters:
Returns:
generateAuthorizationHeader
public String generateAuthorizationHeader(URL requestURL, String httpMethod, Map
Generates the SharedKey Authorization value from information in the request.
Parameters:
Returns:
generateAuthorizationHeader
public String generateAuthorizationHeader(URL requestURL, String httpMethod, Map
Generates the SharedKey Authorization value from information in the request.
Parameters:
Returns:
getAccountName
public String getAccountName()
Gets the account name associated with the request.
Returns:
getSharedKeyCredentialFromPipeline
public static StorageSharedKeyCredential getSharedKeyCredentialFromPipeline(HttpPipeline httpPipeline)
Searches for a StorageSharedKeyCredential in the HttpPipeline.
Parameters:
Returns:
Applies to
Azure SDK for Java
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour