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()β returns1on success,0otherwise. yes, just1and0. no in-between. no "it depends". very binary of it. β¨RSA_verify_ASN1_OCTET_STRING()β returns1on successful verification,0otherwise.
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 π
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
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms