ASN1 bad tag value met on EnvelopedData.Decrypt str
From: Kristine (wingsforwheels_at_hotmail.com)
Date: 09/23/04
- Previous message: Joe Richards [MVP]: "Re: Getting the UPN of the currently logged on user"
- Next in thread: Daniel Sie [MSFT]: "Re: ASN1 bad tag value met on EnvelopedData.Decrypt str"
- Reply: Daniel Sie [MSFT]: "Re: ASN1 bad tag value met on EnvelopedData.Decrypt str"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 23 Sep 2004 08:41:55 -0700
Users are being linked to our site, and the URL passed to us contains
encrypted data (encrypted by JAVA). The site that is passing the URL
to us and encrypting the parameter has my public key/certificate.
When I try to decrypt using CAPICOM the "ASN1 bad tag value met" error
is raised. I checked the decoded text on the ANS1 dump tool and it
did not raise any errors. I've included my code below, if anyone sees
anything wrong with it please let me know (this is the first time I've
implemented the asynchronous/key pair).
Would this error be raised if my private key was not found? Is there
anyway to check that it was found? I did verify that the private key
is associated with the certificate.
Set Store = Server.CreateObject("CAPICOM.Store")
Store.Open CAPICOM_LOCAL_MACHINE_STORE, "MY" ,0
Set Certificates = Store.Certificates.Find(CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME,
SubjectName)
Response.Write("<br>Certificate found: " & Store.Certificates.Count)
If Store.Certificates.Count > 0 then
Set EnvelopedData = Server.CreateObject("CAPICOM.EnvelopedData")
EnvelopedData.Recipients.Add Store.Certificates(1)
Message = Request.QueryString("query")
Response.write "<p>Encrypt= " & Message
'EnvelopedData.Decrypt Message <---ERROR HERE
'str_out = EnvelopedData.Content
'response.write "<p>Decrypt= " & str_out
Else
response.write "<P>Could not find certificate."
End If
- Previous message: Joe Richards [MVP]: "Re: Getting the UPN of the currently logged on user"
- Next in thread: Daniel Sie [MSFT]: "Re: ASN1 bad tag value met on EnvelopedData.Decrypt str"
- Reply: Daniel Sie [MSFT]: "Re: ASN1 bad tag value met on EnvelopedData.Decrypt str"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|