SignedXml CheckSignature CryptographicException

Discussion in 'ASP .Net Security' started by Gene Vangampelaere, Aug 18, 2006.

  1. 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
    Gene Vangampelaere, Aug 18, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dei401
    Replies:
    0
    Views:
    774
    Dei401
    Feb 2, 2005
  2. =?Utf-8?B?ZnJlcXVuZW5jeQ==?=

    CryptographicException Bad Data in Windo

    =?Utf-8?B?ZnJlcXVuZW5jeQ==?=, Jul 20, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    602
    =?Utf-8?B?ZnJlcXVuZW5jeQ==?=
    Jul 20, 2005
  3. muthu
    Replies:
    1
    Views:
    515
    Winista
    Jul 10, 2006
  4. Brad
    Replies:
    1
    Views:
    1,681
    Steven Cheng[MSFT]
    Aug 30, 2006
  5. Brent K
    Replies:
    2
    Views:
    639
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 12, 2007
Loading...

Share This Page