RSA_SIGN(3ossl)
π RSA_SIGN(3ossl) π
okay so this is a page from the OpenSSL manual, and bestie, it's giving β¨legacyβ¨ β we're talking RSA_sign and RSA_verify, the OG RSA signature girlies. Buckle up π
πΈ NAME πΈ
RSA_sign, RSA_verify β RSA signatures, no cap π
β¨ SYNOPSIS β¨
#include <openssl/rsa.h>
okay so important heads-up first: the following functions have been deprecated since OpenSSL 3.0, and you can make them vanish entirely by defining OPENSSL_API_COMPAT with a suitable version value β check openssl_user_macros(7) for how that works π«Ά
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 π¦
ALL of the functions described on this page are deprecated. Like, every single one. The glow-up you actually want is EVP_PKEY_sign_init(3), EVP_PKEY_sign(3), EVP_PKEY_verify_init(3) and EVP_PKEY_verify(3) β applications should use those instead, fr fr π―
So, what does the old stuff do?
RSA_sign()β signs the message digestmof sizem_lenusing the private keyrsa, using RSASSA-PKCS1-v1_5 as specified in RFC 3447. It stores the signature insigretand the signature size insiglen. Now listen πsigretmust point toRSA_size(rsa)bytes of memory. Also note that PKCS #1 adds meta-data, which places limits on the size of the key that can be used π« For lower-level operations, seeRSA_private_encrypt(3).typedenotes the message digest algorithm that was used to generatem. And iftypeisNID_md5_sha1, an SSL signature is created (that's MD5 and SHA1 message digests with PKCS #1 padding and no algorithm identifier) πRSA_verify()β verifies that the signaturesigbufof sizesiglenmatches a given message digestmof sizem_len.typedenotes the message digest algorithm that was used to generate the signature, andrsais the signer's public key π
π RETURN VALUES π
RSA_sign()returns1on success and0for failure.RSA_verify()returns1on successful verification and0for failure.
Need the deets on what went wrong? The error codes can be obtained by ERR_get_error(3) π
π CONFORMING TO π
SSL, PKCS #1 v2.0 β she's certified, she's compliant, she's iconic β¨
π₯ SEE ALSO π₯
iykyk, go read those next π
π HISTORY π
All of these functions were deprecated in OpenSSL 3.0. That's the whole story. RIP to a real one π―οΈ
π COPYRIGHT π
Copyright 2000-2020 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, bestie π«Ά this was OpenSSL 3.5.0, dated 2026-09-25 β RSA_SIGN(3ossl), signing off πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms