diff options
Diffstat (limited to 'src/lib/libcrypto/man/RSA_private_encrypt.3')
-rw-r--r-- | src/lib/libcrypto/man/RSA_private_encrypt.3 | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/RSA_private_encrypt.3 b/src/lib/libcrypto/man/RSA_private_encrypt.3 new file mode 100644 index 0000000000..ff59e66f6a --- /dev/null +++ b/src/lib/libcrypto/man/RSA_private_encrypt.3 | |||
@@ -0,0 +1,97 @@ | |||
1 | .Dd $Mdocdate: November 4 2016 $ | ||
2 | .Dt RSA_PRIVATE_ENCRYPT 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm RSA_private_encrypt , | ||
6 | .Nm RSA_public_decrypt | ||
7 | .Nd low level signature operations | ||
8 | .Sh SYNOPSIS | ||
9 | .In openssl/rsa.h | ||
10 | .Ft int | ||
11 | .Fo RSA_private_encrypt | ||
12 | .Fa "int flen" | ||
13 | .Fa "unsigned char *from" | ||
14 | .Fa "unsigned char *to" | ||
15 | .Fa "RSA *rsa" | ||
16 | .Fa "int padding" | ||
17 | .Fc | ||
18 | .Ft int | ||
19 | .Fo RSA_public_decrypt | ||
20 | .Fa "int flen" | ||
21 | .Fa "unsigned char *from" | ||
22 | .Fa "unsigned char *to" | ||
23 | .Fa "RSA *rsa" | ||
24 | .Fa "int padding" | ||
25 | .Fc | ||
26 | .Sh DESCRIPTION | ||
27 | These functions handle RSA signatures at a low level. | ||
28 | .Pp | ||
29 | .Fn RSA_private_encrypt | ||
30 | signs the | ||
31 | .Fa flen | ||
32 | bytes at | ||
33 | .Fa from | ||
34 | (usually a message digest with an algorithm identifier) using the | ||
35 | private key | ||
36 | .Fa rsa | ||
37 | and stores the signature in | ||
38 | .Fa to . | ||
39 | .Fa to | ||
40 | must point to | ||
41 | .Fn RSA_size rsa | ||
42 | bytes of memory. | ||
43 | .Pp | ||
44 | .Fa padding | ||
45 | denotes one of the following modes: | ||
46 | .Bl -tag -width Ds | ||
47 | .It Dv RSA_PKCS1_PADDING | ||
48 | PKCS #1 v1.5 padding. | ||
49 | This function does not handle the | ||
50 | .Sy algorithmIdentifier | ||
51 | specified in PKCS #1. | ||
52 | When generating or verifying PKCS #1 signatures, | ||
53 | .Xr RSA_sign 3 | ||
54 | and | ||
55 | .Xr RSA_verify 3 | ||
56 | should be used. | ||
57 | .It Dv RSA_NO_PADDING | ||
58 | Raw RSA signature. | ||
59 | This mode should only be used to implement cryptographically sound | ||
60 | padding modes in the application code. | ||
61 | Signing user data directly with RSA is insecure. | ||
62 | .El | ||
63 | .Pp | ||
64 | .Fn RSA_public_decrypt | ||
65 | recovers the message digest from the | ||
66 | .Fa flen | ||
67 | bytes long signature at | ||
68 | .Fa from | ||
69 | using the signer's public key | ||
70 | .Fa rsa . | ||
71 | .Fa to | ||
72 | must point to a memory section large enough to hold the message digest | ||
73 | (which is smaller than | ||
74 | .Fn RSA_size rsa | ||
75 | - 11). | ||
76 | .Fa padding | ||
77 | is the padding mode that was used to sign the data. | ||
78 | .Sh RETURN VALUES | ||
79 | .Fn RSA_private_encrypt | ||
80 | returns the size of the signature (i.e., | ||
81 | .Fn RSA_size rsa ) . | ||
82 | .Fn RSA_public_decrypt | ||
83 | returns the size of the recovered message digest. | ||
84 | .Pp | ||
85 | On error, -1 is returned; the error codes can be obtained by | ||
86 | .Xr ERR_get_error 3 . | ||
87 | .Sh SEE ALSO | ||
88 | .Xr ERR_get_error 3 , | ||
89 | .Xr rsa 3 , | ||
90 | .Xr RSA_sign 3 , | ||
91 | .Xr RSA_verify 3 | ||
92 | .Sh HISTORY | ||
93 | The | ||
94 | .Fa padding | ||
95 | argument was added in SSLeay 0.8. | ||
96 | .Dv RSA_NO_PADDING | ||
97 | is available since SSLeay 0.9.0. | ||