SSL_GET_PEER_SIGNATURE_NID(3ossl)

πŸ’– SSL_GET_PEER_SIGNATURE_NID πŸ’–

okay bestie, this is the 3ossl manual page and it's literally all about finding out what kind of signature got used on a TLS message. who signed it, what algorithm, all that forensic girl detective energy πŸ”βœ¨


🌸 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 β€” get 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(const SSL *ssl, int *psigtype_nid);

πŸ¦‹ DESCRIPTION πŸ¦‹

so. SSL_get0_peer_signature_name() sets *sigalg to the IANA name of the signature scheme that the peer used to sign the TLS handshake. The IANA registry lives at https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-signaturescheme if you wanna go stare at it (iykyk).

🫢 bestie listen: the caller must not free the returned pointer. It's not yours, don't touch it. And if you need that string to survive past the lifetime of the SSL connection, you gotta copy it. Periodt.

SSL_get_peer_signature_nid() sets *psig_nid to the NID of the digest the peer used to sign TLS messages. It's implemented as a macro, fun fact πŸŽ€

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 if you're trying to tell rsa_pss_rsae_* apart from rsa_pss_pss_*? Yeah, you have to go check the type of public key in the peer's certificate yourself. no shortcuts, sorry angel πŸ’…

SSL_get0_signature_name(), SSL_get_signature_nid() and SSL_get_signature_type_nid() give you the exact same info but for the local end of the connection instead of the peer. same vibes, other side of the mirror πŸͺž


πŸ‘‘ RETURN VALUES πŸ‘‘

These functions return 1 for success and 0 for failure. and bestie, there are several possible reasons it can fail 😭:

  • the peer or local end is a client and did not sign the handshake (aka it didn't use a client certificate)
  • the cipher suite has no signature (e.g. it uses RSA key exchange or is anonymous)
  • the TLS version is below 1.2
  • or you called the functions too early β€” like, before the peer even signed a message. rude of you tbh πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯


⭐ HISTORY ⭐

The SSL_get0_peer_signature_name() and SSL_get0_signature_name() functions were added in OpenSSL 3.5. new girls on the block πŸ’–


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.


okay that's the whole page, no cap πŸ’œ this was OpenSSL 3.5.9, dated 2026-09-29, and it's giving certified classic πŸŽ€βœ¨ bye bestie, go sign something 🫢

πŸ“¦ where this page comes from