summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/RSA_private_encrypt.3
diff options
context:
space:
mode:
authorschwarze <>2016-11-04 10:17:17 +0000
committerschwarze <>2016-11-04 10:17:17 +0000
commit195fe5e91c60bd205043b4bea113abdff1c67bcc (patch)
tree1d15fe02d83a7ffb422ebe78c34ee1117da63e59 /src/lib/libcrypto/man/RSA_private_encrypt.3
parent00872265b9546fcf2d5795aa3a120c35142d268b (diff)
downloadopenbsd-195fe5e91c60bd205043b4bea113abdff1c67bcc.tar.gz
openbsd-195fe5e91c60bd205043b4bea113abdff1c67bcc.tar.bz2
openbsd-195fe5e91c60bd205043b4bea113abdff1c67bcc.zip
convert RSA manuals from pod to mdoc
Diffstat (limited to 'src/lib/libcrypto/man/RSA_private_encrypt.3')
-rw-r--r--src/lib/libcrypto/man/RSA_private_encrypt.397
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
27These functions handle RSA signatures at a low level.
28.Pp
29.Fn RSA_private_encrypt
30signs the
31.Fa flen
32bytes at
33.Fa from
34(usually a message digest with an algorithm identifier) using the
35private key
36.Fa rsa
37and stores the signature in
38.Fa to .
39.Fa to
40must point to
41.Fn RSA_size rsa
42bytes of memory.
43.Pp
44.Fa padding
45denotes one of the following modes:
46.Bl -tag -width Ds
47.It Dv RSA_PKCS1_PADDING
48PKCS #1 v1.5 padding.
49This function does not handle the
50.Sy algorithmIdentifier
51specified in PKCS #1.
52When generating or verifying PKCS #1 signatures,
53.Xr RSA_sign 3
54and
55.Xr RSA_verify 3
56should be used.
57.It Dv RSA_NO_PADDING
58Raw RSA signature.
59This mode should only be used to implement cryptographically sound
60padding modes in the application code.
61Signing user data directly with RSA is insecure.
62.El
63.Pp
64.Fn RSA_public_decrypt
65recovers the message digest from the
66.Fa flen
67bytes long signature at
68.Fa from
69using the signer's public key
70.Fa rsa .
71.Fa to
72must 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
77is the padding mode that was used to sign the data.
78.Sh RETURN VALUES
79.Fn RSA_private_encrypt
80returns the size of the signature (i.e.,
81.Fn RSA_size rsa ) .
82.Fn RSA_public_decrypt
83returns the size of the recovered message digest.
84.Pp
85On 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
93The
94.Fa padding
95argument was added in SSLeay 0.8.
96.Dv RSA_NO_PADDING
97is available since SSLeay 0.9.0.