Class KeyEncryptionKeyClient

java.lang.Object
com.azure.security.keyvault.keys.cryptography.CryptographyClient
com.azure.security.keyvault.keys.cryptography.KeyEncryptionKeyClient
All Implemented Interfaces:
com.azure.core.cryptography.KeyEncryptionKey

public final class KeyEncryptionKeyClient extends CryptographyClient implements com.azure.core.cryptography.KeyEncryptionKey
A key client which is used to synchronously wrap or unwrap another key.
  • Method Details

    • getKeyId

      public String getKeyId()
      Get the identifier of the key to use for cryptography operations.
      Specified by:
      getKeyId in interface com.azure.core.cryptography.KeyEncryptionKey
      Returns:
      The key identifier.
    • wrapKey

      public byte[] wrapKey(String algorithm, byte[] key)
      Encrypts the specified key using the specified algorithm.
      Specified by:
      wrapKey in interface com.azure.core.cryptography.KeyEncryptionKey
      Parameters:
      algorithm - The key wrap algorithm used to encrypt the specified key.
      key - The key content to be encrypted.
      Returns:
      The encrypted key bytes.
    • unwrapKey

      public byte[] unwrapKey(String algorithm, byte[] encryptedKey)
      Decrypts the specified encrypted key using the specified algorithm.
      Specified by:
      unwrapKey in interface com.azure.core.cryptography.KeyEncryptionKey
      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.