SignedXml CheckSignature CryptographicException

G

Gene Vangampelaere

Hello,

I'm having a problem with the RSACryptoServiceProvider and the
SignedXml.CheckSignature() method. When I use the function locally (ASP.NET
webservice) it works fine. When I put it on a server then I get this error :

System.Security.Cryptography.CryptographicException: CryptoAPI cryptographic
service provider (CSP) for this implementation could not be acquired.


Public Function CheckXmlSignature(ByVal xmlstring As String, Optional ByVal
isFile As Boolean = True) As Boolean
Dim bresult As Boolean
Try
Dim xmlDoc As New XmlDocument
If isFile Then
xmlDoc.Load(xmlstring)
Else
xmlDoc.LoadXml(xmlstring)
End If
Dim sXml As New SignedXml(xmlDoc)
Try
Dim dsig As XmlNode = xmlDoc.GetElementsByTagName("Signature")(0)
Dim a As String = dsig.InnerText()
sXml.LoadXml(CType(dsig, XmlElement))
Catch ex As Exception
Throw ex
End Try
'Verify the signature.
bresult = sXml.CheckSignature()
Return bresult
Catch ex As Exception
Throw ex
End Try
End Function



Does anyone have any idea what is wrong ? I searched google and the
following urls did NOT solve the thing :
http://groups.google.com/group/micr...uired"+CheckSignature&rnum=1#89a6487c4aa32832

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322371
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top