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