Discussion:
error "unable to load PKCS7 object... wrong tag"
(too old to reply)
likejiujitsu
2013-07-17 16:51:45 UTC
Permalink
Running

openssl pkcs7 -inform DER -in mycert.spc -print_certs -out mycert.crt

gives error

unable to load PKCS7 object 4372:error:0D0680A8:asn1 encoding
routines:ASN1_CHECK_TLEN:wrong tag:.\crypto\asn1\tasn_dec.c:1319:
4372:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1
error:.\crypto\asn1\tasn_dec.c:381:Type=PKCS7

following the instructions here

http://stackoverflow.com/questions/17625174/how-do-i-import-the-private-and-public-keys-pvk-spc-and-certificates-cer-int





--
View this message in context: http://openssl.6102.n7.nabble.com/error-unable-to-load-PKCS7-object-wrong-tag-tp45859.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Dr. Stephen Henson
2013-07-17 20:14:46 UTC
Permalink
Post by likejiujitsu
Running
openssl pkcs7 -inform DER -in mycert.spc -print_certs -out mycert.crt
gives error
unable to load PKCS7 object 4372:error:0D0680A8:asn1 encoding
4372:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1
error:.\crypto\asn1\tasn_dec.c:381:Type=PKCS7
following the instructions here
http://stackoverflow.com/questions/17625174/how-do-i-import-the-private-and-public-keys-pvk-spc-and-certificates-cer-int
One possible answer. Look at mycert.spc in a hex editor. Search for the first
occurence of 0x30 0x82 and delete everything before it, save to a new file.
Try that command again with the new file.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Anil
2013-07-18 14:50:41 UTC
Permalink
Thank you for your reply.
I used HxD but could not find any occurrence of 0x30 followed by 0x82.
Anything else to try?



----- Original Message -----
From: Dr. Stephen Henson <***@openssl.org>
To: openssl-***@openssl.org
Cc:
Sent: Wednesday, July 17, 2013 3:14 PM
Subject: Re: error "unable to load PKCS7 object... wrong tag"
Post by likejiujitsu
Running
openssl pkcs7 -inform DER -in mycert.spc -print_certs -out mycert.crt
gives error
unable to load PKCS7 object 4372:error:0D0680A8:asn1 encoding
4372:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1
error:.\crypto\asn1\tasn_dec.c:381:Type=PKCS7
following the instructions here
http://stackoverflow.com/questions/17625174/how-do-i-import-the-private-and-public-keys-pvk-spc-and-certificates-cer-int
One possible answer. Look at mycert.spc in a hex editor. Search for the first
occurence of 0x30 0x82 and delete everything before it, save to a new file.
Try that command again with the new file.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                http://www.openssl.org
User Support Mailing List                    openssl-***@openssl.org
Automated List Manager                          ***@openssl.org

______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Dave Thompson
2013-07-18 23:52:03 UTC
Permalink
Sent: Thursday, 18 July, 2013 10:51
Thank you for your reply.
I used HxD but could not find any occurrence of 0x30 followed by 0x82.
Anything else to try?
openssl asn1parse -inform DER -in mycert.spc

If that gives an error, your file isn't DER. Figure out what it is.
If you can't figure out, post a hex dump and maybe someone else can;
if it's really big, truncate to at most a few hundred bytes.

If asn1parse succeeds post it, or if big the first say 20 lines.


______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
likejiujitsu
2013-07-19 14:26:29 UTC
Permalink
openssl asn1parse -inform DER -in "D:\thawte_info\myCert.spc"
    0:d=0  hl=2 l=  45 cons: <ASN1 13>
Error in encoding
4048:error:0D07209B:asn1 encoding routines:ASN1_get_object:too long:.\crypto\asn1\asn1_lib.c:142:


________________________________
From: Dave Thompson-5 [via OpenSSL] <ml-node+***@n7.nabble.com>
To: likejiujitsu <***@yahoo.com>
Sent: Thursday, July 18, 2013 6:58 PM
Subject: RE: error "unable to load PKCS7 object... wrong tag"
From: [hidden email] On Behalf Of Anil
Sent: Thursday, 18 July, 2013 10:51
Thank you for your reply.
I used HxD but could not find any occurrence of 0x30 followed by 0x82.
Anything else to try?
openssl asn1parse -inform DER -in mycert.spc

If that gives an error, your file isn't DER. Figure out what it is.
If you can't figure out, post a hex dump and maybe someone else can;
if it's really big, truncate to at most a few hundred bytes.

If asn1parse succeeds post it, or if big the first say 20 lines.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]


________________________________

If you reply to this email, your message will be added to the discussion below:http://openssl.6102.n7.nabble.com/error-unable-to-load-PKCS7-object-wrong-tag-tp45859p45886.html
To unsubscribe from error "unable to load PKCS7 object... wrong tag", click here.
NAML



--
View this message in context: http://openssl.6102.n7.nabble.com/error-unable-to-load-PKCS7-object-wrong-tag-tp45859p45894.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
Dave Thompson
2013-07-19 21:32:06 UTC
Permalink
Sent: Friday, 19 July, 2013 10:26
openssl asn1parse -inform DER -in "D:\thawte_info\myCert.spc"
0:d=0 hl=2 l= 45 cons: <ASN1 13>
Error in encoding
Okay, that's an error. See below.
________________________________
From: Dave Thompson-5 [via OpenSSL] <[hidden email]>
To: likejiujitsu <[hidden email]>
Sent: Thursday, July 18, 2013 6:58 PM
Subject: RE: error "unable to load PKCS7 object... wrong tag"
<snip>
openssl asn1parse -inform DER -in mycert.spc
If that gives an error, your file isn't DER. Figure out what it is.
If you can't figure out, post a hex dump and maybe someone else can;
if it's really big, truncate to at most a few hundred bytes.
<snip>

______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Loading...