xml.Encryption.encryptKey

Encrypts the given symmetric or HMAC key as an EncryptedKey node and returns it as root node of a new XML document .

Syntax

encryptKey(
   key xml.CryptoKey )
  RETURNING doc xml.DomDocument
  1. key is the given symmetric or HMAC key as an EncryptedKey node.

Usage

Returns it as root node of a new XML document. The key-encryption key must been set otherwise it will fail.

Depending on the feature set on the key-encryption key, the returned XML document will contain an additional KeyInfo node.

In case of error, the method throws an exception and sets the STATUS variable. Depending on the error, a human-readable description of the problem is available in the SQLCA.SQLERRM register. See Error handling in GWS calls (STATUS).