Sdílet prostřednictvím


KeyEncryptionKey Interface

public interface KeyEncryptionKey

A KeyEncryptionKey defines synchronous methods for encrypting and decrypting keys, also known as key wrapping and unwrapping. It also supports signing and verifying data using the configured key.

Method Summary

Modifier and Type Method and Description
abstract String getKeyId()

Retrieves the key identifier.

abstract byte[] unwrapKey(String algorithm, byte[] encryptedKey)

Decrypts the specified encrypted key using the specified algorithm.

abstract byte[] wrapKey(String algorithm, byte[] key)

Encrypts the specified key using the specified algorithm.

Method Details

getKeyId

public abstract String getKeyId()

Retrieves the key identifier.

Returns:

The key identifier.

unwrapKey

public abstract byte[] unwrapKey(String algorithm, byte[] encryptedKey)

Decrypts the specified encrypted key using the specified algorithm.

Parameters:

algorithm - The key wrap algorithm which was used to encrypt the specified encrypted key.
encryptedKey - The encrypted key content to be decrypted.

Returns:

The decrypted key bytes.

wrapKey

public abstract byte[] wrapKey(String algorithm, byte[] key)

Encrypts the specified key using the specified algorithm.

Parameters:

algorithm - The key wrap algorithm used to encrypt the specified key.
key - The key content to be encrypted.

Returns:

The encrypted key bytes.

Applies to