gnutls_certificate_get_verify_flags - Linux
Overview
gnutls_certificate_get_verify_flags
extracts verification flags from the certificate provided.
Syntax
gnutls_certificate_get_verify_flags(cert)
| Parameter | Description |
|—|—|
| cert
| A GNUTLS certificate object. |
Options/Flags
None.
Examples
# Get the verification flag of a certificate.
cert = gnutls_certificate_new()
gnutls_certificate_set_x509(cert, cert_data)
verify_flags = gnutls_certificate_get_verify_flags(cert)
if (verify_flags & GNUTLS_CERT_INVALID) != 0:
print("The certificate is invalid.")
Common Issues
If the cert
parameter is invalid, this function will return -1 and set the error to GNUTLS_E_INVALID_ARGUMENT.
Integration
This function can be used with other GNUTLS functions to verify certificates.