6 SSL_get_negotiated_client_cert_type,
7 SSL_get_negotiated_server_cert_type,
9 SSL_SESSION_get0_peer_rpk - raw public key (RFC7250) support
13 #include <openssl/ssl.h>
15 int SSL_add_expected_rpk(SSL *s, EVP_PKEY *rpk);
16 int SSL_get_negotiated_client_cert_type(const SSL *s);
17 int SSL_get_negotiated_server_cert_type(const SSL *s);
18 EVP_PKEY *SSL_get0_peer_rpk(const SSL *s);
19 EVP_PKEY *SSL_SESSION_get0_peer_rpk(const SSL_SESSION *ss);
23 SSL_add_expected_rpk() adds a DANE TLSA record matching public key B<rpk>
24 to SSL B<s>'s DANE validation policy.
26 SSL_get_negotiated_client_cert_type() returns the connection's negotiated
27 client certificate type.
29 SSL_get_negotiated_server_cert_type() returns the connection's negotiated
30 server certificate type.
32 SSL_get0_peer_rpk() returns the peer's raw public key from SSL B<s>.
34 SSL_SESSION_get0_peer_rpk() returns the peer's raw public key from
39 Raw public keys are used in place of certificates when the option is
41 B<SSL_add_expected_rpk()> may be called multiple times to configure
42 multiple trusted keys, this makes it possible to allow for key rotation,
43 where a peer might be expected to offer an "old" or "new" key and the
44 endpoint must be able to accept either one.
46 When raw public keys are used, the certificate verify callback is called, and
47 may be used to inspect the public key via X509_STORE_CTX_get0_rpk(3).
48 Raw public keys have no subject, issuer, validity dates nor digital signature
49 to verify. They can, however, be matched verbatim or by their digest value, this
50 is done by specifying one or more TLSA records, see L<SSL_CTX_dane_enable(3)>.
52 The raw public key is typically taken from the certificate assigned to the
53 connection (e.g. via L<SSL_use_certificate(3)>), but if a certificate is not
54 configured, then the public key will be extracted from the assigned
57 The SSL_add_expected_rpk() function is a wrapper around
58 L<SSL_dane_tlsa_add(3)>.
59 When DANE is enabled via L<SSL_dane_enable(3)>, the configured TLSA records
60 will be used to validate the peer's public key or certificate.
61 If DANE is not enabled, then no validation will occur.
65 SSL_add_expected_rpk() returns 1 on success and 0 on failure.
67 SSL_get0_peer_rpk() and SSL_SESSION_get0_peer_rpk() return the peer's raw
68 public key as an EVP_PKEY or NULL when the raw public key is not available.
70 SSL_get_negotiated_client_cert_type() and SSL_get_negotiated_server_cert_type()
71 return one of the following values:
75 =item TLSEXT_cert_type_x509
77 =item TLSEXT_cert_type_rpk
83 L<SSL_CTX_dane_enable(3)>,
84 L<SSL_CTX_set_options(3)>,
85 L<SSL_dane_enable(3)>,
86 L<SSL_get_verify_result(3)>,
88 L<SSL_use_certificate(3)>,
89 L<X509_STORE_CTX_get0_rpk(3)>
93 These functions were added in OpenSSL 3.2.
97 Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.