]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/crypto/dsa.pod
Add copyright to manpages
[thirdparty/openssl.git] / doc / crypto / dsa.pod
CommitLineData
38e33cef
UM
1=pod
2
3=head1 NAME
4
5dsa - Digital Signature Algorithm
6
7=head1 SYNOPSIS
8
9 #include <openssl/dsa.h>
5270e702 10 #include <openssl/engine.h>
38e33cef
UM
11
12 DSA * DSA_new(void);
13 void DSA_free(DSA *dsa);
14
5bf73873 15 int DSA_size(const DSA *dsa);
38e33cef
UM
16
17 DSA * DSA_generate_parameters(int bits, unsigned char *seed,
18 int seed_len, int *counter_ret, unsigned long *h_ret,
9dbc41d7 19 void (*callback)(int, int, void *), void *cb_arg);
38e33cef 20
5bf73873 21 DH * DSA_dup_DH(const DSA *r);
38e33cef
UM
22
23 int DSA_generate_key(DSA *dsa);
24
25 int DSA_sign(int dummy, const unsigned char *dgst, int len,
26 unsigned char *sigret, unsigned int *siglen, DSA *dsa);
27 int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp,
28 BIGNUM **rp);
29 int DSA_verify(int dummy, const unsigned char *dgst, int len,
5bf73873 30 const unsigned char *sigbuf, int siglen, DSA *dsa);
38e33cef 31
5bf73873
GT
32 void DSA_set_default_method(const DSA_METHOD *meth);
33 const DSA_METHOD *DSA_get_default_method(void);
34 int DSA_set_method(DSA *dsa, const DSA_METHOD *meth);
5270e702 35 DSA *DSA_new_method(ENGINE *engine);
5bf73873 36 const DSA_METHOD *DSA_OpenSSL(void);
38e33cef 37
38e33cef
UM
38 DSA_SIG *DSA_SIG_new(void);
39 void DSA_SIG_free(DSA_SIG *a);
5bf73873 40 int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
38e33cef
UM
41 DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, unsigned char **pp, long length);
42
43 DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
44 int DSA_do_verify(const unsigned char *dgst, int dgst_len,
45 DSA_SIG *sig, DSA *dsa);
46
47 DSA * d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length);
48 DSA * d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
49 DSA * d2i_DSAparams(DSA **a, unsigned char **pp, long length);
5bf73873
GT
50 int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
51 int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
52 int i2d_DSAparams(const DSA *a,unsigned char **pp);
38e33cef 53
5bf73873
GT
54 int DSAparams_print(BIO *bp, const DSA *x);
55 int DSAparams_print_fp(FILE *fp, const DSA *x);
56 int DSA_print(BIO *bp, const DSA *x, int off);
57 int DSA_print_fp(FILE *bp, const DSA *x, int off);
38e33cef
UM
58
59=head1 DESCRIPTION
60
61These functions implement the Digital Signature Algorithm (DSA). The
62generation of shared DSA parameters is described in
9b86974e
RS
63L<DSA_generate_parameters(3)>;
64L<DSA_generate_key(3)> describes how to
38e33cef 65generate a signature key. Signature generation and verification are
9b86974e 66described in L<DSA_sign(3)>.
38e33cef
UM
67
68The B<DSA> structure consists of several BIGNUM components.
69
70 struct
71 {
72 BIGNUM *p; // prime number (public)
73 BIGNUM *q; // 160-bit subprime, q | p-1 (public)
74 BIGNUM *g; // generator of subgroup (public)
75 BIGNUM *priv_key; // private key x
76 BIGNUM *pub_key; // public key y = g^x
77 // ...
78 }
79 DSA;
80
81In public keys, B<priv_key> is NULL.
82
5bf73873
GT
83Note that DSA keys may use non-standard B<DSA_METHOD> implementations,
84either directly or by the use of B<ENGINE> modules. In some cases (eg. an
85ENGINE providing support for hardware-embedded keys), these BIGNUM values
86will not be used by the implementation or may be used for alternative data
87storage. For this reason, applications should generally avoid using DSA
88structure elements directly and instead use API functions to query or
89modify keys.
90
38e33cef
UM
91=head1 CONFORMING TO
92
93US Federal Information Processing Standard FIPS 186 (Digital Signature
94Standard, DSS), ANSI X9.30
95
96=head1 SEE ALSO
97
9b86974e
RS
98L<bn(3)>, L<dh(3)>, L<err(3)>, L<rand(3)>,
99L<rsa(3)>, L<sha(3)>, L<engine(3)>,
100L<DSA_new(3)>,
101L<DSA_size(3)>,
102L<DSA_generate_parameters(3)>,
103L<DSA_dup_DH(3)>,
104L<DSA_generate_key(3)>,
105L<DSA_sign(3)>, L<DSA_set_method(3)>,
106L<DSA_get_ex_new_index(3)>,
107L<RSA_print(3)>
38e33cef
UM
108
109=cut
e2f92610
RS
110
111=head1 COPYRIGHT
112
113Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
114
115Licensed under the OpenSSL license (the "License"). You may not use
116this file except in compliance with the License. You can obtain a copy
117in the file LICENSE in the source distribution or at
118L<https://www.openssl.org/source/license.html>.
119
120=cut