Skip to content

Tutorial Index

Aleksey Sanin edited this page Apr 11, 2026 · 3 revisions

XML Security Library Tutorial

This tutorial explains how to use XML Security Library to perform XML Digital Signature and XML Encryption operations. For the complete API reference, see the XML Security Library API Reference. For code examples, see the XML Security Library Examples.

Table of Contents

Overview

The XML Security Library supports XML Digital Signature and XML Encryption. It is based on LibXML/LibXSLT and can use almost any cryptographic library (currently, there is out-of-the-box support for OpenSSL, Microsoft Crypto API, Microsoft Cryptography API: Next Generation (CNG), GnuTLS, GCrypt, and NSS).

XML Security Library Structure

To support different crypto engines, the XML Security Library is split into two parts: the core library (xmlsec) and the crypto library (xmlsec-openssl, xmlsec-mscrypt, xmlsec-mscng, xmlsec-gnutls, xmlsec-gcrypt, xmlsec-nss, ...).

Figure: The library structure and dependencies

The library structure and dependencies

The core library has no dependencies on any crypto library and implements all engines as well as all non-crypto transforms (XML parser, C14N transforms, XPath and XSLT transforms, ...). The XML Security Crypto library implements crypto transforms, crypto key data, and key data stores. An application links against a particular XML Security Crypto library (or even multiple libraries), but the application code itself can still be general enough that switching the crypto engine requires changing only a few #include directives.

Clone this wiki locally