xref: /freebsd/secure/lib/libcrypto/man/man3/SSL_get0_peer_rpk.3 (revision 4757b351ea9d59d71d4a38b82506d2d16fcd560d)
-*- mode: troff; coding: utf-8 -*-
Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)

Standard preamble:
========================================================================
..
..
.. \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
. ds C` "" . ds C' "" 'br\} . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF ========================================================================

Title "SSL_GET0_PEER_RPK 3ossl"
SSL_GET0_PEER_RPK 3ossl 2025-07-01 3.5.1 OpenSSL
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
NAME
SSL_add_expected_rpk, SSL_get_negotiated_client_cert_type, SSL_get_negotiated_server_cert_type, SSL_get0_peer_rpk, SSL_SESSION_get0_peer_rpk - raw public key (RFC7250) support
SYNOPSIS
Header "SYNOPSIS" .Vb 1 #include <openssl/ssl.h> \& int SSL_add_expected_rpk(SSL *s, EVP_PKEY *rpk); int SSL_get_negotiated_client_cert_type(const SSL *s); int SSL_get_negotiated_server_cert_type(const SSL *s); EVP_PKEY *SSL_get0_peer_rpk(const SSL *s); EVP_PKEY *SSL_SESSION_get0_peer_rpk(const SSL_SESSION *ss); .Ve
DESCRIPTION
Header "DESCRIPTION" \fBSSL_add_expected_rpk() adds a DANE TLSA record matching public key rpk to SSL s's DANE validation policy.

\fBSSL_get_negotiated_client_cert_type() returns the connection's negotiated client certificate type.

\fBSSL_get_negotiated_server_cert_type() returns the connection's negotiated server certificate type.

\fBSSL_get0_peer_rpk() returns the peer's raw public key from SSL s.

\fBSSL_SESSION_get0_peer_rpk() returns the peer's raw public key from SSL_SESSION ss.

NOTES
Header "NOTES" Raw public keys are used in place of certificates when the option is negotiated. \fBSSL_add_expected_rpk() may be called multiple times to configure multiple trusted keys, this makes it possible to allow for key rotation, where a peer might be expected to offer an "old" or "new" key and the endpoint must be able to accept either one.

When raw public keys are used, the certificate verify callback is called, and may be used to inspect the public key via X509_STORE_CTX_get0_rpk\|(3). Raw public keys have no subject, issuer, validity dates nor digital signature to verify. They can, however, be matched verbatim or by their digest value, this is done by specifying one or more TLSA records, see SSL_CTX_dane_enable\|(3).

The raw public key is typically taken from the certificate assigned to the connection (e.g. via SSL_use_certificate\|(3)), but if a certificate is not configured, then the public key will be extracted from the assigned private key.

The SSL_add_expected_rpk() function is a wrapper around \fBSSL_dane_tlsa_add\|(3). When DANE is enabled via SSL_dane_enable\|(3), the configured TLSA records will be used to validate the peer's public key or certificate. If DANE is not enabled, then no validation will occur.

"RETURN VALUES"
Header "RETURN VALUES" \fBSSL_add_expected_rpk() returns 1 on success and 0 on failure.

\fBSSL_get0_peer_rpk() and SSL_SESSION_get0_peer_rpk() return the peer's raw public key as an EVP_PKEY or NULL when the raw public key is not available.

\fBSSL_get_negotiated_client_cert_type() and SSL_get_negotiated_server_cert_type() return one of the following values:

TLSEXT_cert_type_x509 4
Item "TLSEXT_cert_type_x509"

0

TLSEXT_cert_type_rpk 4
Item "TLSEXT_cert_type_rpk"

"SEE ALSO"
Header "SEE ALSO" \fBSSL_CTX_dane_enable\|(3), \fBSSL_CTX_set_options\|(3), \fBSSL_dane_enable\|(3), \fBSSL_get_verify_result\|(3), \fBSSL_set_verify\|(3), \fBSSL_use_certificate\|(3), \fBX509_STORE_CTX_get0_rpk\|(3)
HISTORY
Header "HISTORY" These functions were added in OpenSSL 3.2.
COPYRIGHT
Header "COPYRIGHT" Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.