PEM_read_CMS.pod 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. =pod
  2. =head1 NAME
  3. DECLARE_PEM_rw,
  4. PEM_read_CMS,
  5. PEM_read_bio_CMS,
  6. PEM_write_CMS,
  7. PEM_write_bio_CMS,
  8. PEM_write_DHxparams,
  9. PEM_write_bio_DHxparams,
  10. PEM_read_ECPKParameters,
  11. PEM_read_bio_ECPKParameters,
  12. PEM_write_ECPKParameters,
  13. PEM_write_bio_ECPKParameters,
  14. PEM_read_ECPrivateKey,
  15. PEM_write_ECPrivateKey,
  16. PEM_write_bio_ECPrivateKey,
  17. PEM_read_EC_PUBKEY,
  18. PEM_read_bio_EC_PUBKEY,
  19. PEM_write_EC_PUBKEY,
  20. PEM_write_bio_EC_PUBKEY,
  21. PEM_read_NETSCAPE_CERT_SEQUENCE,
  22. PEM_read_bio_NETSCAPE_CERT_SEQUENCE,
  23. PEM_write_NETSCAPE_CERT_SEQUENCE,
  24. PEM_write_bio_NETSCAPE_CERT_SEQUENCE,
  25. PEM_read_PKCS8,
  26. PEM_read_bio_PKCS8,
  27. PEM_write_PKCS8,
  28. PEM_write_bio_PKCS8,
  29. PEM_write_PKCS8_PRIV_KEY_INFO,
  30. PEM_read_bio_PKCS8_PRIV_KEY_INFO,
  31. PEM_read_PKCS8_PRIV_KEY_INFO,
  32. PEM_write_bio_PKCS8_PRIV_KEY_INFO,
  33. PEM_read_SSL_SESSION,
  34. PEM_read_bio_SSL_SESSION,
  35. PEM_write_SSL_SESSION,
  36. PEM_write_bio_SSL_SESSION,
  37. PEM_read_X509_PUBKEY,
  38. PEM_read_bio_X509_PUBKEY,
  39. PEM_write_X509_PUBKEY,
  40. PEM_write_bio_X509_PUBKEY
  41. - PEM object encoding routines
  42. =head1 SYNOPSIS
  43. =for openssl generic
  44. #include <openssl/pem.h>
  45. DECLARE_PEM_rw(name, TYPE)
  46. TYPE *PEM_read_TYPE(FILE *fp, TYPE **a, pem_password_cb *cb, void *u);
  47. TYPE *PEM_read_bio_TYPE(BIO *bp, TYPE **a, pem_password_cb *cb, void *u);
  48. int PEM_write_TYPE(FILE *fp, const TYPE *a);
  49. int PEM_write_bio_TYPE(BIO *bp, const TYPE *a);
  50. The following functions have been deprecated since OpenSSL 3.0, and can be
  51. hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
  52. see L<openssl_user_macros(7)>:
  53. #include <openssl/pem.h>
  54. int PEM_write_DHxparams(FILE *out, const DH *dh);
  55. int PEM_write_bio_DHxparams(BIO *out, const DH *dh);
  56. EC_GROUP *PEM_read_ECPKParameters(FILE *fp, EC_GROUP **x, pem_password_cb *cb, void *u);
  57. EC_GROUP *PEM_read_bio_ECPKParameters(BIO *bp, EC_GROUP **x, pem_password_cb *cb, void *u);
  58. int PEM_write_ECPKParameters(FILE *out, const EC_GROUP *x);
  59. int PEM_write_bio_ECPKParameters(BIO *out, const EC_GROUP *x),
  60. EC_KEY *PEM_read_EC_PUBKEY(FILE *fp, EC_KEY **x, pem_password_cb *cb, void *u);
  61. EC_KEY *PEM_read_bio_EC_PUBKEY(BIO *bp, EC_KEY **x, pem_password_cb *cb, void *u);
  62. int PEM_write_EC_PUBKEY(FILE *out, const EC_KEY *x);
  63. int PEM_write_bio_EC_PUBKEY(BIO *out, const EC_KEY *x);
  64. EC_KEY *PEM_read_ECPrivateKey(FILE *out, EC_KEY **x, pem_password_cb *cb, void *u);
  65. EC_KEY *PEM_read_bio_ECPrivateKey(BIO *out, EC_KEY **x, pem_password_cb *cb, void *u);
  66. int PEM_write_ECPrivateKey(FILE *out, const EC_KEY *x, const EVP_CIPHER *enc,
  67. const unsigned char *kstr, int klen,
  68. pem_password_cb *cb, void *u);
  69. int PEM_write_bio_ECPrivateKey(BIO *out, const EC_KEY *x, const EVP_CIPHER *enc,
  70. const unsigned char *kstr, int klen,
  71. pem_password_cb *cb, void *u);
  72. =head1 DESCRIPTION
  73. All of the functions described on this page are deprecated.
  74. Applications should use OSSL_ENCODER_to_bio() and OSSL_DECODER_from_bio()
  75. instead.
  76. In the description below, B<I<TYPE>> is used
  77. as a placeholder for any of the OpenSSL datatypes, such as B<X509>.
  78. The macro B<DECLARE_PEM_rw> expands to the set of declarations shown in
  79. the next four lines of the synopsis.
  80. These routines convert between local instances of ASN1 datatypes and
  81. the PEM encoding. For more information on the templates, see
  82. L<ASN1_ITEM(3)>. For more information on the lower-level routines used
  83. by the functions here, see L<PEM_read(3)>.
  84. B<PEM_read_I<TYPE>>() reads a PEM-encoded object of B<I<TYPE>> from the file
  85. I<fp> and returns it. The I<cb> and I<u> parameters are as described in
  86. L<pem_password_cb(3)>.
  87. B<PEM_read_bio_I<TYPE>>() is similar to B<PEM_read_I<TYPE>>() but reads from
  88. the BIO I<bp>.
  89. B<PEM_write_I<TYPE>>() writes the PEM encoding of the object I<a> to the file
  90. I<fp>.
  91. B<PEM_write_bio_I<TYPE>>() similarly writes to the BIO I<bp>.
  92. =head1 NOTES
  93. These functions make no assumption regarding the pass phrase received from the
  94. password callback.
  95. It will simply be treated as a byte sequence.
  96. =head1 RETURN VALUES
  97. B<PEM_read_I<TYPE>>() and B<PEM_read_bio_I<TYPE>>() return a pointer to an
  98. allocated object, which should be released by calling B<I<TYPE>_free>(), or
  99. NULL on error.
  100. B<PEM_write_I<TYPE>>() and B<PEM_write_bio_I<TYPE>>() return 1 for success or 0 for failure.
  101. =head1 SEE ALSO
  102. L<PEM_read(3)>,
  103. L<passphrase-encoding(7)>
  104. =head1 HISTORY
  105. The functions PEM_write_DHxparams(), PEM_write_bio_DHxparams(),
  106. PEM_read_ECPKParameters(), PEM_read_bio_ECPKParameters(),
  107. PEM_write_ECPKParameters(), PEM_write_bio_ECPKParameters(),
  108. PEM_read_EC_PUBKEY(), PEM_read_bio_EC_PUBKEY(),
  109. PEM_write_EC_PUBKEY(), PEM_write_bio_EC_PUBKEY(),
  110. PEM_read_ECPrivateKey(), PEM_read_bio_ECPrivateKey(),
  111. PEM_write_ECPrivateKey() and PEM_write_bio_ECPrivateKey()
  112. were deprecated in OpenSSL 3.0.
  113. =head1 COPYRIGHT
  114. Copyright 1998-2023 The OpenSSL Project Authors. All Rights Reserved.
  115. Licensed under the Apache License 2.0 (the "License"). You may not use
  116. this file except in compliance with the License. You can obtain a copy
  117. in the file LICENSE in the source distribution or at
  118. L<https://www.openssl.org/source/license.html>.
  119. =cut