xml.Encryption.setKeyEncryptionKey

Assigns a copy of the key-encryption key to this Encryption object.

Syntax

setKeyEncryptionKey(
   key xml.CryptoKey )
  1. key is the key-encryption key.

Usage

Any further XML encryption will use that key-encryption key to encrypt the symmetric key set with setKey() within the resulting XML, and any further XML decryption will use that key-encryption key to decrypt the embedded symmetric key.
  • NULL is allowed, meaning that embedded symmetric keys will not be encrypted nor decrypted anymore, assuming that they have been exchanged in another way.

  • Only public or private RSA keys, or key-wrap keys are allowed.

  • Public RSA keys can encrypt but not decrypt.

In case of error, the method throws an exception and sets the STATUS variable with the appropriate error number.