ASN1 bad tag value met.

150 views
Skip to first unread message

Zain ul Abedeen

unread,
Sep 15, 2014, 7:37:14 AM9/15/14
to transport-t...@googlegroups.com
Hi All,

Any one experiencing " ASN1 bad tag value met." while decrypting using EnvelopedCMS c-sharp class.

The first level of Email decryption works fine and gives us the inner attached encrypted XML and Signature, but we are facing problem in decrypting the XML

Thanks in advance

Regards

Zain ul Abedeen

unread,
Sep 15, 2014, 8:30:26 AM9/15/14
to transport-t...@googlegroups.com
ok more details here

Below is the Email that i receive from TTT for testing

+OK 202319 octets 
Received: (qmail 1494 invoked by uid 30297); 12 Sep 2014 08:42:25 -0000
Received: from unknown (HELO p3plibsmtp03-15.prod.phx3.secureserver.net) ([68.178.213.112])
          (envelope-sender <direct-clin...@transport-testing.nist.gov>)
          by p3plsmtp06-04.prod.phx3.secureserver.net (qmail-1.03) with SMTP
          for <tes...@xyztesting.com>; 12 Sep 2014 08:42:25 -0000
Received: from hit-testing.nist.gov ([129.6.24.80])
id q8iQ1o00C1jh4PV018iQ5R; Fri, 12 Sep 2014 01:42:25 -0700
Subject: Direct Validation Request
Date: Fri, 12 Sep 2014 04:42:23 -0400 (EDT)
Subject: Message test
MIME-Version: 1.0
Content-Type: application/pkcs7-mime; name=smime.p7m; 
smime-type=enveloped-data
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7m
X-Nonspam: None

MIAGCSqGSIb3DQEHA6CAMIACAQAxggFHMIIBQwIBADArMBcxFTATBgNVBAMTDEVOQ0RSU0NSSUJF
NATAiq5fyrtIvpTMhHVwi06 ....
....
...
nCWGAAAAAAAAAAAAAA==

.

I am able to decrypt this above part, which then gives me something like below

Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-1; 
boundary="----=_Part_12_140265642.1410511343698"

------=_Part_12_140265642.1410511343698
Content-Type: multipart/mixed; 
boundary="----=_Part_10_986425995.1410511343685"

------=_Part_10_986425995.1410511343685
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Message test
------=_Part_10_986425995.1410511343685
Content-Type: text/xml; name=CCDA_Inpatient.xml
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=CCDA_Inpatient.xml

PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8P3htbC1zdHlsZXNoZWV0IHR5cGU9InRleHQveHNsIiBo
cmVmPSIuLi9zdHlsZXNoZWV0L0NEQS54c2wiPz4NCjwhLS0NCglUaXRsZTogVVNfUmVhbG1fSGVh
..........
.........
ZGVyX1RlbXBsYXRlDQoNCglSZXZpc2lvbiBIaXN0b3J5Og0KCSAwMS8zMS8yMDExIGJhbSBjcmVh
cmVkQm9keT4NCgk8L2NvbXBvbmVudD4NCjwvQ2xpbmljYWxEb2N1bWVudD4NCg==

------=_Part_10_986425995.1410511343685--

------=_Part_12_140265642.1410511343698
Content-Type: application/pkcs7-signature; name=smime.p7s; smime-type=signed-data
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIAwggQ3MIID
H6ADAgECAgEEMA0GCSqGSIb3DQEBCwUAMGwxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJNRDEVMBMG
........
.......
........
K2IXTnYh5QVCJq8D/5vrkQ/xnWFcgx6T/b57vBo1a7YZTgCHm7yOvmF9XiROc+cBimNU2/NabcsR
LT8FJ7+lYrInttsuaE1lRExWotLxS8YK68OUiO804dkHWgAAAAAAAA==
------=_Part_12_140265642.1410511343698--


This is where I am stuck, and unable to decode/decrypt the XML.

Would really appreciate help on this

Thanks again
Regards
Reply all
Reply to author
Forward
0 new messages