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. Advertisements

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. =?Utf-8?B?ZnJlcXVuZW5jeQ==?=

    CryptographicException Bad Data in Windo

    =?Utf-8?B?ZnJlcXVuZW5jeQ==?=, Jul 20, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    816
    =?Utf-8?B?ZnJlcXVuZW5jeQ==?=
    Jul 20, 2005
  2. muthu
    Replies:
    1
    Views:
    725
    Winista
    Jul 10, 2006
  3. Brad
    Replies:
    1
    Views:
    1,894
    Steven Cheng[MSFT]
    Aug 30, 2006
  4. Brent K
    Replies:
    2
    Views:
    868
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 12, 2007
  5. Amelyan
    Replies:
    0
    Views:
    837
    Amelyan
    Aug 12, 2007
  6. jaekim

    CryptographicException: Bad Data

    jaekim, Sep 6, 2003, in forum: ASP .Net Security
    Replies:
    3
    Views:
    397
    jaekim
    Sep 7, 2003
  7. pmkatz
    Replies:
    0
    Views:
    564
    pmkatz
    Aug 25, 2004
  8. z f
    Replies:
    0
    Views:
    282
Loading...