=head1 NAME Crypt::OpenSSL::CA::Resources - A bibliography of documentations and tools that I found helpful for implementing X509 PKIs in Perl over all these years. =head1 TUTORIALS For a tutorial introduction to the concepts of PKI and X509, please refer to the appropriate Wikipedia articles (in particular L and L). Have some giggles while uncovering the bleak truth about the state of affairs in PKI-world with Peter Gutmann's crypto tutorials at L, and especially the one that deals with X509 PKI at L. =head1 ALPHABET SOUP See L =head1 IMPLEMENTATION GUIDELINES =head2 X509 Style Guide The X509 Style Guide, also by Peter Gutmann (http://www.cs.auckland.ac.nz/~pgut001/pubs/x509guide.txt), although partly outdated (e.g. as regards Unicode support) is the single most helpful resource one needs to develop and deploy a full-fledged X509 PKI. =head1 SOFTWARE =head2 IDX-PKI A working, rugged implementation of L that is GPL-licenced and covers all the bases, despite its being restricted from the "commercial" version. Definitely a reference implementation in the field (I know, since I helped write it!). L =head2 OpenSSL The venerable, feature-rich but quirky and poorly documented cryptographic library that I is built upon. Available on L (and also on L, of course). =head3 /usr/bin/openssl Of special interest is the C command-line tool, that serves as a Swiss army knife of crypto debugging from making and parsing certificates to debugging SSL. Actually C is powerful enough to serve as the sole foundation for a full-fledged PKI; this is almost what L does, but it B quirky (and therefore I departs from that idea). Here are a few tricks that I know by heart from typing them so often: =over =item B openssl x509 -noout -text -in cert.pem or at an even lower level, using L: openssl x509 -outform der -in cert.pem | dumpasn1 - =item B If both match, then the private key and certificate correspond to each other. openssl x509 -noout -modulus -in cert.pem openssl rsa -noout -modulus -in key.pem =item B openssl req -x509 -nodes -new -newkey 1024 -keyout key.pem -out cert.pem The resulting C and C files can be used directly for a network server, or to build a toy CA. =item B Under distros that sport a cooperative C: this was tested on Ubuntu Edgy, your mileage may vary. =over =item 1. create a test directory and chdir into it =item 2. create subdirectories C and C; put the string C<01> into C; create an empty C file. =item 3. create a key and a self-signed certificate for the CA as explained above, and save them respectively as C and C. =item 4. create a certificate request using C =item 5. run openssl ca -subj "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=test" \ -in user.req =item 6. Rinse and repeat, tweaking the command line and the contents of the C<./demoCA> subdirectory until openssl is satisfied. Read the I man page to interpret and resolve the error messages. =item 7. Your certificate should appear in C<./demoCA/newcerts> after a finite time (and tearing out only a minority subset of your hair). =item 8. For advanced usage, copy over the default C file (usually to be found in C, C or C) into C and tack a C<-config ./openssl.cnf> onto the C command line. Then you can start mucking with X509 extensions and so on. =back =back =head3 Source code Any serious work towards contributing to L requires promiscuity with OpenSSL's code base. I suggest reading and understanding C and C first, comparing and contrasting with the XS code in I which does roughly the same thing in a simpler and more modular way. Seasoned programmers will find the OpenSSL man pages of some limited help, and the command C to come in handy more often than not. =head3 C There is a succint overview of OpenSSL's whole API in a file named C, to be found either in OpenSSL's source or possibly in the documentation directory of your distribution's openssl package (YMMV). =head2 dumpasn1 A tool to debug L data structures, more fault-tolerant than the C command (see L). Available on L and as a Debian package. =head1 INTERNET SITES =head2 Peter Gutmann's site L contains more crypto- and security-related stuff, and is always a pleasure to waste office time reading from. =head2 alvestrand.no =head2 oid.elibel.tm.fr L and L are both databases of Ls that together contain pretty much all OIDs known to mankind. The latter sports a search engine. =head1 STANDARDS The RFCs and other standards describing PKIX (the X509 PKI) are, in suggested reading order: =over =item B Basics, security model, definition of the entities (EE, RA, CA), format of messages between these entities (that nobody in his right mind would bother to implement in this contrived way). =item B Distinguished Names (L) =item B Certificate and CRL formats, extensions in certificates, certificate validation algorithm. =item B How one should set the C bits in an X509 certificate. =item B Certificate request file format - One of the most popular ones (the great thing about standards, as the saying goes, is that there are so many to choose from...) =item B The other certificate request file format of importance to an Internet PKIX deployment (L). Used by all browsers of the Netscape family. =item L The specification of the Netscape certificate type X509v3 extension. Mostly obsolete, but it does make your certificates all that more christmas-treeish. =item B A transport and backup format for X509 key material. Allows for bundling a user's certificate, its matching private key (password-protected), and the chain of CA certificates and CRLs that certify the user's certificate, all into a single binary blob. =item B L =item B Qualified certificates. =back