xref: /freebsd/crypto/openssl/doc/man3/EVP_PKEY_meth_new.pod (revision e32fecd0c2c3ee37c47ee100f169e7eb0282a873)
1=pod
2
3=head1 NAME
4
5EVP_PKEY_meth_new, EVP_PKEY_meth_free, EVP_PKEY_meth_copy, EVP_PKEY_meth_find,
6EVP_PKEY_meth_add0, EVP_PKEY_METHOD,
7EVP_PKEY_meth_set_init, EVP_PKEY_meth_set_copy, EVP_PKEY_meth_set_cleanup,
8EVP_PKEY_meth_set_paramgen, EVP_PKEY_meth_set_keygen, EVP_PKEY_meth_set_sign,
9EVP_PKEY_meth_set_verify, EVP_PKEY_meth_set_verify_recover, EVP_PKEY_meth_set_signctx,
10EVP_PKEY_meth_set_verifyctx, EVP_PKEY_meth_set_encrypt, EVP_PKEY_meth_set_decrypt,
11EVP_PKEY_meth_set_derive, EVP_PKEY_meth_set_ctrl,
12EVP_PKEY_meth_set_digestsign, EVP_PKEY_meth_set_digestverify,
13EVP_PKEY_meth_set_check,
14EVP_PKEY_meth_set_public_check, EVP_PKEY_meth_set_param_check,
15EVP_PKEY_meth_set_digest_custom,
16EVP_PKEY_meth_get_init, EVP_PKEY_meth_get_copy, EVP_PKEY_meth_get_cleanup,
17EVP_PKEY_meth_get_paramgen, EVP_PKEY_meth_get_keygen, EVP_PKEY_meth_get_sign,
18EVP_PKEY_meth_get_verify, EVP_PKEY_meth_get_verify_recover, EVP_PKEY_meth_get_signctx,
19EVP_PKEY_meth_get_verifyctx, EVP_PKEY_meth_get_encrypt, EVP_PKEY_meth_get_decrypt,
20EVP_PKEY_meth_get_derive, EVP_PKEY_meth_get_ctrl,
21EVP_PKEY_meth_get_digestsign, EVP_PKEY_meth_get_digestverify,
22EVP_PKEY_meth_get_check,
23EVP_PKEY_meth_get_public_check, EVP_PKEY_meth_get_param_check,
24EVP_PKEY_meth_get_digest_custom,
25EVP_PKEY_meth_remove
26- manipulating EVP_PKEY_METHOD structure
27
28=head1 SYNOPSIS
29
30 #include <openssl/evp.h>
31
32 typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
33
34 EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags);
35 void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth);
36 void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src);
37 const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type);
38 int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth);
39 int EVP_PKEY_meth_remove(const EVP_PKEY_METHOD *pmeth);
40
41 void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,
42                             int (*init) (EVP_PKEY_CTX *ctx));
43 void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth,
44                             int (*copy) (EVP_PKEY_CTX *dst,
45                                          EVP_PKEY_CTX *src));
46 void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth,
47                                void (*cleanup) (EVP_PKEY_CTX *ctx));
48 void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth,
49                                 int (*paramgen_init) (EVP_PKEY_CTX *ctx),
50                                 int (*paramgen) (EVP_PKEY_CTX *ctx,
51                                                  EVP_PKEY *pkey));
52 void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,
53                               int (*keygen_init) (EVP_PKEY_CTX *ctx),
54                               int (*keygen) (EVP_PKEY_CTX *ctx,
55                                              EVP_PKEY *pkey));
56 void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth,
57                             int (*sign_init) (EVP_PKEY_CTX *ctx),
58                             int (*sign) (EVP_PKEY_CTX *ctx,
59                                          unsigned char *sig, size_t *siglen,
60                                          const unsigned char *tbs,
61                                          size_t tbslen));
62 void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth,
63                               int (*verify_init) (EVP_PKEY_CTX *ctx),
64                               int (*verify) (EVP_PKEY_CTX *ctx,
65                                              const unsigned char *sig,
66                                              size_t siglen,
67                                              const unsigned char *tbs,
68                                              size_t tbslen));
69 void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth,
70                                       int (*verify_recover_init) (EVP_PKEY_CTX
71                                                                   *ctx),
72                                       int (*verify_recover) (EVP_PKEY_CTX
73                                                              *ctx,
74                                                              unsigned char
75                                                              *sig,
76                                                              size_t *siglen,
77                                                              const unsigned
78                                                              char *tbs,
79                                                              size_t tbslen));
80 void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth,
81                                int (*signctx_init) (EVP_PKEY_CTX *ctx,
82                                                     EVP_MD_CTX *mctx),
83                                int (*signctx) (EVP_PKEY_CTX *ctx,
84                                                unsigned char *sig,
85                                                size_t *siglen,
86                                                EVP_MD_CTX *mctx));
87 void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,
88                                  int (*verifyctx_init) (EVP_PKEY_CTX *ctx,
89                                                         EVP_MD_CTX *mctx),
90                                  int (*verifyctx) (EVP_PKEY_CTX *ctx,
91                                                    const unsigned char *sig,
92                                                    int siglen,
93                                                    EVP_MD_CTX *mctx));
94 void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth,
95                                int (*encrypt_init) (EVP_PKEY_CTX *ctx),
96                                int (*encryptfn) (EVP_PKEY_CTX *ctx,
97                                                  unsigned char *out,
98                                                  size_t *outlen,
99                                                  const unsigned char *in,
100                                                  size_t inlen));
101 void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth,
102                                int (*decrypt_init) (EVP_PKEY_CTX *ctx),
103                                int (*decrypt) (EVP_PKEY_CTX *ctx,
104                                                unsigned char *out,
105                                                size_t *outlen,
106                                                const unsigned char *in,
107                                                size_t inlen));
108 void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth,
109                               int (*derive_init) (EVP_PKEY_CTX *ctx),
110                               int (*derive) (EVP_PKEY_CTX *ctx,
111                                              unsigned char *key,
112                                              size_t *keylen));
113 void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth,
114                             int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1,
115                                          void *p2),
116                             int (*ctrl_str) (EVP_PKEY_CTX *ctx,
117                                              const char *type,
118                                              const char *value));
119 void EVP_PKEY_meth_set_digestsign(EVP_PKEY_METHOD *pmeth,
120                                   int (*digestsign) (EVP_MD_CTX *ctx,
121                                                      unsigned char *sig,
122                                                      size_t *siglen,
123                                                      const unsigned char *tbs,
124                                                      size_t tbslen));
125 void EVP_PKEY_meth_set_digestverify(EVP_PKEY_METHOD *pmeth,
126                                     int (*digestverify) (EVP_MD_CTX *ctx,
127                                                          const unsigned char *sig,
128                                                          size_t siglen,
129                                                          const unsigned char *tbs,
130                                                          size_t tbslen));
131 void EVP_PKEY_meth_set_check(EVP_PKEY_METHOD *pmeth,
132                              int (*check) (EVP_PKEY *pkey));
133 void EVP_PKEY_meth_set_public_check(EVP_PKEY_METHOD *pmeth,
134                                     int (*check) (EVP_PKEY *pkey));
135 void EVP_PKEY_meth_set_param_check(EVP_PKEY_METHOD *pmeth,
136                                    int (*check) (EVP_PKEY *pkey));
137 void EVP_PKEY_meth_set_digest_custom(EVP_PKEY_METHOD *pmeth,
138                                     int (*digest_custom) (EVP_PKEY_CTX *ctx,
139                                                           EVP_MD_CTX *mctx));
140
141 void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth,
142                             int (**pinit) (EVP_PKEY_CTX *ctx));
143 void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth,
144                             int (**pcopy) (EVP_PKEY_CTX *dst,
145                                            EVP_PKEY_CTX *src));
146 void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth,
147                                void (**pcleanup) (EVP_PKEY_CTX *ctx));
148 void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth,
149                                 int (**pparamgen_init) (EVP_PKEY_CTX *ctx),
150                                 int (**pparamgen) (EVP_PKEY_CTX *ctx,
151                                                    EVP_PKEY *pkey));
152 void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth,
153                               int (**pkeygen_init) (EVP_PKEY_CTX *ctx),
154                               int (**pkeygen) (EVP_PKEY_CTX *ctx,
155                                                EVP_PKEY *pkey));
156 void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth,
157                             int (**psign_init) (EVP_PKEY_CTX *ctx),
158                             int (**psign) (EVP_PKEY_CTX *ctx,
159                                            unsigned char *sig, size_t *siglen,
160                                            const unsigned char *tbs,
161                                            size_t tbslen));
162 void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth,
163                               int (**pverify_init) (EVP_PKEY_CTX *ctx),
164                               int (**pverify) (EVP_PKEY_CTX *ctx,
165                                                const unsigned char *sig,
166                                                size_t siglen,
167                                                const unsigned char *tbs,
168                                                size_t tbslen));
169 void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth,
170                                       int (**pverify_recover_init) (EVP_PKEY_CTX
171                                                                     *ctx),
172                                       int (**pverify_recover) (EVP_PKEY_CTX
173                                                                *ctx,
174                                                                unsigned char
175                                                                *sig,
176                                                                size_t *siglen,
177                                                                const unsigned
178                                                                char *tbs,
179                                                                size_t tbslen));
180 void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth,
181                                int (**psignctx_init) (EVP_PKEY_CTX *ctx,
182                                                       EVP_MD_CTX *mctx),
183                                int (**psignctx) (EVP_PKEY_CTX *ctx,
184                                                  unsigned char *sig,
185                                                  size_t *siglen,
186                                                  EVP_MD_CTX *mctx));
187 void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth,
188                                  int (**pverifyctx_init) (EVP_PKEY_CTX *ctx,
189                                                           EVP_MD_CTX *mctx),
190                                  int (**pverifyctx) (EVP_PKEY_CTX *ctx,
191                                                      const unsigned char *sig,
192                                                      int siglen,
193                                                      EVP_MD_CTX *mctx));
194 void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth,
195                                int (**pencrypt_init) (EVP_PKEY_CTX *ctx),
196                                int (**pencryptfn) (EVP_PKEY_CTX *ctx,
197                                                    unsigned char *out,
198                                                    size_t *outlen,
199                                                    const unsigned char *in,
200                                                    size_t inlen));
201 void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth,
202                                int (**pdecrypt_init) (EVP_PKEY_CTX *ctx),
203                                int (**pdecrypt) (EVP_PKEY_CTX *ctx,
204                                                  unsigned char *out,
205                                                  size_t *outlen,
206                                                  const unsigned char *in,
207                                                  size_t inlen));
208 void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth,
209                               int (**pderive_init) (EVP_PKEY_CTX *ctx),
210                               int (**pderive) (EVP_PKEY_CTX *ctx,
211                                                unsigned char *key,
212                                                size_t *keylen));
213 void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth,
214                             int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1,
215                                            void *p2),
216                             int (**pctrl_str) (EVP_PKEY_CTX *ctx,
217                                                const char *type,
218                                                const char *value));
219 void EVP_PKEY_meth_get_digestsign(EVP_PKEY_METHOD *pmeth,
220                                   int (**digestsign) (EVP_MD_CTX *ctx,
221                                                       unsigned char *sig,
222                                                       size_t *siglen,
223                                                       const unsigned char *tbs,
224                                                       size_t tbslen));
225 void EVP_PKEY_meth_get_digestverify(EVP_PKEY_METHOD *pmeth,
226                                     int (**digestverify) (EVP_MD_CTX *ctx,
227                                                           const unsigned char *sig,
228                                                           size_t siglen,
229                                                           const unsigned char *tbs,
230                                                           size_t tbslen));
231 void EVP_PKEY_meth_get_check(const EVP_PKEY_METHOD *pmeth,
232                              int (**pcheck) (EVP_PKEY *pkey));
233 void EVP_PKEY_meth_get_public_check(const EVP_PKEY_METHOD *pmeth,
234                                     int (**pcheck) (EVP_PKEY *pkey));
235 void EVP_PKEY_meth_get_param_check(const EVP_PKEY_METHOD *pmeth,
236                                    int (**pcheck) (EVP_PKEY *pkey));
237 void EVP_PKEY_meth_get_digest_custom(EVP_PKEY_METHOD *pmeth,
238                                     int (**pdigest_custom) (EVP_PKEY_CTX *ctx,
239                                                             EVP_MD_CTX *mctx));
240
241=head1 DESCRIPTION
242
243B<EVP_PKEY_METHOD> is a structure which holds a set of methods for a
244specific public key cryptographic algorithm. Those methods are usually
245used to perform different jobs, such as generating a key, signing or
246verifying, encrypting or decrypting, etc.
247
248There are two places where the B<EVP_PKEY_METHOD> objects are stored: one
249is a built-in static array representing the standard methods for different
250algorithms, and the other one is a stack of user-defined application-specific
251methods, which can be manipulated by using L<EVP_PKEY_meth_add0(3)>.
252
253The B<EVP_PKEY_METHOD> objects are usually referenced by B<EVP_PKEY_CTX>
254objects.
255
256=head2 Methods
257
258The methods are the underlying implementations of a particular public key
259algorithm present by the B<EVP_PKEY_CTX> object.
260
261 int (*init) (EVP_PKEY_CTX *ctx);
262 int (*copy) (EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src);
263 void (*cleanup) (EVP_PKEY_CTX *ctx);
264
265The init() method is called to initialize algorithm-specific data when a new
266B<EVP_PKEY_CTX> is created. As opposed to init(), the cleanup() method is called
267when an B<EVP_PKEY_CTX> is freed. The copy() method is called when an B<EVP_PKEY_CTX>
268is being duplicated. Refer to L<EVP_PKEY_CTX_new(3)>, L<EVP_PKEY_CTX_new_id(3)>,
269L<EVP_PKEY_CTX_free(3)> and L<EVP_PKEY_CTX_dup(3)>.
270
271 int (*paramgen_init) (EVP_PKEY_CTX *ctx);
272 int (*paramgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
273
274The paramgen_init() and paramgen() methods deal with key parameter generation.
275They are called by L<EVP_PKEY_paramgen_init(3)> and L<EVP_PKEY_paramgen(3)> to
276handle the parameter generation process.
277
278 int (*keygen_init) (EVP_PKEY_CTX *ctx);
279 int (*keygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey);
280
281The keygen_init() and keygen() methods are used to generate the actual key for
282the specified algorithm. They are called by L<EVP_PKEY_keygen_init(3)> and
283L<EVP_PKEY_keygen(3)>.
284
285 int (*sign_init) (EVP_PKEY_CTX *ctx);
286 int (*sign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
287              const unsigned char *tbs, size_t tbslen);
288
289The sign_init() and sign() methods are used to generate the signature of a
290piece of data using a private key. They are called by L<EVP_PKEY_sign_init(3)>
291and L<EVP_PKEY_sign(3)>.
292
293 int (*verify_init) (EVP_PKEY_CTX *ctx);
294 int (*verify) (EVP_PKEY_CTX *ctx,
295                const unsigned char *sig, size_t siglen,
296                const unsigned char *tbs, size_t tbslen);
297
298The verify_init() and verify() methods are used to verify whether a signature is
299valid. They are called by L<EVP_PKEY_verify_init(3)> and L<EVP_PKEY_verify(3)>.
300
301 int (*verify_recover_init) (EVP_PKEY_CTX *ctx);
302 int (*verify_recover) (EVP_PKEY_CTX *ctx,
303                        unsigned char *rout, size_t *routlen,
304                        const unsigned char *sig, size_t siglen);
305
306The verify_recover_init() and verify_recover() methods are used to verify a
307signature and then recover the digest from the signature (for instance, a
308signature that was generated by RSA signing algorithm). They are called by
309L<EVP_PKEY_verify_recover_init(3)> and L<EVP_PKEY_verify_recover(3)>.
310
311 int (*signctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
312 int (*signctx) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
313                 EVP_MD_CTX *mctx);
314
315The signctx_init() and signctx() methods are used to sign a digest present by
316a B<EVP_MD_CTX> object. They are called by the EVP_DigestSign functions. See
317L<EVP_DigestSignInit(3)> for details.
318
319 int (*verifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
320 int (*verifyctx) (EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen,
321                   EVP_MD_CTX *mctx);
322
323The verifyctx_init() and verifyctx() methods are used to verify a signature
324against the data in a B<EVP_MD_CTX> object. They are called by the various
325EVP_DigestVerify functions. See L<EVP_DigestVerifyInit(3)> for details.
326
327 int (*encrypt_init) (EVP_PKEY_CTX *ctx);
328 int (*encrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
329                 const unsigned char *in, size_t inlen);
330
331The encrypt_init() and encrypt() methods are used to encrypt a piece of data.
332They are called by L<EVP_PKEY_encrypt_init(3)> and L<EVP_PKEY_encrypt(3)>.
333
334 int (*decrypt_init) (EVP_PKEY_CTX *ctx);
335 int (*decrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,
336                 const unsigned char *in, size_t inlen);
337
338The decrypt_init() and decrypt() methods are used to decrypt a piece of data.
339They are called by L<EVP_PKEY_decrypt_init(3)> and L<EVP_PKEY_decrypt(3)>.
340
341 int (*derive_init) (EVP_PKEY_CTX *ctx);
342 int (*derive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
343
344The derive_init() and derive() methods are used to derive the shared secret
345from a public key algorithm (for instance, the DH algorithm). They are called by
346L<EVP_PKEY_derive_init(3)> and L<EVP_PKEY_derive(3)>.
347
348 int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2);
349 int (*ctrl_str) (EVP_PKEY_CTX *ctx, const char *type, const char *value);
350
351The ctrl() and ctrl_str() methods are used to adjust algorithm-specific
352settings. See L<EVP_PKEY_CTX_ctrl(3)> and related functions for details.
353
354 int (*digestsign) (EVP_MD_CTX *ctx, unsigned char *sig, size_t *siglen,
355                    const unsigned char *tbs, size_t tbslen);
356 int (*digestverify) (EVP_MD_CTX *ctx, const unsigned char *sig,
357                      size_t siglen, const unsigned char *tbs,
358                      size_t tbslen);
359
360The digestsign() and digestverify() methods are used to generate or verify
361a signature in a one-shot mode. They could be called by L<EVP_DigestSign(3)>
362and L<EVP_DigestVerify(3)>.
363
364 int (*check) (EVP_PKEY *pkey);
365 int (*public_check) (EVP_PKEY *pkey);
366 int (*param_check) (EVP_PKEY *pkey);
367
368The check(), public_check() and param_check() methods are used to validate a
369key-pair, the public component and parameters respectively for a given B<pkey>.
370They could be called by L<EVP_PKEY_check(3)>, L<EVP_PKEY_public_check(3)> and
371L<EVP_PKEY_param_check(3)> respectively.
372
373 int (*digest_custom) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
374
375The digest_custom() method is used to generate customized digest content before
376the real message is passed to functions like L<EVP_DigestSignUpdate(3)> or
377L<EVP_DigestVerifyInit(3)>. This is usually required by some public key
378signature algorithms like SM2 which requires a hashed prefix to the message to
379be signed. The digest_custom() function will be called by L<EVP_DigestSignInit(3)>
380and L<EVP_DigestVerifyInit(3)>.
381
382=head2 Functions
383
384EVP_PKEY_meth_new() creates and returns a new B<EVP_PKEY_METHOD> object,
385and associates the given B<id> and B<flags>. The following flags are
386supported:
387
388 EVP_PKEY_FLAG_AUTOARGLEN
389 EVP_PKEY_FLAG_SIGCTX_CUSTOM
390
391If an B<EVP_PKEY_METHOD> is set with the B<EVP_PKEY_FLAG_AUTOARGLEN> flag, the
392maximum size of the output buffer will be automatically calculated or checked
393in corresponding EVP methods by the EVP framework. Thus the implementations of
394these methods don't need to care about handling the case of returning output
395buffer size by themselves. For details on the output buffer size, refer to
396L<EVP_PKEY_sign(3)>.
397
398The B<EVP_PKEY_FLAG_SIGCTX_CUSTOM> is used to indicate the signctx() method
399of an B<EVP_PKEY_METHOD> is always called by the EVP framework while doing a
400digest signing operation by calling L<EVP_DigestSignFinal(3)>.
401
402EVP_PKEY_meth_free() frees an existing B<EVP_PKEY_METHOD> pointed by
403B<pmeth>.
404
405EVP_PKEY_meth_copy() copies an B<EVP_PKEY_METHOD> object from B<src>
406to B<dst>.
407
408EVP_PKEY_meth_find() finds an B<EVP_PKEY_METHOD> object with the B<id>.
409This function first searches through the user-defined method objects and
410then the built-in objects.
411
412EVP_PKEY_meth_add0() adds B<pmeth> to the user defined stack of methods.
413
414EVP_PKEY_meth_remove() removes an B<EVP_PKEY_METHOD> object added by
415EVP_PKEY_meth_add0().
416
417The EVP_PKEY_meth_set functions set the corresponding fields of
418B<EVP_PKEY_METHOD> structure with the arguments passed.
419
420The EVP_PKEY_meth_get functions get the corresponding fields of
421B<EVP_PKEY_METHOD> structure to the arguments provided.
422
423=head1 RETURN VALUES
424
425EVP_PKEY_meth_new() returns a pointer to a new B<EVP_PKEY_METHOD>
426object or returns NULL on error.
427
428EVP_PKEY_meth_free() and EVP_PKEY_meth_copy() do not return values.
429
430EVP_PKEY_meth_find() returns a pointer to the found B<EVP_PKEY_METHOD>
431object or returns NULL if not found.
432
433EVP_PKEY_meth_add0() returns 1 if method is added successfully or 0
434if an error occurred.
435
436EVP_PKEY_meth_remove() returns 1 if method is removed successfully or
4370 if an error occurred.
438
439All EVP_PKEY_meth_set and EVP_PKEY_meth_get functions have no return
440values. For the 'get' functions, function pointers are returned by
441arguments.
442
443=head1 COPYRIGHT
444
445Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved.
446
447Licensed under the OpenSSL license (the "License").  You may not use
448this file except in compliance with the License.  You can obtain a copy
449in the file LICENSE in the source distribution or at
450L<https://www.openssl.org/source/license.html>.
451
452=cut
453