EVP_PKEY_meth_new.pod 22 KB

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