faece3730dbae527de1890d93f1a318106cd1905
[openssl.git] / doc / crypto / DSA_set_method.pod
1 =pod
2
3 =head1 NAME
4
5 DSA_set_default_method, DSA_get_default_method,
6 DSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method
7
8 =head1 SYNOPSIS
9
10  #include <openssl/dsa.h>
11  #include <openssl/engine.h>
12
13  void DSA_set_default_method(const DSA_METHOD *meth);
14
15  const DSA_METHOD *DSA_get_default_method(void);
16
17  int DSA_set_method(DSA *dsa, const DSA_METHOD *meth);
18
19  DSA *DSA_new_method(ENGINE *engine);
20
21  DSA_METHOD *DSA_OpenSSL(void);
22
23 =head1 DESCRIPTION
24
25 A B<DSA_METHOD> specifies the functions that OpenSSL uses for DSA
26 operations. By modifying the method, alternative implementations
27 such as hardware accelerators may be used. IMPORTANT: See the NOTES section for
28 important information about how these DSA API functions are affected by the use
29 of B<ENGINE> API calls.
30
31 Initially, the default DSA_METHOD is the OpenSSL internal implementation,
32 as returned by DSA_OpenSSL().
33
34 DSA_set_default_method() makes B<meth> the default method for all DSA
35 structures created later. B<NB>: This is true only whilst no ENGINE has
36 been set as a default for DSA, so this function is no longer recommended.
37
38 DSA_get_default_method() returns a pointer to the current default
39 DSA_METHOD. However, the meaningfulness of this result is dependent on
40 whether the ENGINE API is being used, so this function is no longer
41 recommended.
42
43 DSA_set_method() selects B<meth> to perform all operations using the key
44 B<rsa>. This will replace the DSA_METHOD used by the DSA key and if the
45 previous method was supplied by an ENGINE, the handle to that ENGINE will
46 be released during the change. It is possible to have DSA keys that only
47 work with certain DSA_METHOD implementations (eg. from an ENGINE module
48 that supports embedded hardware-protected keys), and in such cases
49 attempting to change the DSA_METHOD for the key can have unexpected
50 results. See L<DSA_meth_new> for information on constructing custom DSA_METHOD
51 objects;
52
53 DSA_new_method() allocates and initializes a DSA structure so that B<engine>
54 will be used for the DSA operations. If B<engine> is NULL, the default engine
55 for DSA operations is used, and if no default ENGINE is set, the DSA_METHOD
56 controlled by DSA_set_default_method() is used.
57
58 =head1 RETURN VALUES
59
60 DSA_OpenSSL() and DSA_get_default_method() return pointers to the respective
61 B<DSA_METHOD>s.
62
63 DSA_set_default_method() returns no value.
64
65 DSA_set_method() returns non-zero if the provided B<meth> was successfully set as
66 the method for B<dsa> (including unloading the ENGINE handle if the previous
67 method was supplied by an ENGINE).
68
69 DSA_new_method() returns NULL and sets an error code that can be
70 obtained by L<ERR_get_error(3)> if the allocation
71 fails. Otherwise it returns a pointer to the newly allocated structure.
72
73 =head1 SEE ALSO
74
75 L<dsa(3)>, L<DSA_new(3)>, L<DSA_meth_new(3)>
76
77 =cut
78
79 =head1 COPYRIGHT
80
81 Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
82
83 Licensed under the OpenSSL license (the "License").  You may not use
84 this file except in compliance with the License.  You can obtain a copy
85 in the file LICENSE in the source distribution or at
86 L<https://www.openssl.org/source/license.html>.
87
88 =cut