1 .\" $OpenBSD: ENGINE_set_default.3,v 1.3 2018/04/18 12:56:50 jmc Exp $
2 .\" content checked up to:
3 .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800
5 .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
7 .\" Permission to use, copy, modify, and distribute this software for any
8 .\" purpose with or without fee is hereby granted, provided that the above
9 .\" copyright notice and this permission notice appear in all copies.
11 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 .Dd $Mdocdate: April 18 2018 $
23 .Nm ENGINE_set_default ,
24 .Nm ENGINE_set_default_string ,
25 .Nm ENGINE_set_default_RSA ,
26 .Nm ENGINE_set_default_DSA ,
27 .Nm ENGINE_set_default_ECDH ,
28 .Nm ENGINE_set_default_ECDSA ,
29 .Nm ENGINE_set_default_DH ,
30 .Nm ENGINE_set_default_RAND ,
31 .Nm ENGINE_set_default_ciphers ,
32 .Nm ENGINE_set_default_digests
33 .Nd register an ENGINE as the default for an algorithm
36 .Fo ENGINE_set_default_RSA
40 .Fo ENGINE_set_default_DSA
44 .Fo ENGINE_set_default_ECDH
48 .Fo ENGINE_set_default_ECDSA
52 .Fo ENGINE_set_default_DH
56 .Fo ENGINE_set_default_RAND
60 .Fo ENGINE_set_default_ciphers
64 .Fo ENGINE_set_default_digests
68 .Fo ENGINE_set_default
70 .Fa "unsigned int flags"
73 .Fo ENGINE_set_default_string
75 .Fa "const char *list"
78 These functions register
80 as implementing the respective algorithm
81 like the functions described in the
82 .Xr ENGINE_register_RSA 3
84 In addition, they call
90 as the default implementation of the respective algorithm to be
91 returned by the functions described in
92 .Xr ENGINE_get_default_RSA 3
94 If another engine was previously selected
95 as the default implementation of the respective algorithm,
97 is called on that previous engine.
101 implements more than one cipher or digest,
102 .Fn ENGINE_set_default_ciphers
104 .Fn ENGINE_set_default_digests
105 register and select it for all these ciphers and digests, respectively.
107 .Fn ENGINE_set_default
110 as the default implementation of all algorithms specified by the
112 by calling the appropriate ones among the other functions.
113 Algorithms can be selected by combining any number of the
114 following constants with bitwise OR:
115 .Dv ENGINE_METHOD_ALL ,
116 .Dv ENGINE_METHOD_RSA ,
117 .Dv ENGINE_METHOD_DSA ,
118 .Dv ENGINE_METHOD_ECDH ,
119 .Dv ENGINE_METHOD_ECDSA ,
120 .Dv ENGINE_METHOD_DH ,
121 .Dv ENGINE_METHOD_RAND ,
122 .Dv ENGINE_METHOD_CIPHERS ,
123 .Dv ENGINE_METHOD_DIGESTS ,
124 .Dv ENGINE_METHOD_PKEY_METHS ,
126 .Dv ENGINE_METHOD_PKEY_ASN1_METHS .
128 .Fn ENGINE_set_default_string
129 is similar except that it selects the algorithms according to the string
131 which contains an arbitrary number of comma-separated keywords from
132 the following list: ALL, RSA, DSA, ECDH, ECDSA, DH, RAND, CIPHERS,
133 DIGESTS, PKEY_CRYPTO, PKEY_ASN1, and PKEY.
134 PKEY_CRYPTO corresponds to
135 .Dv ENGINE_METHOD_PKEY_METHS ,
137 .Dv ENGINE_METHOD_PKEY_ASN1_METHS ,
138 and PKEY selects both.
140 These functions return 1 on success or 0 on error.
143 fails or if insufficient memory is available.
145 .Xr ENGINE_get_default_RSA 3 ,
148 .Xr ENGINE_register_RSA 3 ,
149 .Xr ENGINE_set_RSA 3 ,
150 .Xr ENGINE_unregister_RSA 3
152 .Fn ENGINE_set_default ,
153 .Fn ENGINE_set_default_RSA ,
154 .Fn ENGINE_set_default_DSA ,
155 .Fn ENGINE_set_default_DH ,
157 .Fn ENGINE_set_default_RAND
158 first appeared in OpenSSL 0.9.7 and have been available since
161 .Fn ENGINE_set_default_string ,
162 .Fn ENGINE_set_default_ciphers ,
164 .Fn ENGINE_set_default_digests
165 first appeared in OpenSSL 0.9.7 and have been available since
168 .Fn ENGINE_set_default_ECDH
170 .Fn ENGINE_set_default_ECDSA
171 first appeared in OpenSSL 0.9.8 and have been available since
179 .Fn ENGINE_set_default
181 .Fn ENGINE_set_default_string
182 fail, they typically still register
184 for some algorithms, but usually not for all it could be registered
185 for by calling the individual functions.