vincenthz/hs-certificate — pull request #6 by rekado (2012-04-21 10:49:39+00:00)
Title: add function to decode public keys

Hi,

I added a function to decode public keys from files that only contain public keys. Such public key files can be generated from a private key file with `openssl rsa -in rsa.pem -out rsapub.pem -pubout`.

The format is SEQUENCE SEQUENCE OBJECT NULL BITSTRING, where yet another SEQUENCE INTEGER INTEGER is contained in the ASN1 stream inside the BITSTRING. That's why the pattern matching is done in two steps.