SignedXml CheckSignature CryptographicException



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/microsoft.public.dotnet.security/browse_thread/thread/b8fbdfa3a1137ffa/89a6487c4aa32832?lnk=st&q=%22CryptoAPI+cryptographic+service+provider+(CSP)+for+this+implementation+could+not+be+acquired%22+CheckSignature&rnum=1#89a6487c4aa32832

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






.



Relevant Pages

  • Re: Sorting a System.Collections.ObjectModel.Collection
    ... Public Sub Dispose() Implements System.IDisposable.Dispose ... Private m_SupportsSorting As Boolean = True ... Protected Overrides ReadOnly Property SupportsSortingCoreAs Boolean ... Dim m_SortList As New ArrayList ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Sorting a System.Collections.ObjectModel.Collection
    ... Public Sub Dispose() Implements System.IDisposable.Dispose ... Private m_SupportsSorting As Boolean = True ... Protected Overrides ReadOnly Property SupportsSortingCoreAs Boolean ... Dim m_SortList As New ArrayList ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Can this be automated in the VBE?
    ... Function DB2SQLite(bNewFile As Boolean, strDB As String, _ ... strTable As String, strSQL As String, _ ... Optional strIndexFields As String, Optional bNoMessage As Boolean, _ ... Dim lRowCount As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: Courtesy Review
    ... Dim pStrConfirm As String ... Dim bValidated As Boolean ... Dim pInvalidStr As String ...
    (microsoft.public.word.vba.general)
  • Re: COM+, CRMs and Stuff
    ... Public Shared StartPath As String ... Public Sub New ... Dim _aRecord As New aRecord ... Function PrepareRecordAs Boolean ...
    (microsoft.public.dotnet.languages.vb)