Reading a Key from a Certificate


The following is a simple program that reads and decodes a certificate file so that you can access the certificate's public key. Note that the Certificate type uses the any interface as the type for the PublicKey field; in a real program, you would eventually use a type assertion to access the underlying concrete type (e.g., *rsa.PublicKey).

The complete source is available as a zip file.

main.go