d2i_PKCS8PrivateKey_bio.pod 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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, const 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, const 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, const 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, const 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. These functions make no assumption regarding the pass phrase received from the
  33. password callback.
  34. It will simply be treated as a byte sequence.
  35. =head1 RETURN VALUES
  36. d2i_PKCS8PrivateKey_bio() and d2i_PKCS8PrivateKey_fp() return a valid B<EVP_PKEY>
  37. structure or NULL if an error occurred.
  38. i2d_PKCS8PrivateKey_bio(), i2d_PKCS8PrivateKey_fp(), i2d_PKCS8PrivateKey_nid_bio()
  39. and i2d_PKCS8PrivateKey_nid_fp() return 1 on success or 0 on error.
  40. =head1 SEE ALSO
  41. L<PEM_read_PrivateKey(3)>,
  42. L<passphrase-encoding(7)>
  43. =head1 COPYRIGHT
  44. Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
  45. Licensed under the Apache License 2.0 (the "License"). You may not use
  46. this file except in compliance with the License. You can obtain a copy
  47. in the file LICENSE in the source distribution or at
  48. L<https://www.openssl.org/source/license.html>.
  49. =cut