OpenSSL RSA_private_encrypt(3openssl)
NNNNAAAAMMMMEEEERSA_private_encrypt, RSA_public_decrypt - low level
signature operations SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS#include
int RSA_private_encrypt(int flen, unsigned char *from,
unsigned char *to, RSA *rsa, int padding);int RSA_public_decrypt(int flen, unsigned char *from,
unsigned char *to, RSA *rsa, int padding); DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN These functions handle RSA signatures at a low level.RSA_private_encrypt() signs the fffflllleeeennnn bytes at ffffrrrroooommmm (usually
a message digest with an algorithm identifier) using the private key rrrrssssaaaa and stores the signature in ttttoooo. ttttoooo mustpoint to RRRRSSSSAAAA_ssssiiiizzzzeeee((((rrrrssssaaaa)))) bytes of memory.
ppppaaaaddddddddiiiinnnngggg denotes one of the following modes:RSA_PKCS1_PADDING
PKCS #1 v1.5 padding. This function does not handle the
aaaallllggggoooorrrriiiitttthhhhmmmmIIIIddddeeeennnnttttiiiiffffiiiieeeerrrr specified in PKCS #1. When
generating or verifying PKCS #1 signatures, RSA_sign(3)
and RSA_verify(3) should be used.
RSA_NO_PADDING
Raw RSA signature. This mode should only be used to implement cryptographically sound padding modes in the application code. Signing user data directly with RSA is insecure.RSA_public_decrypt() recovers the message digest from the
fffflllleeeennnn bytes long signature at ffffrrrroooommmm using the signer's public key rrrrssssaaaa. ttttoooo must point to a memory section large enough tohold the message digest (which is smaller than RRRRSSSSAAAA_ssssiiiizzzzeeee((((rrrrssssaaaa))))
---- 11111111). ppppaaaaddddddddiiiinnnngggg is the padding mode that was used to sign the
data. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSSRSA_private_encrypt() returns the size of the signature
(i.e., RSA_size(rsa)). RSA_public_decrypt() returns the size
of the recovered message digest.On error, -1 is returned; the error codes can be obtained by
ERR_get_error(3).
25/Sep/2002 Last change: 0.9.8o 1
OpenSSL RSA_private_encrypt(3openssl)
SSSSEEEEEEEE AAAALLLLSSSSOOOOERR_get_error(3), rsa(3), RSA_sign(3), RSA_verify(3)
HHHHIIIISSSSTTTTOOOORRRRYYYYThe ppppaaaaddddddddiiiinnnngggg argument was added in SSLeay 0.8. RSA_NO_PADDING
is available since SSLeay 0.9.0.25/Sep/2002 Last change: 0.9.8o 2