Hi eveyone: let's see if someone can help me ;) I'm quite noob at this field so please be gentle. At my job someone passed me a CSR. This CSR is a PKCS#10 request enveloped in a PKC#7 request. My task is to extract this PKCS#10 request. I found this page "CSR analysis failed". I read the paragraph named as "Convert the renewal request generated by IIS7 Certificate Request #PKCS7 - DER to CSR in #PKCS10 format - PEM" It tells you how to do it.
I did it as they explain but after running last command (with my own names):
openssl req -inform der -in csr.der -out mynewcsr.csr
I got this error:
unable to load X509 request 9288:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:.\crypto\asn1\tasn_dec.c:1198: 9288:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:372:Type=X509_REQ_INFO 9288:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:.\crypto\asn1\tasn_dec.c:694:Field=req_info, Type=X509_REQ
I've been researching and it seems to be a format error. Some of the files (the initial file.csr one or the intermediates csr.der one) must be in an invalid format so one of the commands I used cannot process it.
I'm sure that the string parsed from the pkcs#7 in format ASN1 is the correct one.
I cannot show you the original one, but it is Base64 encoded and begins and ends with:
-----BEGIN CERTIFICATE REQUEST----- (...) -----END CERTIFICATE REQUEST-----
Thanks in advance.
PS: Now I'm leaving the office. I'll check possible answers tomorrow morning really early.