21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LjKQ2r1Yt9foxbHdLKZeClqZuzN7PoEmy+b+dKq9qibaH4pRcwATuWt4/Jzl6y85<br />

NHM6CM4bOV1MHkyD01tFsT4kJ0GwRPg4tKAiTNjE4Yrz9V3rESiQKridtXMOToEp<br />

Mj2nSvVKRSNEeG33GNIYUeMfSSc3oTmZVOlHNp9f8LEYWNmIjfzlHExvgJaPrixX<br />

QiPGJ6K05kV5FJWRPET9vI+kyouAm6DBcyAhmR80NYRvaBbXGM/MxBgQ7koFVaI5<br />

zoJ/NBdEIMdHNUh0h11GQCXAQXOSL6Fx2hRdcicm6j1CPd3AFrTt9EATmd4Hj+D4<br />

91jDYXElALfdSbiO0A9Mz6USUepTXwlfVV/cbBpLRz5Rqnyg2EwI2tZRU+E+Cusb<br />

/b6hcuWyzva895YMUCSyDaLgSsIqRWmXxQV1W2bAgRbs8jD8VF+G9w= =<br />

-----END RSA PRIVATE KEY-----<br />

The first line is as discussed at the beginning of this section. Table 7-4 lists the most<br />

useful values for the data type specified in the first and last line. Other values can be<br />

found in openssl/pem.h.<br />

Table 7-4. PEM header types<br />

Name Comments<br />

RSA PUBLIC KEY ––<br />

RSA PRIVATE KEY ––<br />

DSA PUBLIC KEY ––<br />

DSA PRIVATE KEY ––<br />

DH PARAMETERS Parameters for Diffie-Hellman key exchange<br />

CERTIFICATE An X.509 digital certificate<br />

TRUSTED CERTIFICATE A fully trusted X.509 digital certificate<br />

CERTIFICATE REQUEST A PKCS #10 certificate signing request<br />

X509 CRL An X.509 certificate revocation list<br />

SSL SESSION PARAMETERS ––<br />

The header line is followed by three lines that look like MIME headers. Do not treat<br />

them as MIME headers, though. Yes, the base64-encrypted text is separated from the<br />

header information by a line with nothing on it (two CRLFs). However, you should<br />

assume that there is no real flexibility in the headers. You should have either the two<br />

headers that are there, or nothing (and if you’re not including headers, be sure to<br />

remove the blank line). In addition, the headers should be in the order shown above,<br />

and they should have the same comma-separated fields.<br />

As far as we can determine, the second line must appear exactly as shown above for<br />

OpenSSLcompatibility. There’s some logic in OpenSSLto handle two other options<br />

that would add an integrity-checking value to the data being encoded, but it appears<br />

that the OpenSSLteam never actually finished a full implementation, so these other<br />

options aren’t used (it’s left over from a time when the OpenSSLimplementers were<br />

concerned about compliance with the original PEM RFCs). The first parameter on<br />

the “DEK-Info” line (where DEK stands for “data encrypting key”) contains an<br />

ASCII representation of the algorithm used for encryption, which should always be a<br />

CBC-based mode. Table 7-5 lists the identifiers OpenSSL currently supports.<br />

Representing Keys and Certificates in Plaintext (PEM Encoding) | 357<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!