xref: /freebsd/crypto/openssl/doc/man3/SSL_get_peer_signature_nid.pod (revision e7be843b4a162e68651d3911f0357ed464915629)
1=pod
2
3=head1 NAME
4
5SSL_get0_peer_signature_name, SSL_get_peer_signature_nid,
6SSL_get_peer_signature_type_nid, SSL_get0_signature_name,
7SSL_get_signature_nid, SSL_get_signature_type_nid -
8get TLS message signing types
9
10=head1 SYNOPSIS
11
12 #include <openssl/ssl.h>
13
14 int SSL_get0_peer_signature_name(const SSL *ssl, const char **sigalg);
15 int SSL_get_peer_signature_nid(SSL *ssl, int *psig_nid);
16 int SSL_get_peer_signature_type_nid(const SSL *ssl, int *psigtype_nid);
17 int SSL_get0_signature_name(SSL *ssl, const char **sigalg);
18 int SSL_get_signature_nid(SSL *ssl, int *psig_nid);
19 int SSL_get_signature_type_nid(const SSL *ssl, int *psigtype_nid);
20
21=head1 DESCRIPTION
22
23SSL_get0_peer_signature_name() sets I<*sigalg> to the IANA name of the
24L<signature scheme|https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-signaturescheme>
25used by the peer to sign the TLS handshake.
26The caller must not free the returned pointer.
27The returned string should be copied if it is to be retained beyond the
28lifetime of the SSL connection.
29
30SSL_get_peer_signature_nid() sets B<*psig_nid> to the NID of the digest used
31by the peer to sign TLS messages. It is implemented as a macro.
32
33SSL_get_peer_signature_type_nid() sets B<*psigtype_nid> to the signature
34type used by the peer to sign TLS messages. Currently the signature type
35is the NID of the public key type used for signing except for PSS signing
36where it is B<EVP_PKEY_RSA_PSS>. To differentiate between
37B<rsa_pss_rsae_*> and B<rsa_pss_pss_*> signatures, it's necessary to check
38the type of public key in the peer's certificate.
39
40SSL_get0_signature_name(), SSL_get_signature_nid() and
41SSL_get_signature_type_nid() return the equivalent information for the local
42end of the connection.
43
44=head1 RETURN VALUES
45
46These functions return 1 for success and 0 for failure. There are several
47possible reasons for failure: the peer or local end is a client and did not
48sign the handshake (did not use a client certificate), the cipher suite has no
49signature (e.g. it uses RSA key exchange or is anonymous), the TLS version is
50below 1.2 or the functions were called too early, e.g. before the peer signed a
51message.
52
53=head1 SEE ALSO
54
55L<ssl(7)>, L<SSL_get_peer_certificate(3)>,
56
57=head1 HISTORY
58
59The SSL_get0_peer_signature_name() and SSL_get0_signature_name() functions were
60added in OpenSSL 3.5.
61
62=head1 COPYRIGHT
63
64Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.
65
66Licensed under the Apache License 2.0 (the "License").  You may not use
67this file except in compliance with the License.  You can obtain a copy
68in the file LICENSE in the source distribution or at
69L<https://www.openssl.org/source/license.html>.
70
71=cut
72