OpenSSL RSA_sign(3openssl)
NNNNAAAAMMMMEEEERSA_sign, RSA_verify - RSA signatures
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS#include
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); DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNRSA_sign() signs the message digest mmmm of size mmmm_lllleeeennnn using
the private key rrrrssssaaaa as specified in PKCS #1 v2.0. It stores
the signature in ssssiiiiggggrrrreeeetttt and the signature size in ssssiiiigggglllleeeennnn.ssssiiiiggggrrrreeeetttt must point to RSA_size(rrrrssssaaaa) bytes of memory.
ttttyyyyppppeeee denotes the message digest algorithm that was used togenerate mmmm. It usually is one of NNNNIIIIDDDD_sssshhhhaaaa1111, NNNNIIIIDDDD_rrrriiiippppeeeemmmmdddd111166660000 and
NNNNIIIIDDDD_mmmmdddd5555; see objects(3) for details. If ttttyyyyppppeeee is
NNNNIIIIDDDD_mmmmdddd5555_sssshhhhaaaa1111, an SSL signature (MD5 and SHA1 message digests
with PKCS #1 padding and no algorithm identifier) is
created.RSA_verify() verifies that the signature ssssiiiiggggbbbbuuuuffff of size
ssssiiiigggglllleeeennnn matches a given message digest mmmm of size mmmm_lllleeeennnn. ttttyyyyppppeeee
denotes the message digest algorithm that was used to generate the signature. rrrrssssaaaa is the signer's public key. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSSRSA_sign() returns 1 on success, 0 otherwise. RSA_verify()
returns 1 on successful verification, 0 otherwise.The error codes can be obtained by ERR_get_error(3).
BBBBUUUUGGGGSSSS Certain signatures with an improper algorithm identifier areaccepted for compatibility with SSLeay 0.4.5 :-)
CCCCOOOONNNNFFFFOOOORRRRMMMMIIIINNNNGGGG TTTTOOOOSSL, PKCS #1 v2.0
SSSSEEEEEEEE AAAALLLLSSSSOOOOERR_get_error(3), objects(3), rsa(3),
RSA_private_encrypt(3), RSA_public_decrypt(3)
HHHHIIIISSSSTTTTOOOORRRRYYYYRSA_sign() and RSA_verify() are available in all versions of
SSLeay and OpenSSL.21/Apr/2005 Last change: 0.9.8o 1
OpenSSL RSA_sign(3openssl)
21/Apr/2005 Last change: 0.9.8o 2