RSA_SIGN(3)
π RSA_SIGN(3) β RSA signatures, but make it make sense
okay so bestie, this page comes from the Library Functions Manual, and itβs all about RSA_sign and RSA_verify doing their RSA signature thing. If you need to sign a message digest or verify a signature, this is your lane. No cap, every detail is down below. π«Ά
β¨ NAME β¨
RSA_sign, RSA_verify β RSA signatures
πΈ SYNOPSIS πΈ
first, the library + include situation, literally:
library βlibcryptoβ #include <openssl/rsa.h>
and the signatures, exactly:
int
RSA_sign(int type, const unsigned char *m, unsigned int m_len,
unsigned char *sigret, unsigned int *siglen, RSA *rsa);
int
RSA_verify(int type, const unsigned char *m, unsigned int m_len,
unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
π DESCRIPTION π
RSA_sign() signs the message digest m of size m_len using the private key rsa, and it does it with RSASSA-PKCS1-v1_5 as specified in RFC 3447. It stores the signature in sigret and the signature size in siglen. sigret must point to RSA_size(rsa) bytes of memory.
heads up bestie:PKCS #1adds meta-data, placing limits on the size of the key that can be used. Need the lower-level operations tea? SeeRSA_private_encrypt(3).
type denotes the message digest algorithm that was used to generate m. If type is NID_md5_sha1, an SSL signature (MD5 and SHA-1 message digests with PKCS #1 padding and no algorithm identifier) is created. thatβs the little special case, iykyk. π
RSA_verify() verifies that the signature sigbuf of size siglen matches a given message digest m of size m_len. type denotes the message digest algorithm that was used to generate the signature. rsa is the signerβs public key.
π RETURN VALUES π
RSA_sign() returns 1 on success. RSA_verify() returns 1 on successful verification. periodt. β¨
The error codes can be obtained by ERR_get_error(3).
π¦ SEE ALSO π¦
go touch these other pages, bestie:
π STANDARDS π
SSL, PKCS #1 v2.0
π HISTORY π
RSA_sign() first appeared in SSLeay 0.4.4. RSA_verify() first appeared in SSLeay 0.6.0. Both functions have been available since OpenBSD 2.4.
mwah π β source/version vibes: Debian, date: June 8, 2025, page: RSA_SIGN(3). bye bestie ππ§
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2000, 2005, 2014, 2015, 2016 The OpenSSL Project
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms