Verify Signed XML document in compact framework

D

dani

I want to convert following VB.Net code to cf Code:

Is there any way to do this? Please help me. Do not say only
System.Security.Cryptography.Xml is not included in cf..

Here is the working code in vb.Net:
(the public key is included in the xml file)


Public Function VerifyXMLDocument(ByVal sXMLFileName As String, _
ByVal sXMLPublicKey As String)
As Boolean

' Load the signed XML file.
Dim xmldoc As New XmlDocument
xmldoc.Load(sXMLFileName)

' Create an RSA crypto service provider from the embedded
' XML document resource (the public key).
Dim csp As New RSACryptoServiceProvider
csp.FromXmlString(sXMLPublicKey)

' Create the signed XML object.
Dim sxml As New SignedXml(xmldoc)

' Verify the signature.
If sxml.CheckSignature(csp) Then
Return True
Else
Return False
End If

End Function


Here is the signed XML File:

<?xml version="1.0" encoding="utf-16"?>
<license>
<ComputerName>
</ComputerName>
<ComputerMAC>0030BD61F98A</ComputerMAC>
<CompanyName>
</CompanyName>
<UserName>
</UserName>
<IsServerLicense>False</IsServerLicense>
<MaxUser>0</MaxUser>
<Info>License InetConnector Proxy 1.0.1.1</Info>
<Guid>c51bfefcdfce4260923e98038fe737644967464699484c6bab54b8dcf6841b4d</Guid>
<PublicKey>
<RSAKeyValue>
<Modulus>wOP27h39Vi5oL92X9kJH4gHOlvOIQRXJZrM32pzLGlwNMm1+Ewi0o5NWmZFHTjHamRjGUQyLEOaGyBixFL7nFvOf+CwM8l1Psi4l5uCZ9deDxcfoH/w9a7KDxNDJhdd5joTvSFSupHYd+GEEpV68RQDeRy4npzcgQtfQYSXFUOc=</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
</PublicKey>
<Tool>
<ToolName>InetConnector Proxy</ToolName>
<DateCreated>20050111</DateCreated>
<DateExpire>99991231</DateExpire>
<IsTrial>False</IsTrial>
<IsLicensed>True</IsLicensed>
<SerialNumber>
</SerialNumber>
<DongleWithMAC>
</DongleWithMAC>
<Project>
</Project>
<Segment>
</Segment>
<ToolInfo>1.0.1.1</ToolInfo>
</Tool>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="">
<Transforms>
<Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>4lgI4IIJ4aDWn6dutwvtZcXR1sk=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>jlraLE6t3iUb5+96pjIRLA3NX/B7l6nMuh7cnObVrdHDnkZcb2DGNQfENeBy6IspvThb1mZtNJK4LwUyU5EE7b3SLiC+0l3Hk7kpCKWSYFth4+ElsSBAROCWPHVWRRQQLpQNmfC4eOZ79gqNXLhQVPE9sssLTwDKuzneqgORYQ8=</SignatureValue>
</Signature>
</license>
 
G

gamadiel cerda

do you know how to sign a xml document with xmldsig in visual basic 6.0
? please help me. i really need some example or a dll or anything
 
C

Chris Tacke, eMVP

VB6 has nothing to do with the compact framework. I suggest you try another
newsgroup.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 

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

Top