d2i_PKCS8PrivateKey_bio.pod 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. =pod
  2. =head1 NAME
  3. d2i_PKCS8PrivateKey_bio, d2i_PKCS8PrivateKey_fp,
  4. i2d_PKCS8PrivateKey_bio, i2d_PKCS8PrivateKey_fp,
  5. i2d_PKCS8PrivateKey_nid_bio, i2d_PKCS8PrivateKey_nid_fp - PKCS#8 format private key functions
  6. =head1 SYNOPSIS
  7. #include <openssl/evp.h>
  8. EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u);
  9. EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u);
  10. int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
  11. char *kstr, int klen,
  12. pem_password_cb *cb, void *u);
  13. int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
  14. char *kstr, int klen,
  15. pem_password_cb *cb, void *u);
  16. int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid,
  17. char *kstr, int klen,
  18. pem_password_cb *cb, void *u);
  19. int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid,
  20. char *kstr, int klen,
  21. pem_password_cb *cb, void *u);
  22. =head1 DESCRIPTION
  23. The PKCS#8 functions encode and decode private keys in PKCS#8 format using both
  24. PKCS#5 v1.5 and PKCS#5 v2.0 password based encryption algorithms.
  25. Other than the use of DER as opposed to PEM these functions are identical to the
  26. corresponding B<PEM> function as described in L<PEM_read_PrivateKey(3)>.
  27. =head1 NOTES
  28. These functions are currently the only way to store encrypted private keys using DER format.
  29. Currently all the functions use BIOs or FILE pointers, there are no functions which
  30. work directly on memory: this can be readily worked around by converting the buffers
  31. to memory BIOs, see L<BIO_s_mem(3)> for details.
  32. =head1 RETURN VALUES
  33. d2i_PKCS8PrivateKey_bio() and d2i_PKCS8PrivateKey_fp() return a valid B<EVP_PKEY>
  34. structure or NULL if an error occurred.
  35. i2d_PKCS8PrivateKey_bio(), i2d_PKCS8PrivateKey_fp(), i2d_PKCS8PrivateKey_nid_bio()
  36. and i2d_PKCS8PrivateKey_nid_fp() return 1 on success or 0 on error.
  37. =head1 SEE ALSO
  38. L<PEM_read_PrivateKey(3)>
  39. =head1 COPYRIGHT
  40. Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
  41. Licensed under the OpenSSL license (the "License"). You may not use
  42. this file except in compliance with the License. You can obtain a copy
  43. in the file LICENSE in the source distribution or at
  44. L<https://www.openssl.org/source/license.html>.
  45. =cut