]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/PEM_read_CMS.pod
Add migration guide for 3.0
[thirdparty/openssl.git] / doc / man3 / PEM_read_CMS.pod
CommitLineData
12ce9ea2
RS
1=pod
2
3=head1 NAME
4
91da5e77 5DECLARE_PEM_rw,
12ce9ea2
RS
6PEM_read_CMS,
7PEM_read_bio_CMS,
8PEM_write_CMS,
9PEM_write_bio_CMS,
10PEM_write_DHxparams,
11PEM_write_bio_DHxparams,
12PEM_read_ECPKParameters,
13PEM_read_bio_ECPKParameters,
14PEM_write_ECPKParameters,
15PEM_write_bio_ECPKParameters,
16PEM_read_ECPrivateKey,
17PEM_write_ECPrivateKey,
18PEM_write_bio_ECPrivateKey,
19PEM_read_EC_PUBKEY,
20PEM_read_bio_EC_PUBKEY,
21PEM_write_EC_PUBKEY,
22PEM_write_bio_EC_PUBKEY,
23PEM_read_NETSCAPE_CERT_SEQUENCE,
24PEM_read_bio_NETSCAPE_CERT_SEQUENCE,
25PEM_write_NETSCAPE_CERT_SEQUENCE,
26PEM_write_bio_NETSCAPE_CERT_SEQUENCE,
27PEM_read_PKCS8,
28PEM_read_bio_PKCS8,
29PEM_write_PKCS8,
30PEM_write_bio_PKCS8,
31PEM_write_PKCS8_PRIV_KEY_INFO,
32PEM_read_bio_PKCS8_PRIV_KEY_INFO,
33PEM_read_PKCS8_PRIV_KEY_INFO,
34PEM_write_bio_PKCS8_PRIV_KEY_INFO,
35PEM_read_SSL_SESSION,
36PEM_read_bio_SSL_SESSION,
37PEM_write_SSL_SESSION,
cb58d81e
RL
38PEM_write_bio_SSL_SESSION,
39PEM_read_X509_PUBKEY,
40PEM_read_bio_X509_PUBKEY,
41PEM_write_X509_PUBKEY,
42PEM_write_bio_X509_PUBKEY
12ce9ea2
RS
43- PEM object encoding routines
44
12ce9ea2
RS
45=head1 SYNOPSIS
46
bb82531f 47=for openssl generic
b97fdb57 48
12ce9ea2
RS
49 #include <openssl/pem.h>
50
91da5e77 51 DECLARE_PEM_rw(name, TYPE)
12ce9ea2
RS
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
e52b4215
SL
58Deprecated since OpenSSL 3.0, can be hidden entirely by defining
59B<OPENSSL_API_COMPAT> with a suitable version value, see
60L<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
12ce9ea2
RS
85=head1 DESCRIPTION
86
e52b4215 87All of the functions described on this page are deprecated.
b7140b06 88Applications should use OSSL_ENCODER_to_bio() and OSSL_DECODER_from_bio()
e52b4215
SL
89instead.
90
bbecf04e
RL
91In the description below, B<I<TYPE>> is used
92as a placeholder for any of the OpenSSL datatypes, such as B<X509>.
91da5e77
RS
93The macro B<DECLARE_PEM_rw> expands to the set of declarations shown in
94the next four lines of the synopsis.
12ce9ea2
RS
95
96These routines convert between local instances of ASN1 datatypes and
97the PEM encoding. For more information on the templates, see
98L<ASN1_ITEM(3)>. For more information on the lower-level routines used
99by the functions here, see L<PEM_read(3)>.
100
bbecf04e
RL
101B<PEM_read_I<TYPE>>() reads a PEM-encoded object of B<I<TYPE>> from the file
102I<fp> and returns it. The I<cb> and I<u> parameters are as described in
12ce9ea2
RS
103L<pem_password_cb(3)>.
104
bbecf04e
RL
105B<PEM_read_bio_I<TYPE>>() is similar to B<PEM_read_I<TYPE>>() but reads from
106the BIO I<bp>.
12ce9ea2 107
bbecf04e
RL
108B<PEM_write_I<TYPE>>() writes the PEM encoding of the object I<a> to the file
109I<fp>.
12ce9ea2 110
bbecf04e 111B<PEM_write_bio_I<TYPE>>() similarly writes to the BIO I<bp>.
12ce9ea2 112
84814344
RL
113=head1 NOTES
114
115These functions make no assumption regarding the pass phrase received from the
116password callback.
117It will simply be treated as a byte sequence.
118
12ce9ea2
RS
119=head1 RETURN VALUES
120
bbecf04e
RL
121B<PEM_read_I<TYPE>>() and B<PEM_read_bio_I<TYPE>>() return a pointer to an
122allocated object, which should be released by calling B<I<TYPE>_free>(), or
123NULL on error.
12ce9ea2 124
bbecf04e
RL
125B<PEM_write_I<TYPE>>() and B<PEM_write_bio_I<TYPE>>() return the number of bytes
126written or zero on error.
12ce9ea2
RS
127
128=head1 SEE ALSO
129
84814344
RL
130L<PEM_read(3)>,
131L<passphrase-encoding(7)>
12ce9ea2 132
e52b4215
SL
133=head1 HISTORY
134
135The functions PEM_write_DHxparams(), PEM_write_bio_DHxparams(),
136PEM_read_ECPKParameters(), PEM_read_bio_ECPKParameters(),
137PEM_write_ECPKParameters(), PEM_write_bio_ECPKParameters(),
138PEM_read_EC_PUBKEY(), PEM_read_bio_EC_PUBKEY(),
139PEM_write_EC_PUBKEY(), PEM_write_bio_EC_PUBKEY(),
140PEM_read_ECPrivateKey(), PEM_read_bio_ECPrivateKey(),
141PEM_write_ECPrivateKey() and PEM_write_bio_ECPrivateKey()
142were deprecated in OpenSSL 3.0.
143
12ce9ea2
RS
144=head1 COPYRIGHT
145
e52b4215 146Copyright 1998-2021 The OpenSSL Project Authors. All Rights Reserved.
12ce9ea2 147
4746f25a 148Licensed under the Apache License 2.0 (the "License"). You may not use
12ce9ea2
RS
149this file except in compliance with the License. You can obtain a copy
150in the file LICENSE in the source distribution or at
151L<https://www.openssl.org/source/license.html>.
152
153=cut