Skip to content

API XMLSec GnuTLS X509

Aleksey Sanin edited this page Jun 22, 2026 · 5 revisions

GnuTLS X.509 Support

API Group: xmlsec_gnutls_x509

X.509 certificate handling for the GnuTLS back-end.

X509 certificates verification support functions for GnuTLS.

X509 certificates support functions for GnuTLS.

X509 certificates implementation for GnuTLS. X509 certificates implementation for GnuTLS.

Macros

xmlSecGnuTLSKeyDataX509Id

Defined as: xmlSecGnuTLSKeyDataX509GetKlass()

Source: include/xmlsec/gnutls/x509.h

The GnuTLS X509 data klass.


xmlSecGnuTLSKeyDataRawX509CertId

Defined as: xmlSecGnuTLSKeyDataRawX509CertGetKlass()

Source: include/xmlsec/gnutls/x509.h

The GnuTLS raw X509 certificate klass.


xmlSecGnuTLSX509StoreId

Defined as: xmlSecGnuTLSX509StoreGetKlass()

Source: include/xmlsec/gnutls/x509.h

The GnuTLS X509 store klass.


Functions

xmlSecGnuTLSKeyDataX509GetKlass

xmlSecKeyDataId xmlSecGnuTLSKeyDataX509GetKlass(void);

Source: include/xmlsec/gnutls/x509.h

The GnuTLS X509 key data klass.

