# XML Security Library Examples

The following examples demonstrate how to use the XML Security Library to sign, verify, encrypt, and decrypt XML documents.

## Table of Contents

1. [Signing a template file](sign1.md) — Signs an XML document using a pre-created signature template file and a PEM private key.
2. [Signing a dynamically created template](sign2.md) — Signs an XML document using a dynamically created signature template.
3. [Signing enveloped signature with X509 certificate](sign3.md) — Creates an enveloped XML Digital Signature using an X509 certificate.
4. [Signing a node by ID with X509 certificate](sign4.md) — Signs a specific XML node referenced by ID attribute using an X509 certificate.
5. [Verifying a signature with a single key](verify1.md) — Verifies an XML Digital Signature using a single public key loaded from a PEM file.
6. [Verifying a signature with keys manager](verify2.md) — Verifies an XML Digital Signature using a keys manager loaded with multiple keys.
7. [Verifying an enveloped signature with X509 certificates](verify3.md) — Verifies an enveloped XML Digital Signature using X509 certificate chain verification.
8. [Verifying a signature of a node with X509 certificates](verify4.md) — Verifies a node signature with X509 certificates.
9. [Verifying a signature with additional restrictions](verify-saml.md) — Verifies an XML Digital Signature with additional restrictions (SAML-style).
10. [Encrypting data with a template file](encrypt1.md) — Encrypts binary data using a pre-created encryption template file.
11. [Encrypting data with a dynamically created template](encrypt2.md) — Encrypts an XML document using a dynamically created encryption template.
12. [Encrypting data with a session key](encrypt3.md) — Encrypts an XML document using a session key wrapped with an RSA key from the keys manager.
13. [Decrypting data with a single key](decrypt1.md) — Decrypts encrypted XML data using a single DES key loaded from a binary file.
14. [Decrypting data with keys manager](decrypt2.md) — Decrypts encrypted XML data using a keys manager loaded with DES keys.
15. [Writing a custom keys manager](decrypt3.md) — Demonstrates implementing a custom file-based keys store for decryption.

