decrypt-xml() #

boolean decrypt-xml(encrypted_data, string private_key [, string passphrase = ""])

Decrypts an EncryptedData XML element which was encrypted using XML Encryption and replaces it with its unencrypted counterpart.

Returns true() if encrypted_data was successfully decrypted, false() otherwise.

Example #

<flow>
  …
  <eval out="$document">xml-parse($encrypted-xml-string)</eval>

  <template>
  {{if decrypt-xml($document, $env/PRIVATE_KEY, $env/PASSPHRASE]) }}
    Decrypted ciphertext: {{ $document }}
  {{else}}
    Decryption failed!
  {{end}}
  </template>
<flow>