The GnuTLS X509 key data klass (http://www.w3.org/TR/xmldsig-core/#sec-X509Data).

Returns: the X509 data klass.


xmlSecGnuTLSKeyDataX509GetKeyCert

gnutls_x509_crt_t xmlSecGnuTLSKeyDataX509GetKeyCert(xmlSecKeyDataPtr data);

Source: include/xmlsec/gnutls/x509.h

Gets the certificate from which the key was extracted.

Parameters:

  • data — the pointer to X509 key data.

Returns: the key's certificate or NULL if key data was not used for key extraction or an error occurs.


xmlSecGnuTLSKeyDataX509AdoptKeyCert

int xmlSecGnuTLSKeyDataX509AdoptKeyCert(xmlSecKeyDataPtr data, gnutls_x509_crt_t cert);

Source: include/xmlsec/gnutls/x509.h

Adds certificate to the X509 key data and sets the it as the key's.

Parameters:

  • data — the pointer to X509 key data.
  • cert — the pointer to GnuTLS X509 certificate. certificate in data. On success, the data owns the cert.

Returns: 0 on success or a negative value if an error occurs.


xmlSecGnuTLSKeyDataX509AdoptCert

int xmlSecGnuTLSKeyDataX509AdoptCert(xmlSecKeyDataPtr data, gnutls_x509_crt_t cert);

Source: include/xmlsec/gnutls/x509.h

Adds certificate to the X509 key data.

Parameters:

  • data — the pointer to X509 key data.
  • cert — the pointer to GnuTLS X509 certificate.

Returns: 0 on success or a negative value if an error occurs.


xmlSecGnuTLSKeyDataX509GetCert

gnutls_x509_crt_t xmlSecGnuTLSKeyDataX509GetCert(xmlSecKeyDataPtr data, xmlSecSize pos);

Source: include/xmlsec/gnutls/x509.h

Gets a certificate from X509 key data.

Parameters:

  • data — the pointer to X509 key data.
  • pos — the desired certificate position.

Returns: the pointer to certificate or NULL if pos is larger than the number of certificates in data or an error occurs.


xmlSecGnuTLSKeyDataX509GetCertsSize

xmlSecSize xmlSecGnuTLSKeyDataX509GetCertsSize(xmlSecKeyDataPtr data);

Source: include/xmlsec/gnutls/x509.h

Gets the number of certificates in data.

Parameters:

  • data — the pointer to X509 key data.

Returns: te number of certificates in data.


xmlSecGnuTLSKeyDataX509AdoptCrl

int xmlSecGnuTLSKeyDataX509AdoptCrl(xmlSecKeyDataPtr data, gnutls_x509_crl_t crl);

Source: include/xmlsec/gnutls/x509.h

Adds crl to the X509 key data.

Parameters:

  • data — the pointer to X509 key data.
  • crl — the pointer to GnuTLS X509 crl.

Returns: 0 on success or a negative value if an error occurs.


xmlSecGnuTLSKeyDataX509GetCrl

gnutls_x509_crl_t xmlSecGnuTLSKeyDataX509GetCrl(xmlSecKeyDataPtr data, xmlSecSize pos);

Source: include/xmlsec/gnutls/x509.h

Gets a crl from X509 key data.

Parameters:

  • data — the pointer to X509 key data.
  • pos — the desired crl position.

Returns: the pointer to crl or NULL if pos is larger than the number of crls in data or an error occurs.


xmlSecGnuTLSKeyDataX509GetCrlsSize

xmlSecSize xmlSecGnuTLSKeyDataX509GetCrlsSize(xmlSecKeyDataPtr data);

Source: include/xmlsec/gnutls/x509.h

Gets the number of crls in data.

Parameters:

  • data — the pointer to X509 key data.

Returns: te number of crls in data.


xmlSecGnuTLSX509CertGetKey

xmlSecKeyDataPtr xmlSecGnuTLSX509CertGetKey(gnutls_x509_crt_t cert);

Source: include/xmlsec/gnutls/x509.h

Extracts public key from the cert.

Parameters:

  • cert — the certificate.

Returns: public key value or NULL if an error occurs.


xmlSecGnuTLSKeyDataRawX509CertGetKlass

xmlSecKeyDataId xmlSecGnuTLSKeyDataRawX509CertGetKlass(void);

Source: include/xmlsec/gnutls/x509.h

The raw X509 certificates key data klass.

Returns: raw X509 certificates key data klass.


xmlSecGnuTLSX509StoreGetKlass

xmlSecKeyDataStoreId xmlSecGnuTLSX509StoreGetKlass(void);

Source: include/xmlsec/gnutls/x509.h

The GnuTLS X509 certificates key data store klass.

Returns: pointer to GnuTLS X509 certificates key data store klass.


xmlSecGnuTLSX509StoreVerify

gnutls_x509_crt_t xmlSecGnuTLSX509StoreVerify(xmlSecKeyDataStorePtr store, xmlSecPtrListPtr certs, xmlSecPtrListPtr crls, const xmlSecKeyInfoCtx *keyInfoCtx);

Source: include/xmlsec/gnutls/x509.h

Verifies certs list.

Parameters:

  • store — the pointer to X509 key data store klass.
  • certs — the untrusted certificates.
  • crls — the crls.
  • keyInfoCtx — the pointer to dsig:KeyInfo/ element processing context.

Returns: pointer to the first verified certificate from certs.


xmlSecGnuTLSX509StoreAdoptCert

int xmlSecGnuTLSX509StoreAdoptCert(xmlSecKeyDataStorePtr store, gnutls_x509_crt_t cert, xmlSecKeyDataType type);

Source: include/xmlsec/gnutls/x509.h

Adds cert to the trusted or untrusted store.

Adds trusted (root) or untrusted certificate to the store.

Parameters:

  • store — the pointer to X509 key data store klass.
  • cert — the pointer to GnuTLS X509 certificate.
  • type — the certificate type (trusted/untrusted).

Returns: 0 on success or a negative value if an error occurs.


xmlSecGnuTLSX509StoreVerifyCrl

int xmlSecGnuTLSX509StoreVerifyCrl(xmlSecKeyDataStorePtr store, gnutls_x509_crl_t crl, xmlSecKeyInfoCtxPtr keyInfoCtx);

Source: include/xmlsec/gnutls/x509.h

Verifies crl by checking:

Parameters:

  • store — the pointer to X509 key data store klass.
  • crl — the CRL to verify.
  • keyInfoCtx — the key info context for verification parameters.
  1. Signature is valid (signed by issuer cert in store)
  2. thisUpdate <= verification_time <= nextUpdate

Returns: 1 if verified, 0 if not verified, or a negative value on error.


xmlSecGnuTLSX509StoreAdoptCrl

int xmlSecGnuTLSX509StoreAdoptCrl(xmlSecKeyDataStorePtr store, gnutls_x509_crl_t crl);

Source: include/xmlsec/gnutls/x509.h

Adds CRL to the store.

Parameters:

  • store — the pointer to X509 key data store klass.
  • crl — the pointer to GnuTLS X509 CRL.

Returns: 0 on success or a negative value if an error occurs.


Clone this wiki locally