diff options
Diffstat (limited to 'src/lib/libcrypto/man/ENGINE_set_RSA.3')
| -rw-r--r-- | src/lib/libcrypto/man/ENGINE_set_RSA.3 | 288 |
1 files changed, 288 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/ENGINE_set_RSA.3 b/src/lib/libcrypto/man/ENGINE_set_RSA.3 new file mode 100644 index 0000000000..d795f55c72 --- /dev/null +++ b/src/lib/libcrypto/man/ENGINE_set_RSA.3 | |||
| @@ -0,0 +1,288 @@ | |||
| 1 | .\" $OpenBSD: ENGINE_set_RSA.3,v 1.1 2018/04/15 17:02:03 schwarze Exp $ | ||
| 2 | .\" content checked up to: | ||
| 3 | .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 | ||
| 4 | .\" | ||
| 5 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> | ||
| 6 | .\" | ||
| 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. | ||
| 10 | .\" | ||
| 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. | ||
| 18 | .\" | ||
| 19 | .Dd $Mdocdate: April 15 2018 $ | ||
| 20 | .Dt ENGINE_SET_RSA 3 | ||
| 21 | .Os | ||
| 22 | .Sh NAME | ||
| 23 | .Nm ENGINE_set_RSA , | ||
| 24 | .Nm ENGINE_get_RSA , | ||
| 25 | .Nm ENGINE_set_DSA , | ||
| 26 | .Nm ENGINE_get_DSA , | ||
| 27 | .Nm ENGINE_set_ECDH , | ||
| 28 | .Nm ENGINE_get_ECDH , | ||
| 29 | .Nm ENGINE_set_ECDSA , | ||
| 30 | .Nm ENGINE_get_ECDSA , | ||
| 31 | .Nm ENGINE_set_DH , | ||
| 32 | .Nm ENGINE_get_DH , | ||
| 33 | .Nm ENGINE_set_RAND , | ||
| 34 | .Nm ENGINE_get_RAND , | ||
| 35 | .Nm ENGINE_set_STORE , | ||
| 36 | .Nm ENGINE_get_STORE , | ||
| 37 | .Nm ENGINE_set_ciphers , | ||
| 38 | .Nm ENGINE_get_ciphers , | ||
| 39 | .Nm ENGINE_get_cipher , | ||
| 40 | .Nm ENGINE_set_digests , | ||
| 41 | .Nm ENGINE_get_digests , | ||
| 42 | .Nm ENGINE_get_digest | ||
| 43 | .Nd install and retrieve function tables of crypto engines | ||
| 44 | .Sh SYNOPSIS | ||
| 45 | .In openssl/engine.h | ||
| 46 | .Ft int | ||
| 47 | .Fo ENGINE_set_RSA | ||
| 48 | .Fa "ENGINE *e" | ||
| 49 | .Fa "const RSA_METHOD *rsa_meth" | ||
| 50 | .Fc | ||
| 51 | .Ft const RSA_METHOD * | ||
| 52 | .Fo ENGINE_get_RSA | ||
| 53 | .Fa "const ENGINE *e" | ||
| 54 | .Fc | ||
| 55 | .Ft int | ||
| 56 | .Fo ENGINE_set_DSA | ||
| 57 | .Fa "ENGINE *e" | ||
| 58 | .Fa "const DSA_METHOD *dsa_meth" | ||
| 59 | .Fc | ||
| 60 | .Ft const DSA_METHOD * | ||
| 61 | .Fo ENGINE_get_DSA | ||
| 62 | .Fa "const ENGINE *e" | ||
| 63 | .Fc | ||
| 64 | .Ft int | ||
| 65 | .Fo ENGINE_set_ECDH | ||
| 66 | .Fa "ENGINE *e" | ||
| 67 | .Fa "const ECDH_METHOD *dh_meth" | ||
| 68 | .Fc | ||
| 69 | .Ft const ECDH_METHOD * | ||
| 70 | .Fo ENGINE_get_ECDH | ||
| 71 | .Fa "const ENGINE *e" | ||
| 72 | .Fc | ||
| 73 | .Ft int | ||
| 74 | .Fo ENGINE_set_ECDSA | ||
| 75 | .Fa "ENGINE *e" | ||
| 76 | .Fa "const ECDSA_METHOD *dh_meth" | ||
| 77 | .Fc | ||
| 78 | .Ft const ECDSA_METHOD * | ||
| 79 | .Fo ENGINE_get_ECDSA | ||
| 80 | .Fa "const ENGINE *e" | ||
| 81 | .Fc | ||
| 82 | .Ft int | ||
| 83 | .Fo ENGINE_set_DH | ||
| 84 | .Fa "ENGINE *e" | ||
| 85 | .Fa "const DH_METHOD *dh_meth" | ||
| 86 | .Fc | ||
| 87 | .Ft const DH_METHOD * | ||
| 88 | .Fo ENGINE_get_DH | ||
| 89 | .Fa "const ENGINE *e" | ||
| 90 | .Fc | ||
| 91 | .Ft int | ||
| 92 | .Fo ENGINE_set_RAND | ||
| 93 | .Fa "ENGINE *e" | ||
| 94 | .Fa "const RAND_METHOD *rand_meth" | ||
| 95 | .Fc | ||
| 96 | .Ft const RAND_METHOD * | ||
| 97 | .Fo ENGINE_get_RAND | ||
| 98 | .Fa "const ENGINE *e" | ||
| 99 | .Fc | ||
| 100 | .Ft int | ||
| 101 | .Fo ENGINE_set_STORE | ||
| 102 | .Fa "ENGINE *e" | ||
| 103 | .Fa "const STORE_METHOD *rand_meth" | ||
| 104 | .Fc | ||
| 105 | .Ft const STORE_METHOD * | ||
| 106 | .Fo ENGINE_get_STORE | ||
| 107 | .Fa "const ENGINE *e" | ||
| 108 | .Fc | ||
| 109 | .Ft typedef int | ||
| 110 | .Fo (*ENGINE_CIPHERS_PTR) | ||
| 111 | .Fa "ENGINE *e" | ||
| 112 | .Fa "const EVP_CIPHER **impl" | ||
| 113 | .Fa "const int **nids" | ||
| 114 | .Fa "int nid" | ||
| 115 | .Fc | ||
| 116 | .Ft int | ||
| 117 | .Fo ENGINE_set_ciphers | ||
| 118 | .Fa "ENGINE *e" | ||
| 119 | .Fa "ENGINE_CIPHERS_PTR f" | ||
| 120 | .Fc | ||
| 121 | .Ft ENGINE_CIPHERS_PTR | ||
| 122 | .Fo ENGINE_get_ciphers | ||
| 123 | .Fa "const ENGINE *e" | ||
| 124 | .Fc | ||
| 125 | .Ft const EVP_CIPHER * | ||
| 126 | .Fo ENGINE_get_cipher | ||
| 127 | .Fa "ENGINE *e" | ||
| 128 | .Fa "int nid" | ||
| 129 | .Fc | ||
| 130 | .Ft typedef int | ||
| 131 | .Fo (*ENGINE_DIGESTS_PTR) | ||
| 132 | .Fa "ENGINE *e" | ||
| 133 | .Fa "const EVP_MD **impl" | ||
| 134 | .Fa "const int **nids" | ||
| 135 | .Fa "int nid" | ||
| 136 | .Fc | ||
| 137 | .Ft int | ||
| 138 | .Fo ENGINE_set_digests | ||
| 139 | .Fa "ENGINE *e" | ||
| 140 | .Fa "ENGINE_DIGESTS_PTR f" | ||
| 141 | .Fc | ||
| 142 | .Ft ENGINE_DIGESTS_PTR | ||
| 143 | .Fo ENGINE_get_digests | ||
| 144 | .Fa "const ENGINE *e" | ||
| 145 | .Fc | ||
| 146 | .Ft const EVP_MD * | ||
| 147 | .Fo ENGINE_get_digest | ||
| 148 | .Fa "ENGINE *e" | ||
| 149 | .Fa "int nid" | ||
| 150 | .Fc | ||
| 151 | .Sh DESCRIPTION | ||
| 152 | The | ||
| 153 | .Fn ENGINE_set_* | ||
| 154 | functions install a table of function pointers | ||
| 155 | implementing the respective algorithm in | ||
| 156 | .Fa e . | ||
| 157 | Partial information about the various method objects is available from | ||
| 158 | .Xr RSA_meth_new 3 , | ||
| 159 | .Xr RSA_get_default_method 3 , | ||
| 160 | .Xr DSA_meth_new 3 , | ||
| 161 | .Xr DSA_get_default_method 3 , | ||
| 162 | .Fn ECDH_get_default_method , | ||
| 163 | .Xr ECDSA_get_default_method 3 , | ||
| 164 | .Xr DH_get_default_method 3 , | ||
| 165 | .Xr RAND_get_rand_method 3 , | ||
| 166 | .Xr EVP_get_cipherbynid 3 , | ||
| 167 | and | ||
| 168 | .Xr EVP_get_digestbynid 3 . | ||
| 169 | .Vt STORE_METHOD | ||
| 170 | is an incomplete type, and the pointers to it are not used for anything. | ||
| 171 | For complete descriptions of these types, | ||
| 172 | refer to the respective header files. | ||
| 173 | .Pp | ||
| 174 | The functions described in the | ||
| 175 | .Xr ENGINE_register_RSA 3 | ||
| 176 | and | ||
| 177 | .Xr ENGINE_set_default 3 | ||
| 178 | manual pages only have an effect after function pointers | ||
| 179 | were installed using the functions decribed here. | ||
| 180 | .Pp | ||
| 181 | .Fn ENGINE_set_ciphers | ||
| 182 | and | ||
| 183 | .Fn ENGINE_set_digests | ||
| 184 | are special in so far as the | ||
| 185 | .Vt ENGINE | ||
| 186 | structure does not provide fields to store function pointers | ||
| 187 | implementing ciphers or digests. | ||
| 188 | Instead, these two functions only install a callback to | ||
| 189 | retrieve implementations. | ||
| 190 | Where the pointers to the implementations are stored internally, | ||
| 191 | how they get initialized, and how the | ||
| 192 | .Vt ENGINE_CIPHERS_PTR | ||
| 193 | and | ||
| 194 | .Vt ENGINE_DIGESTS_PTR | ||
| 195 | callbacks retrieve them | ||
| 196 | is up to the implementation of each individual engine. | ||
| 197 | .Pp | ||
| 198 | If the | ||
| 199 | .Vt ENGINE_CIPHERS_PTR | ||
| 200 | and | ||
| 201 | .Vt ENGINE_DIGESTS_PTR | ||
| 202 | callbacks are called with a non-zero | ||
| 203 | .Fa nid , | ||
| 204 | they retrieve the implementation of that cipher or digest, | ||
| 205 | respectively. | ||
| 206 | In this case, a | ||
| 207 | .Dv NULL | ||
| 208 | pointer can be passed as the | ||
| 209 | .Fa nids | ||
| 210 | argument. | ||
| 211 | .Fn ENGINE_get_cipher | ||
| 212 | and | ||
| 213 | .Fn ENGINE_get_digest | ||
| 214 | call the callbacks installed in | ||
| 215 | .Fa e | ||
| 216 | in this way. | ||
| 217 | .Pp | ||
| 218 | If 0 is passed as the | ||
| 219 | .Fa nid | ||
| 220 | argument, an internal pointer | ||
| 221 | to the array of implementations available in | ||
| 222 | .Fa e | ||
| 223 | is returned in | ||
| 224 | .Pf * Fa impl , | ||
| 225 | and an internal pointer | ||
| 226 | to the array of corresponding identifiers in | ||
| 227 | .Pf * Fa nids . | ||
| 228 | The return value of the callback indicates | ||
| 229 | the number of implementations returned. | ||
| 230 | .Pp | ||
| 231 | The | ||
| 232 | .Fn ENGINE_get_* | ||
| 233 | functions retrieve the previously installed function tables. | ||
| 234 | They are used when constructing basic cryptographic objects | ||
| 235 | as shown in the following table: | ||
| 236 | .Bl -column "ENGINE_get_digestMM" | ||
| 237 | .It Accessor: Ta Called by: | ||
| 238 | .It Fn ENGINE_get_RSA Ta Xr RSA_new_method 3 , Xr RSA_new 3 | ||
| 239 | .It Fn ENGINE_get_DSA Ta Xr DSA_new_method 3 , Xr DSA_new 3 | ||
| 240 | .It Fn ENGINE_get_ECDH Ta Fn ECDH_set_method , Fn ECDH_compute_key | ||
| 241 | .It Fn ENGINE_get_ECDSA Ta Xr ECDSA_set_method 3 , Xr ECDSA_sign_setup 3 , | ||
| 242 | .Xr ECDSA_do_sign_ex 3 , Xr ECDSA_do_verify 3 | ||
| 243 | .It Fn ENGINE_get_DH Ta Xr DH_new_method 3 , Xr DH_new 3 | ||
| 244 | .It Fn ENGINE_get_RAND Ta unused | ||
| 245 | .It Fn ENGINE_get_STORE Ta unused | ||
| 246 | .It Fn ENGINE_get_cipher Ta Xr EVP_CipherInit_ex 3 | ||
| 247 | .It Fn ENGINE_get_digest Ta Xr EVP_DigestInit_ex 3 | ||
| 248 | .El | ||
| 249 | .Sh RETURN VALUES | ||
| 250 | The | ||
| 251 | .Fn ENGINE_set_* | ||
| 252 | functions return 1 on success or 0 on error. | ||
| 253 | Currently, they cannot fail. | ||
| 254 | .Pp | ||
| 255 | The | ||
| 256 | .Fn ENGINE_get_* | ||
| 257 | functions return a method object for the respective algorithm, or | ||
| 258 | .Dv NULL | ||
| 259 | if none is installed. | ||
| 260 | .Pp | ||
| 261 | .Fn ENGINE_get_ciphers | ||
| 262 | and | ||
| 263 | .Fn ENGINE_get_digests | ||
| 264 | return a function pointer to the respective callback, or | ||
| 265 | .Dv NULL | ||
| 266 | if none is installed. | ||
| 267 | .Pp | ||
| 268 | .Fn ENGINE_get_cipher | ||
| 269 | returns an | ||
| 270 | .Vt EVP_CIPHER | ||
| 271 | object implementing the cipher | ||
| 272 | .Fa nid | ||
| 273 | or | ||
| 274 | .Dv NULL | ||
| 275 | if | ||
| 276 | .Fa e | ||
| 277 | does not implement that cipher. | ||
| 278 | .Pp | ||
| 279 | .Fn ENGINE_get_digest | ||
| 280 | returns an | ||
| 281 | .Vt EVP_MD | ||
| 282 | object implementing the digest | ||
| 283 | .Fa nid | ||
| 284 | or | ||
| 285 | .Dv NULL | ||
| 286 | if | ||
| 287 | .Fa e | ||
| 288 | does not implement that digest. | ||
