diff options
Diffstat (limited to 'src/lib/libcrypto/man/DSA_sign.3')
-rw-r--r-- | src/lib/libcrypto/man/DSA_sign.3 | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/DSA_sign.3 b/src/lib/libcrypto/man/DSA_sign.3 new file mode 100644 index 0000000000..371f1f4555 --- /dev/null +++ b/src/lib/libcrypto/man/DSA_sign.3 | |||
@@ -0,0 +1,122 @@ | |||
1 | .Dd $Mdocdate: November 2 2016 $ | ||
2 | .Dt DSA_SIGN 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm DSA_sign , | ||
6 | .Nm DSA_sign_setup , | ||
7 | .Nm DSA_verify | ||
8 | .Nd DSA signatures | ||
9 | .Sh SYNOPSIS | ||
10 | .In openssl/dsa.h | ||
11 | .Ft int | ||
12 | .Fo DSA_sign | ||
13 | .Fa "int type" | ||
14 | .Fa "const unsigned char *dgst" | ||
15 | .Fa "int len" | ||
16 | .Fa "unsigned char *sigret" | ||
17 | .Fa "unsigned int *siglen" | ||
18 | .Fa "DSA *dsa" | ||
19 | .Fc | ||
20 | .Ft int | ||
21 | .Fo DSA_sign_setup | ||
22 | .Fa "DSA *dsa" | ||
23 | .Fa "BN_CTX *ctx" | ||
24 | .Fa "BIGNUM **kinvp" | ||
25 | .Fa "BIGNUM **rp" | ||
26 | .Fc | ||
27 | .Ft int | ||
28 | .Fo DSA_verify | ||
29 | .Fa "int type" | ||
30 | .Fa "const unsigned char *dgst" | ||
31 | .Fa "int len" | ||
32 | .Fa "unsigned char *sigbuf" | ||
33 | .Fa "int siglen" | ||
34 | .Fa "DSA *dsa" | ||
35 | .Fc | ||
36 | .Sh DESCRIPTION | ||
37 | .Fn DSA_sign | ||
38 | computes a digital signature on the | ||
39 | .Fa len | ||
40 | byte message digest | ||
41 | .Fa dgst | ||
42 | using the private key | ||
43 | .Fa dsa | ||
44 | and places its ASN.1 DER encoding at | ||
45 | .Fa sigret . | ||
46 | The length of the signature is placed in | ||
47 | .Pf * Fa siglen . | ||
48 | .Fa sigret | ||
49 | must point to | ||
50 | .Fn DSA_size dsa | ||
51 | bytes of memory. | ||
52 | .Pp | ||
53 | .Fn DSA_sign_setup | ||
54 | may be used to precompute part of the signing operation in case | ||
55 | signature generation is time-critical. | ||
56 | It expects | ||
57 | .Fa dsa | ||
58 | to contain DSA parameters. | ||
59 | It places the precomputed values in newly allocated | ||
60 | .Vt BIGNUM Ns s | ||
61 | at | ||
62 | .Pf * Fa kinvp | ||
63 | and | ||
64 | .Pf * Fa rp , | ||
65 | after freeing the old ones unless | ||
66 | .Fa kinvp | ||
67 | and | ||
68 | .Fa rp | ||
69 | are | ||
70 | .Dv NULL . | ||
71 | These values may be passed to | ||
72 | .Fn DSA_sign | ||
73 | in | ||
74 | .Fa dsa->kinv | ||
75 | and | ||
76 | .Sy dsa->r . | ||
77 | .Fa ctx | ||
78 | is a pre-allocated | ||
79 | .Vt BN_CTX | ||
80 | or | ||
81 | .Dv NULL . | ||
82 | .Pp | ||
83 | .Fn DSA_verify | ||
84 | verifies that the signature | ||
85 | .Fa sigbuf | ||
86 | of size | ||
87 | .Fa siglen | ||
88 | matches a given message digest | ||
89 | .Fa dgst | ||
90 | of size | ||
91 | .Fa len . | ||
92 | .Fa dsa | ||
93 | is the signer's public key. | ||
94 | .Pp | ||
95 | The | ||
96 | .Fa type | ||
97 | parameter is ignored. | ||
98 | .Sh RETURN VALUES | ||
99 | .Fn DSA_sign | ||
100 | and | ||
101 | .Fn DSA_sign_setup | ||
102 | return 1 on success or 0 on error. | ||
103 | .Fn DSA_verify | ||
104 | returns 1 for a valid signature, 0 for an incorrect signature, | ||
105 | and -1 on error. | ||
106 | The error codes can be obtained by | ||
107 | .Xr ERR_get_error 3 . | ||
108 | .Sh SEE ALSO | ||
109 | .Xr dsa 3 , | ||
110 | .Xr DSA_do_sign 3 , | ||
111 | .Xr ERR_get_error 3 , | ||
112 | .Xr rand 3 | ||
113 | .Sh STANDARDS | ||
114 | US Federal Information Processing Standard FIPS 186 (Digital Signature | ||
115 | Standard, DSS), ANSI X9.30 | ||
116 | .Sh HISTORY | ||
117 | .Fn DSA_sign | ||
118 | and | ||
119 | .Fn DSA_verify | ||
120 | are available in all versions of SSLeay. | ||
121 | .Fn DSA_sign_setup | ||
122 | was added in SSLeay 0.8. | ||