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