xref: /netbsd-src/crypto/external/bsd/openssl.old/dist/doc/man3/DSA_set_method.pod (revision 4724848cf0da353df257f730694b7882798e5daf)
1*4724848cSchristos=pod
2*4724848cSchristos
3*4724848cSchristos=head1 NAME
4*4724848cSchristos
5*4724848cSchristosDSA_set_default_method, DSA_get_default_method,
6*4724848cSchristosDSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method
7*4724848cSchristos
8*4724848cSchristos=head1 SYNOPSIS
9*4724848cSchristos
10*4724848cSchristos #include <openssl/dsa.h>
11*4724848cSchristos
12*4724848cSchristos void DSA_set_default_method(const DSA_METHOD *meth);
13*4724848cSchristos
14*4724848cSchristos const DSA_METHOD *DSA_get_default_method(void);
15*4724848cSchristos
16*4724848cSchristos int DSA_set_method(DSA *dsa, const DSA_METHOD *meth);
17*4724848cSchristos
18*4724848cSchristos DSA *DSA_new_method(ENGINE *engine);
19*4724848cSchristos
20*4724848cSchristos DSA_METHOD *DSA_OpenSSL(void);
21*4724848cSchristos
22*4724848cSchristos=head1 DESCRIPTION
23*4724848cSchristos
24*4724848cSchristosA B<DSA_METHOD> specifies the functions that OpenSSL uses for DSA
25*4724848cSchristosoperations. By modifying the method, alternative implementations
26*4724848cSchristossuch as hardware accelerators may be used. IMPORTANT: See the NOTES section for
27*4724848cSchristosimportant information about how these DSA API functions are affected by the use
28*4724848cSchristosof B<ENGINE> API calls.
29*4724848cSchristos
30*4724848cSchristosInitially, the default DSA_METHOD is the OpenSSL internal implementation,
31*4724848cSchristosas returned by DSA_OpenSSL().
32*4724848cSchristos
33*4724848cSchristosDSA_set_default_method() makes B<meth> the default method for all DSA
34*4724848cSchristosstructures created later.
35*4724848cSchristosB<NB>: This is true only whilst no ENGINE has
36*4724848cSchristosbeen set as a default for DSA, so this function is no longer recommended.
37*4724848cSchristosThis function is not thread-safe and should not be called at the same time
38*4724848cSchristosas other OpenSSL functions.
39*4724848cSchristos
40*4724848cSchristosDSA_get_default_method() returns a pointer to the current default
41*4724848cSchristosDSA_METHOD. However, the meaningfulness of this result is dependent on
42*4724848cSchristoswhether the ENGINE API is being used, so this function is no longer
43*4724848cSchristosrecommended.
44*4724848cSchristos
45*4724848cSchristosDSA_set_method() selects B<meth> to perform all operations using the key
46*4724848cSchristosB<rsa>. This will replace the DSA_METHOD used by the DSA key and if the
47*4724848cSchristosprevious method was supplied by an ENGINE, the handle to that ENGINE will
48*4724848cSchristosbe released during the change. It is possible to have DSA keys that only
49*4724848cSchristoswork with certain DSA_METHOD implementations (e.g. from an ENGINE module
50*4724848cSchristosthat supports embedded hardware-protected keys), and in such cases
51*4724848cSchristosattempting to change the DSA_METHOD for the key can have unexpected
52*4724848cSchristosresults. See L<DSA_meth_new> for information on constructing custom DSA_METHOD
53*4724848cSchristosobjects;
54*4724848cSchristos
55*4724848cSchristosDSA_new_method() allocates and initializes a DSA structure so that B<engine>
56*4724848cSchristoswill be used for the DSA operations. If B<engine> is NULL, the default engine
57*4724848cSchristosfor DSA operations is used, and if no default ENGINE is set, the DSA_METHOD
58*4724848cSchristoscontrolled by DSA_set_default_method() is used.
59*4724848cSchristos
60*4724848cSchristos=head1 RETURN VALUES
61*4724848cSchristos
62*4724848cSchristosDSA_OpenSSL() and DSA_get_default_method() return pointers to the respective
63*4724848cSchristosB<DSA_METHOD>s.
64*4724848cSchristos
65*4724848cSchristosDSA_set_default_method() returns no value.
66*4724848cSchristos
67*4724848cSchristosDSA_set_method() returns nonzero if the provided B<meth> was successfully set as
68*4724848cSchristosthe method for B<dsa> (including unloading the ENGINE handle if the previous
69*4724848cSchristosmethod was supplied by an ENGINE).
70*4724848cSchristos
71*4724848cSchristosDSA_new_method() returns NULL and sets an error code that can be
72*4724848cSchristosobtained by L<ERR_get_error(3)> if the allocation
73*4724848cSchristosfails. Otherwise it returns a pointer to the newly allocated structure.
74*4724848cSchristos
75*4724848cSchristos=head1 SEE ALSO
76*4724848cSchristos
77*4724848cSchristosL<DSA_new(3)>, L<DSA_new(3)>, L<DSA_meth_new(3)>
78*4724848cSchristos
79*4724848cSchristos=head1 COPYRIGHT
80*4724848cSchristos
81*4724848cSchristosCopyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
82*4724848cSchristos
83*4724848cSchristosLicensed under the OpenSSL license (the "License").  You may not use
84*4724848cSchristosthis file except in compliance with the License.  You can obtain a copy
85*4724848cSchristosin the file LICENSE in the source distribution or at
86*4724848cSchristosL<https://www.openssl.org/source/license.html>.
87*4724848cSchristos
88*4724848cSchristos=cut
89