Next: PKCS #10 certificate requests, Previous: X.509 certificates, Up: The X.509 trust model
Verifying certificate paths is important in X.509 authentication. For
this purpose the function gnutls_x509_crt_verify is
provided. The output of this function is the bitwise OR of the
elements of the gnutls_certificate_status_t
enumeration. A
detailed description of these elements can be found in figure below.
The function gnutls_certificate_verify_peers2 is equivalent to
the previous one, and will verify the peer's certificate in a TLS
session.
CERT_INVALID:
CERT_REVOKED:
CERT_SIGNER_NOT_FOUND:
GNUTLS_CERT_SIGNER_NOT_CA:
GNUTLS_CERT_INSECURE_ALGORITHM:
There is also to possibility to pass some input to the verification functions in the form of flags. For gnutls_x509_crt_verify the flags are passed straightforward, but gnutls_certificate_verify_peers2 depends on the flags set by calling gnutls_certificate_set_verify_flags. All the available flags are part of the enumeration gnutls_certificate_verify_flags and are explained in the table below.
GNUTLS_VERIFY_DISABLE_CA_SIGN:
GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT:
GNUTLS_VERIFY_ALLOW_ANY_X509_V1_CA_CRT:
GNUTLS_VERIFY_DO_NOT_ALLOW_SAME:
GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2:
GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5:
Although the verification of a certificate path indicates that the certificate is signed by trusted authority, does not reveal anything about the peer's identity. It is required to verify if the certificate's owner is the one you expect. For more information consult [RFC2818] (See RFC2818.)
and section ex:verify for an example.