]>
Commit | Line | Data |
---|---|---|
12ce9ea2 RS |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
91da5e77 | 5 | DECLARE_PEM_rw, |
12ce9ea2 RS |
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, | |
cb58d81e RL |
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 | |
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 | ||
58 | =head1 DESCRIPTION | |
59 | ||
bbecf04e RL |
60 | In the description below, B<I<TYPE>> is used |
61 | as a placeholder for any of the OpenSSL datatypes, such as B<X509>. | |
91da5e77 RS |
62 | The macro B<DECLARE_PEM_rw> expands to the set of declarations shown in |
63 | the next four lines of the synopsis. | |
12ce9ea2 RS |
64 | |
65 | These routines convert between local instances of ASN1 datatypes and | |
66 | the PEM encoding. For more information on the templates, see | |
67 | L<ASN1_ITEM(3)>. For more information on the lower-level routines used | |
68 | by the functions here, see L<PEM_read(3)>. | |
69 | ||
bbecf04e RL |
70 | B<PEM_read_I<TYPE>>() reads a PEM-encoded object of B<I<TYPE>> from the file |
71 | I<fp> and returns it. The I<cb> and I<u> parameters are as described in | |
12ce9ea2 RS |
72 | L<pem_password_cb(3)>. |
73 | ||
bbecf04e RL |
74 | B<PEM_read_bio_I<TYPE>>() is similar to B<PEM_read_I<TYPE>>() but reads from |
75 | the BIO I<bp>. | |
12ce9ea2 | 76 | |
bbecf04e RL |
77 | B<PEM_write_I<TYPE>>() writes the PEM encoding of the object I<a> to the file |
78 | I<fp>. | |
12ce9ea2 | 79 | |
bbecf04e | 80 | B<PEM_write_bio_I<TYPE>>() similarly writes to the BIO I<bp>. |
12ce9ea2 | 81 | |
84814344 RL |
82 | =head1 NOTES |
83 | ||
84 | These functions make no assumption regarding the pass phrase received from the | |
85 | password callback. | |
86 | It will simply be treated as a byte sequence. | |
87 | ||
12ce9ea2 RS |
88 | =head1 RETURN VALUES |
89 | ||
bbecf04e RL |
90 | B<PEM_read_I<TYPE>>() and B<PEM_read_bio_I<TYPE>>() return a pointer to an |
91 | allocated object, which should be released by calling B<I<TYPE>_free>(), or | |
92 | NULL on error. | |
12ce9ea2 | 93 | |
bbecf04e RL |
94 | B<PEM_write_I<TYPE>>() and B<PEM_write_bio_I<TYPE>>() return the number of bytes |
95 | written or zero on error. | |
12ce9ea2 RS |
96 | |
97 | =head1 SEE ALSO | |
98 | ||
84814344 RL |
99 | L<PEM_read(3)>, |
100 | L<passphrase-encoding(7)> | |
12ce9ea2 RS |
101 | |
102 | =head1 COPYRIGHT | |
103 | ||
83cf7abf | 104 | Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved. |
12ce9ea2 | 105 | |
4746f25a | 106 | Licensed under the Apache License 2.0 (the "License"). You may not use |
12ce9ea2 RS |
107 | this file except in compliance with the License. You can obtain a copy |
108 | in the file LICENSE in the source distribution or at | |
109 | L<https://www.openssl.org/source/license.html>. | |
110 | ||
111 | =cut |