I do not agree with the given answer. In order to understand certificates, you have to understand the infrastructure behind it (called PKI, Public Key Infrastructure). That means you have to read some material about first
- How does public key crypto work (in general)
- Why are PKI s needed
- What is a certificate and why do we need it
Programming this stuff doesn t make sense if you dont know the concepts behind it.
You compare it to encryption/decryption. Both are blackboxes where the user does not need to know how it works (internally) in order to use it.
However, certificates and PKIs are different. in order to be able to user them in a practical and mostly secure way, you need to first grasp the concepts (by reading, but dont be afraid reading a few wiki pages and asking a few questions here will get you more than halfway) before you can program it.
edit after comment:
Yes, toy programs are always nice to grasp the concept in practice. What comes to mind:
- Do a public key encrypt/decrypt (basic)
- Do signature/check signature (i know it is the same as the previous one, but it is principally different) (basic)
- Try to connect to a server and do the SSL handshake yourself (advanced)
- Try to connect to a server, fetch the certificate and check the validity through the whole certificate chain (moderate)
- Try to create your own self-signed certificates (moderate)
- Try to use other encryption algorithms besides RSA, try DSA, El-Gamal, Elliptic Curves Crypto (moderate)
- Implement a diffie-hellman keyexchange algorithm (advanced)
And once you re done with these i think you ll quite a reasonable understanding of the whole thing.
If you re still curious, you can always dive into the more advanced stuff like the math, like how you cheat, algorithm correctness proofs etc.
Btw, i just stumbled over a recent discovery concerning SSL/TLS and since you re working on that subject, perhaps you ll like to read this small article:
http://blog.ivanristic.com/2009/11/ssl-and-tls-authentication-gap-vulnerability-discovered.html