1RSA_private_encrypt(3)              OpenSSL             RSA_private_encrypt(3)
2
3
4

NAME

6       RSA_private_encrypt, RSA_public_decrypt - low level signature
7       operations
8

SYNOPSIS

10        #include <openssl/rsa.h>
11
12        int RSA_private_encrypt(int flen, unsigned char *from,
13           unsigned char *to, RSA *rsa, int padding);
14
15        int RSA_public_decrypt(int flen, unsigned char *from,
16           unsigned char *to, RSA *rsa, int padding);
17

DESCRIPTION

19       These functions handle RSA signatures at a low level.
20
21       RSA_private_encrypt() signs the flen bytes at from (usually a message
22       digest with an algorithm identifier) using the private key rsa and
23       stores the signature in to. to must point to RSA_size(rsa) bytes of
24       memory.
25
26       padding denotes one of the following modes:
27
28       RSA_PKCS1_PADDING
29           PKCS #1 v1.5 padding. This function does not handle the
30           algorithmIdentifier specified in PKCS #1. When generating or
31           verifying PKCS #1 signatures, RSA_sign(3) and RSA_verify(3) should
32           be used.
33
34       RSA_NO_PADDING
35           Raw RSA signature. This mode should only be used to implement
36           cryptographically sound padding modes in the application code.
37           Signing user data directly with RSA is insecure.
38
39       RSA_public_decrypt() recovers the message digest from the flen bytes
40       long signature at from using the signer's public key rsa. to must point
41       to a memory section large enough to hold the message digest (which is
42       smaller than RSA_size(rsa) - 11). padding is the padding mode that was
43       used to sign the data.
44

RETURN VALUES

46       RSA_private_encrypt() returns the size of the signature (i.e.,
47       RSA_size(rsa)). RSA_public_decrypt() returns the size of the recovered
48       message digest.
49
50       On error, -1 is returned; the error codes can be obtained by
51       ERR_get_error(3).
52

SEE ALSO

54       ERR_get_error(3), rsa(3), RSA_sign(3), RSA_verify(3)
55

HISTORY

57       The padding argument was added in SSLeay 0.8. RSA_NO_PADDING is
58       available since SSLeay 0.9.0.
59
60
61
621.0.2k                            2017-01-26            RSA_private_encrypt(3)
Impressum