2
0

EVP_PKEY_meth_new.pod 24 KB

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