21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table 7-6 lists the FILE object-based functions for the most useful PEM-encoding<br />

variants. * The BIO object-based functions can be derived by adding _bio_ after read or<br />

write.<br />

Table 7-6. FILE object-based functions for PEM encoding<br />

FILE object-based encoding<br />

FILE object-based decoding<br />

Kind of object Object type<br />

function<br />

function<br />

RSA public key RSA PEM_write_RSAPublicKey() PEM_read_RSAPublicKey()<br />

RSA private key RSA PEM_write_RSAPrivateKey() PEM_read_RSAPrivateKey()<br />

Diffie-Hellman<br />

parameters<br />

DH PEM_write_DHparams() PEM_read_DHparams()<br />

DSA parameters DSA PEM_write_DSAparams() PEM_read_DSAparams()<br />

DSA public key DSA PEM_write_DSA_PUBKEY() PEM_read_DSA_PUBKEY()<br />

DSA private key DSA PEM_write_DSAPrivateKey() PEM_read_DSAPrivateKey()<br />

X.509 certificate X509 PEM_write_X509() PEM_read_X509()<br />

X.509 CRL X509_CRL PEM_write_X509_CRL() PEM_read_X509_CRL()<br />

PKCS #10 certificate<br />

signing request<br />

X509_REQ PEM_write_X509_REQ() PEM_read_X509_REQ()<br />

PKCS #7 container PKCS7 PEM_write_PKCS7() PEM_read_PKCS7()<br />

The last two rows enumerate calls that are intended for people implementing actual<br />

infrastructure for a PKI, and they will not generally be of interest to the average<br />

developer applying cryptography. †<br />

See Also<br />

Recipes 4.5, 4.6, 4.10, 5.17, 7.16<br />

* The remainder can be found by looking for uses of the IMPLEMENT_PEM_rw macro in the OpenSSL crypto/pem<br />

source directory.<br />

† PKCS #7 can be used to store multiple certificates in one data object, however, which may be appealing to<br />

some, instead of DER-encoding multiple X.509 objects separately.<br />

Representing Keys and Certificates in Plaintext (PEM Encoding) | 361<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!