views:

690

answers:

2

I want to use Perl to extract information from a Certificate Signing Request, preferably without launching an external openssl process. Since a CSR is stored in a base64-encoded ASN.1 format, I tried the Convert::PEM module. But it requires an ASN.1 description of the content, which I haven't been able to put together (ASN.1 being the beast it is).

Does anybody have the right ASN.1 description for a CSR or a module that parses such a request ?

+3  A: 

Your real question is what format are CSRs using? There are two formats to do it, PKCS #10 and SPKAC. The former is described in RFC 2986. I don't know where the latter is described.

Leon Timmermans
I'll probably need to support both formats since the CSRs will be generated by third parties. Thanks for the pointer to RFC2986, I'll try to put together an ASN.1 description based on it.
kixx
+5  A: 

Maybe Convert::X509 can help you. See also Convert::X509::Parser.

maletin