共用方式為


BlobCustomerProvidedKey Class

  • java.lang.Object
    • com.microsoft.azure.storage.blob.BlobCustomerProvidedKey

public class BlobCustomerProvidedKey

Immutable wrapper for an encryption key to be used with client provided key encryption.

Constructor Summary

Constructor Description
BlobCustomerProvidedKey(byte[] key)

Creates a new wrapper for a client provided key.

BlobCustomerProvidedKey(String key)

Creates a new wrapper for a client provided key.

Method Summary

Modifier and Type Method and Description
String getEncryptionAlgorithm()

Gets the algorithm to use this key with.

String getKey()

Gets the encryption key.

String getKeySHA256()

Gets the encryption key's hash.

Constructor Details

BlobCustomerProvidedKey

public BlobCustomerProvidedKey(byte[] key)

Creates a new wrapper for a client provided key.

Parameters:

key - The encryption key bytes.

Throws:

NoSuchAlgorithmException - Throws if MessageDigest "SHA-256" cannot be found.

BlobCustomerProvidedKey

public BlobCustomerProvidedKey(String key)

Creates a new wrapper for a client provided key.

Parameters:

key - The encryption key encoded as a base64 string.

Throws:

NoSuchAlgorithmException - Throws if MessageDigest "SHA-256" cannot be found.

Method Details

getEncryptionAlgorithm

public String getEncryptionAlgorithm()

Gets the algorithm to use this key with.

Returns:

A label for the encryption algorithm, as understood by Azure Storage.

getKey

public String getKey()

Gets the encryption key.

Returns:

A base64 encoded string of the encryption key.

getKeySHA256

public String getKeySHA256()

Gets the encryption key's hash.

Returns:

A base64 encoded string of the encryption key hash.

Applies to