RSA_SIGN_ASN1_OCTET_STRING(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’– RSA_SIGN_ASN1_OCTET_STRING πŸ’–

okay so bestie, we're in RSA_SIGN_ASN1_OCTET_STRING(3ossl) territory β€” that's the OpenSSL part of the manual, and no cap, these two functions are legacy legacy. Like, your older cousin's MySpace legacy. But we're gonna learn them anyway because knowing old stuff is a flex. πŸŽ€


✨ NAME ✨

RSA_sign_ASN1_OCTET_STRING, RSA_verify_ASN1_OCTET_STRING β€” the RSA signature girlies. that's it, that's the whole name. πŸ’…


🌸 SYNOPSIS 🌸

#include <openssl/rsa.h>

okay so first things first: these functions have been deprecated since OpenSSL 3.0, and you can hide 'em entirely by defining OPENSSL_API_COMPAT with a suitable version value β€” check openssl_user_macros(7) for the deets. πŸ¦‹

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 πŸ¦‹

warning bestie β€” all of the functions described on this page are deprecated. Applications should instead use EVP PKEY APIs. like, the universe is literally telling you to move on. 😭

πŸ’œ RSA_sign_ASN1_OCTET_STRING()

This one 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. And sigret must point to RSA_size(rsa) bytes of memory β€” not vibes, not approximately that many bytes, like exactly that. size the buffer correctly or it's giving undefined chaos. πŸ™ˆ

dummy is ignored. literally does nothing. it's decorative. main character energy with no lines. πŸ‘‘

The random number generator must be seeded when calling RSA_sign_ASN1_OCTET_STRING(). so like, seed your RNG. πŸ”₯ And if the automatic seeding or reseeding of the OpenSSL CSPRNG fails due to external circumstances (see RAND(7)), the operation will fail. that's just how it is, no cap.

🧚 RSA_verify_ASN1_OCTET_STRING()

This one 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! iconique). rsa is the signer's public key. 🫢


⭐ RETURN VALUES ⭐

  • RSA_sign_ASN1_OCTET_STRING() returns 1 on success, 0 otherwise.
  • RSA_verify_ASN1_OCTET_STRING() returns 1 on successful verification, 0 otherwise.

so like, 1 = slay, 0 = not slay. simple as that. 🌈

The error codes can be obtained by ERR_get_error(3) β€” go ask the error queue, she always knows what went down. πŸ’€


πŸ’… BUGS πŸ’…

These functions serve no recognizable purpose.

that's it. that's the bug section. the manpage itself said it. I'm just the messenger. πŸ™ˆ


πŸŽ€ SEE ALSO πŸŽ€


🌷 HISTORY 🌷

All of these functions were deprecated in OpenSSL 3.0. periodt. πŸ¦‹


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.


okay bestie that's the whole page, you ate that πŸ“ this was version 3.5.0, dated 2026-09-25, RSA_SIGN_ASN1_OCTET_STRING(3ossl) β€” now go use EVP PKEY APIs instead like the icon you are πŸ’–βœ¨

πŸ“¦ where this page comes from