diff options
Diffstat (limited to 'src/lib/libcrypto/man/RSA_sign.3')
-rw-r--r-- | src/lib/libcrypto/man/RSA_sign.3 | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/RSA_sign.3 b/src/lib/libcrypto/man/RSA_sign.3 new file mode 100644 index 0000000000..2b9e5eb6f1 --- /dev/null +++ b/src/lib/libcrypto/man/RSA_sign.3 | |||
@@ -0,0 +1,103 @@ | |||
1 | .Dd $Mdocdate: November 4 2016 $ | ||
2 | .Dt RSA_SIGN 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm RSA_sign , | ||
6 | .Nm RSA_verify | ||
7 | .Nd RSA signatures | ||
8 | .Sh SYNOPSIS | ||
9 | .In openssl/rsa.h | ||
10 | .Ft int | ||
11 | .Fo RSA_sign | ||
12 | .Fa "int type" | ||
13 | .Fa "const unsigned char *m" | ||
14 | .Fa "unsigned int m_len" | ||
15 | .Fa "unsigned char *sigret" | ||
16 | .Fa "unsigned int *siglen" | ||
17 | .Fa "RSA *rsa" | ||
18 | .Fc | ||
19 | .Ft int | ||
20 | .Fo RSA_verify | ||
21 | .Fa "int type" | ||
22 | .Fa "const unsigned char *m" | ||
23 | .Fa "unsigned int m_len" | ||
24 | .Fa "unsigned char *sigbuf" | ||
25 | .Fa "unsigned int siglen" | ||
26 | .Fa "RSA *rsa" | ||
27 | .Fc | ||
28 | .Sh DESCRIPTION | ||
29 | .Fn RSA_sign | ||
30 | signs the message digest | ||
31 | .Fa m | ||
32 | of size | ||
33 | .Fa m_len | ||
34 | using the private key | ||
35 | .Fa rsa | ||
36 | as specified in PKCS #1 v2.0. | ||
37 | It stores the signature in | ||
38 | .Fa sigret | ||
39 | and the signature size in | ||
40 | .Fa siglen . | ||
41 | .Fa sigret | ||
42 | must point to | ||
43 | .Fn RSA_size rsa | ||
44 | bytes of memory. | ||
45 | Note that PKCS #1 adds meta-data, placing limits on the size of the key | ||
46 | that can be used. | ||
47 | See | ||
48 | .Xr RSA_private_encrypt 3 | ||
49 | for lower-level operations. | ||
50 | .Pp | ||
51 | .Fa type | ||
52 | denotes the message digest algorithm that was used to generate | ||
53 | .Fa m . | ||
54 | It usually is one of | ||
55 | .Dv NID_sha1 , | ||
56 | .Dv NID_ripemd160 , | ||
57 | or | ||
58 | .Dv NID_md5 ; | ||
59 | see | ||
60 | .Xr OBJ_nid2obj 3 | ||
61 | for details. | ||
62 | If | ||
63 | .Fa type | ||
64 | is | ||
65 | .Sy NID_md5_sha1 , | ||
66 | an SSL signature (MD5 and SHA1 message digests with PKCS #1 padding and | ||
67 | no algorithm identifier) is created. | ||
68 | .Pp | ||
69 | .Fn RSA_verify | ||
70 | verifies that the signature | ||
71 | .Fa sigbuf | ||
72 | of size | ||
73 | .Fa siglen | ||
74 | matches a given message digest | ||
75 | .Fa m | ||
76 | of size | ||
77 | .Fa m_len . | ||
78 | .Fa type | ||
79 | denotes the message digest algorithm that was used to generate the | ||
80 | signature. | ||
81 | .Fa rsa | ||
82 | is the signer's public key. | ||
83 | .Sh RETURN VALUES | ||
84 | .Fn RSA_sign | ||
85 | returns 1 on success or 0 otherwise. | ||
86 | .Fn RSA_verify | ||
87 | returns 1 on successful verification or 0 otherwise. | ||
88 | .Pp | ||
89 | The error codes can be obtained by | ||
90 | .Xr ERR_get_error 3 . | ||
91 | .Sh SEE ALSO | ||
92 | .Xr ERR_get_error 3 , | ||
93 | .Xr objects 3 , | ||
94 | .Xr rsa 3 , | ||
95 | .Xr RSA_private_encrypt 3 , | ||
96 | .Xr RSA_public_decrypt 3 | ||
97 | .Sh STANDARDS | ||
98 | SSL, PKCS #1 v2.0 | ||
99 | .Sh HISTORY | ||
100 | .Fn RSA_sign | ||
101 | and | ||
102 | .Fn RSA_verify | ||
103 | are available in all versions of SSLeay and OpenSSL. | ||