RSA_SIGN_ASN1_OCTET_STRING(3ossl)

πŸ’– RSA_SIGN_ASN1_OCTET_STRING(3ossl) πŸ’–

okay bestie, buckle up, because we're reading a manual page from OpenSSL β€” section 3ossl β€” and it's literally called RSA_SIGN_ASN1_OCTET_STRING. yes, that's a whole mouthful. no, I will not be shortening it. we're doing this properly. πŸŽ€


✨ NAME ✨

RSA_sign_ASN1_OCTET_STRING, RSA_verify_ASN1_OCTET_STRING β€” RSA signatures, but make it octet-string flavoured πŸ¦‹


🌸 SYNOPSIS 🌸

#include <openssl/rsa.h>

The following functions have been deprecated since OpenSSL 3.0, and can be hidden entirely by defining OPENSSL_API_COMPAT with a suitable version value, see openssl_user_macros(7):

int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m,
                               unsigned int m_len, unsigned char *sigret,
                               unsigned int *siglen, RSA *rsa);

int RSA_verify_ASN1_OCTET_STRING(int dummy, 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, all of them. Every single one. Bestie, applications should instead use EVP PKEY APIs. that's the glow-up. this page is the before picture. 😭

RSA_sign_ASN1_OCTET_STRING() signs the octet string m of size m_len using the private key rsa represented in DER using PKCS #1 padding. it stores the signature in sigret and the signature size in siglen. sigret must point to RSA_size(rsa) bytes of memory. not a byte less, okay?? that's the vibe check and it will not pass if you get it wrong. πŸ’€

dummy is ignored. literally ignored. it's giving decorative. it's giving participation trophy. it does nothing. πŸ™ˆ

The random number generator must be seeded when calling RSA_sign_ASN1_OCTET_STRING(). and if the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to external circumstances (see RAND(7)), the operation will fail. no cap. that's just how it is. 🌧️

RSA_verify_ASN1_OCTET_STRING() verifies that the signature sigbuf of size siglen is the DER representation of a given octet string m of size m_len. dummy is ignored (again!! iconic behaviour honestly). rsa is the signer's public key. πŸ‘‘


⭐ RETURN VALUES ⭐

  • RSA_sign_ASN1_OCTET_STRING() β€” returns 1 on success, 0 otherwise. yes, just 1 and 0. no in-between. no "it depends". very binary of it. ✨
  • RSA_verify_ASN1_OCTET_STRING() β€” returns 1 on successful verification, 0 otherwise.

The error codes can be obtained by ERR_get_error(3). so if you got a 0 and you're like "why bestie why", that's your girl. go ask her. πŸ”


πŸ’€ BUGS πŸ’€

These functions serve no recognizable purpose.

that's it. that's the bug report. the whole thing. someone really sat down and wrote that and honestly? they ate. πŸ’…


🌈 SEE ALSO 🌈


πŸ¦‹ HISTORY πŸ¦‹

All of these functions were deprecated in OpenSSL 3.0. so they're giving vintage. they're giving "we don't do that anymore". 🫢


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>.


tiny reminder from your girl: these are DEPRECATED. use the EVP PKEY APIs. I'm not being dramatic, I'm being accurate, and those are basically the same thing. πŸ’–

okay that's the whole page bestie!! this was pulled from OpenSSL 3.5.9, dated 2026-09-29, and that's RSA_SIGN_ASN1_OCTET_STRING(3ossl) β€” mwah, love that for us. now go seed your RNG. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from