SSL_GET_PEER_SIGNATURE_NID(3SSL)

πŸ’– SSL_GET_PEER_SIGNATURE_NID πŸ’–

okay bestie, welcome to the 3SSL corner of the OpenSSL manual, where we find out who signed what in a TLS handshake ✨


πŸ¦‹ NAME πŸ¦‹

SSL_get0_peer_signature_name, SSL_get_peer_signature_nid, SSL_get_peer_signature_type_nid, SSL_get0_signature_name, SSL_get_signature_nid, SSL_get_signature_type_nid β€” the whole girlies that hand you the TLS message signing types πŸ’…


🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

int SSL_get0_peer_signature_name(const SSL *ssl, const char **sigalg);
int SSL_get_peer_signature_nid(SSL *ssl, int *psig_nid);
int SSL_get_peer_signature_type_nid(const SSL *ssl, int *psigtype_nid);
int SSL_get0_signature_name(SSL *ssl, const char **sigalg);
int SSL_get_signature_nid(SSL *ssl, int *psig_nid);
int SSL_get_signature_type_nid(SSL *ssl, int *psigtype_nid);

✨ DESCRIPTION ✨

so here's the tea, babes πŸ“

🫢 the peer side (aka what THEY did)

  • SSL_get0_peer_signature_name() β€” sets *sigalg to the IANA name of the signature scheme that the peer used to sign the TLS handshake. That IANA list lives over at <https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-signaturescheme> if you wanna go peek πŸ‘€. The caller must not free the returned pointer. And lowkey important: if you wanna hang onto that string past the lifetime of the SSL connection, copy it, bestie, because it does not belong to you 😭
  • SSL_get_peer_signature_nid() β€” sets *psig_nid to the NID of the digest the peer used to sign TLS messages. Fun fact: it's implemented as a macro πŸ’…
  • SSL_get_peer_signature_type_nid() β€” sets *psigtype_nid to the signature type the peer used to sign TLS messages. Currently the signature type is the NID of the public key type used for signing, except for PSS signing, where it's EVP_PKEY_RSA_PSS. And here's the messy part, no cap: to actually tell rsa_pss_rsae_* and rsa_pss_pss_* apart, you have to go check the type of public key in the peer's certificate 🧚

πŸ’œ the local side (aka what YOU did)

SSL_get0_signature_name(), SSL_get_signature_nid() and SSL_get_signature_type_nid() give you the equivalent info but for the local end of the connection. same vibes, your side of the story 🌈


πŸ’€ RETURN VALUES πŸ’€

These functions return 1 for success and 0 for failure. and bestie there are several possible reasons for failure, so if you get a 0 don't panic, just vibe check it:

  • the peer or local end is a client and did not sign the handshake (they did not use a client certificate) πŸ™ˆ
  • the cipher suite has no signature at all (e.g. it uses RSA key exchange or is anonymous)
  • the TLS version is below 1.2
  • or the functions were called too early β€” like, before the peer even signed a message. impatient much 😭

πŸ‘€ SEE ALSO πŸ‘€

ssl(7), SSL_get_peer_certificate(3),


πŸŽ€ HISTORY πŸŽ€

  • SSL_get0_peer_signature_name() and SSL_get0_signature_name() were added in OpenSSL 3.5 ✨
  • SSL_get_signature_nid() was added in OpenSSL 1.1.1a

Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the whole page, periodt πŸ’– this was OpenSSL 🌸 4.0.3, dated 2026-09-29, and it lives at SSL_GET_PEER_SIGNATURE_NID(3SSL) β€” mwah, go sign something gorgeous πŸ«ΆπŸ’…

πŸ“¦ where this page comes from