Discuss this help topic in SecureBlackbox Forum
XML: Decrypt data
To decrypt the encrypted data, you need to
-
Load the encrypted data into an instance of TElXMLDecryptor class using its Load() method.
You can pass either TElXMLDOMDocument or TElXMLDOMElement to Load() method.
The passed node must be either an encrypted data (have the tag name EncryptedData) or contain EncryptedData node as one of its child nodes.
-
Check TElXMLDecryptor.EncryptKey property to find out,
whether the encrypted block includes an encrypted session key (a key, used to encrypt the data).
If the key is present (EncryptKey is true),
then you need to provide a key for decryption of the session key.
If the session key is not present, then you need to provide a session key.
-
If there's no encrypted session key, then you need to specify the symmteric key to be used for decryption.
The procedure of using the symmetric key is described in the corresponding how-to article.
-
If the encrypted session key is present, you need to first check the way the session key was encrypted.
To do this, read the value of KeyEncryptionType property of TElXMLDecryptor class.
If the value of this property is xetKeyWrap, then you need to specify the symmteric key to be used for decryption.
The procedure of using the symmetric key is described in the corresponding how-to article.
If the value of the property is xetKeyTransport, then you need to specify the RSA key, X.509 certificate or OpenPGP secret key to be used for decryption.
The procedure of using the mentioned keys is described in the corresponding how-to article.
-
Check TElXMLDecryptor.EncryptedDataType property to find out,
what you are decrypting - an XML document, XML node or external data.
-
Decrypt the data by calling TElXMLDecryptor.Decrypt() method.
If you are decrypting external data, you can pass null/nil/Nothing as a parameter.
If you are decrypting an XML document or an XML node,
then you need to specify the instance of TElXMLDOMDocument
which will become the owner of the decrypted XML nodes.
For decryption of XML documents and nodes see the corresponding how-to article.
For decryption of external data see the corresponding how-to article.
How To articles about XML encryption (XMLEnc)
Discuss this help topic in SecureBlackbox Forum