Repository navigation
Examples Index
Aleksey Sanin edited this page Apr 5, 2026
·
2 revisions
The following examples demonstrate how to use the XML Security Library to sign, verify, encrypt, and decrypt XML documents.
- Signing a template file — Signs an XML document using a pre-created signature template file and a PEM private key.
- Signing a dynamically created template — Signs an XML document using a dynamically created signature template.
- Signing enveloped signature with X509 certificate — Creates an enveloped XML Digital Signature using an X509 certificate.
- Signing a node by ID with X509 certificate — Signs a specific XML node referenced by ID attribute using an X509 certificate.
- Verifying a signature with a single key — Verifies an XML Digital Signature using a single public key loaded from a PEM file.
- Verifying a signature with keys manager — Verifies an XML Digital Signature using a keys manager loaded with multiple keys.
- Verifying an enveloped signature with X509 certificates — Verifies an enveloped XML Digital Signature using X509 certificate chain verification.
- Verifying a signature of a node with X509 certificates — Verifies a node signature with X509 certificates.
- Verifying a signature with additional restrictions — Verifies an XML Digital Signature with additional restrictions (SAML-style).
- Encrypting data with a template file — Encrypts binary data using a pre-created encryption template file.
- Encrypting data with a dynamically created template — Encrypts an XML document using a dynamically created encryption template.
- Encrypting data with a session key — Encrypts an XML document using a session key wrapped with an RSA key from the keys manager.
- Decrypting data with a single key — Decrypts encrypted XML data using a single DES key loaded from a binary file.
- Decrypting data with keys manager — Decrypts encrypted XML data using a keys manager loaded with DES keys.
- Writing a custom keys manager — Demonstrates implementing a custom file-based keys store for decryption.