Re: ASN1 bad tag value met on EnvelopedData.Decrypt str
From: Daniel Sie [MSFT] (dsie_at_online.microsoft.com)
Date: 09/24/04
- Next message: Daniel Sie [MSFT]: "Re: CertAddCertificateContextToStore or CertAddEncodedCertificateToStore fails with E_ACCESSDENIED ?"
- Previous message: Daniel Sie [MSFT]: "Re: Enroll user cert from AD using CAPICOM"
- In reply to: Kristine: "ASN1 bad tag value met on EnvelopedData.Decrypt str"
- Next in thread: Kristine: "Re: ASN1 bad tag value met on EnvelopedData.Decrypt str"
- Reply: Kristine: "Re: ASN1 bad tag value met on EnvelopedData.Decrypt str"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 23 Sep 2004 21:14:01 -0700
Can you dump out Message just before Decrypt to see what the value is?
--
Thanks,
Daniel Sie [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kristine" <wingsforwheels@hotmail.com> wrote in message
news:37603010.0409230741.901fa32@posting.google.com...
> 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
- Next message: Daniel Sie [MSFT]: "Re: CertAddCertificateContextToStore or CertAddEncodedCertificateToStore fails with E_ACCESSDENIED ?"
- Previous message: Daniel Sie [MSFT]: "Re: Enroll user cert from AD using CAPICOM"
- In reply to: Kristine: "ASN1 bad tag value met on EnvelopedData.Decrypt str"
- Next in thread: Kristine: "Re: ASN1 bad tag value met on EnvelopedData.Decrypt str"
- Reply: Kristine: "Re: ASN1 bad tag value met on EnvelopedData.Decrypt str"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|