Persits Software, Inc. Knowledge Base Articles

ASN1 bad tag value met error

Problem Description

On Windows 2003/IIS 6, the last line of the code snippet

Set Blob = CM.CreateBlob
Blob.Binary = Request.ClientCertificate("Certificate")
Set Cert = CM.ImportCertFromBlob(Blob)

generates the following error:

Persits.CryptoManager.1 error '800a0025'
ASN1 bad tag value met.

Solution

Starting with IIS 6.0 on Windows 2003, Microsoft changed the format of data returned by Request.ClientCertificate("Certificate") which caused a problem with AspEncrypt's CryptoBlob object originally designed for Windows NT and Windows 2000.

To fix the aforementioned error, simply replace the line

...
Blob.Binary = Request.ClientCertificate("Certificate")
...

with

...
Temp = Request.ClientCertificate("Certificate")
Blob.Binary = Temp
...