EVP_PKEY2PKCS8.pod 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY2PKCS8, EVP_PKCS82PKEY_ex, EVP_PKCS82PKEY
  4. - Convert a private key to/from PKCS8
  5. =head1 SYNOPSIS
  6. #include <openssl/x509.h>
  7. PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey);
  8. EVP_PKEY *EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *p8);
  9. EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx,
  10. const char *propq);
  11. =head1 DESCRIPTION
  12. EVP_PKEY2PKCS8() converts a private key I<pkey> into a returned PKCS8 object.
  13. EVP_PKCS82PKEY_ex() converts a PKCS8 object I<p8> into a returned private key.
  14. It uses I<libctx> and I<propq> when fetching algorithms.
  15. EVP_PKCS82PKEY() is similiar to EVP_PKCS82PKEY_ex() but uses default values of
  16. NULL for the I<libctx> and I<propq>.
  17. =head1 RETURN VALUES
  18. EVP_PKEY2PKCS8() returns a PKCS8 object on success.
  19. EVP_PKCS82PKEY() and EVP_PKCS82PKEY_ex() return a private key on success.
  20. All functions return NULL if the operation fails.
  21. =head1 SEE ALSO
  22. L<PKCS8_pkey_add1_attr(3)>,
  23. =head1 COPYRIGHT
  24. Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
  25. Licensed under the Apache License 2.0 (the "License"). You may not use
  26. this file except in compliance with the License. You can obtain a copy
  27. in the file LICENSE in the source distribution or at
  28. L<https://www.openssl.org/source/license.html>.
  29. =cut