1SSL_check_chain(3)                  OpenSSL                 SSL_check_chain(3)
2
3
4

NAME

6       SSL_check_chain - check certificate chain suitability
7

SYNOPSIS

9        #include <openssl/ssl.h>
10
11        int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain);
12

DESCRIPTION

14       SSL_check_chain() checks whether certificate x, private key pk and
15       certificate chain chain is suitable for use with the current session s.
16

RETURN VALUES

18       SSL_check_chain() returns a bitmap of flags indicating the validity of
19       the chain.
20
21       CERT_PKEY_VALID: the chain can be used with the current session.  If
22       this flag is not set then the certificate will never be used even if
23       the application tries to set it because it is inconsistent with the
24       peer preferences.
25
26       CERT_PKEY_SIGN: the EE key can be used for signing.
27
28       CERT_PKEY_EE_SIGNATURE: the signature algorithm of the EE certificate
29       is acceptable.
30
31       CERT_PKEY_CA_SIGNATURE: the signature algorithms of all CA certificates
32       are acceptable.
33
34       CERT_PKEY_EE_PARAM: the parameters of the end entity certificate are
35       acceptable (e.g. it is a supported curve).
36
37       CERT_PKEY_CA_PARAM: the parameters of all CA certificates are
38       acceptable.
39
40       CERT_PKEY_EXPLICIT_SIGN: the end entity certificate algorithm can be
41       used explicitly for signing (i.e. it is mentioned in the signature
42       algorithms extension).
43
44       CERT_PKEY_ISSUER_NAME: the issuer name is acceptable. This is only
45       meaningful for client authentication.
46
47       CERT_PKEY_CERT_TYPE: the certificate type is acceptable. Only
48       meaningful for client authentication.
49
50       CERT_PKEY_SUITEB: chain is suitable for Suite B use.
51

NOTES

53       SSL_check_chain() must be called in servers after a client hello
54       message or in clients after a certificate request message. It will
55       typically be called in the certificate callback.
56
57       An application wishing to support multiple certificate chains may call
58       this function on each chain in turn: starting with the one it considers
59       the most secure. It could then use the chain of the first set which
60       returns suitable flags.
61
62       As a minimum the flag CERT_PKEY_VALID must be set for a chain to be
63       usable. An application supporting multiple chains with different CA
64       signature algorithms may also wish to check CERT_PKEY_CA_SIGNATURE too.
65       If no chain is suitable a server should fall back to the most secure
66       chain which sets CERT_PKEY_VALID.
67
68       The validity of a chain is determined by checking if it matches a
69       supported signature algorithm, supported curves and in the case of
70       client authentication certificate types and issuer names.
71
72       Since the supported signature algorithms extension is only used in TLS
73       1.2 and DTLS 1.2 the results for earlier versions of TLS and DTLS may
74       not be very useful. Applications may wish to specify a different
75       "legacy" chain for earlier versions of TLS or DTLS.
76

SEE ALSO

78       SSL_CTX_set_cert_cb(3), ssl(3)
79
80
81
821.0.2o                            2020-08-01                SSL_check_chain(3)
Impressum