Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > SignedXml CheckSignature CryptographicException

Reply
Thread Tools

SignedXml CheckSignature CryptographicException

 
 
Gene Vangampelaere
Guest
Posts: n/a
 
      08-18-2006
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.CryptographicExceptio n: 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/micro...a6487c4aa32832

http://support.microsoft.com/default...;en-us;Q322371




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange error-(WebResource.axd) CryptographicException: Padding is invalid and cannot be removed. Brent K ASP .Net 2 07-12-2007 04:30 PM
WebResource CryptographicException Brad ASP .Net 1 08-30-2006 06:19 AM
System.Security.Cryptography.CryptographicException: muthu ASP .Net 1 07-10-2006 12:17 PM
CryptographicException Bad Data in Windo =?Utf-8?B?ZnJlcXVuZW5jeQ==?= ASP .Net 0 07-20-2005 03:05 AM
Re: "System.Security.Cryptography.CryptographicException: Bad Data" Message Dei401 ASP .Net 0 02-02-2005 04:30 PM



Advertisments