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