Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to check digital signature


This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 5 - Last Post: Jul 3, 2014 2:37 AM Last Post By: Martin Nijhoff
Martin Nijhoff

Posts: 75
Registered: 8/26/10
How to check digital signature  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 13, 2012 2:06 AM
Martin Nijhoff

Posts: 75
Registered: 8/26/10
Re: How to check digital signature  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 20, 2012 6:42 AM   in response to: Martin Nijhoff in response to: Martin Nijhoff
Jason Goff

Posts: 8
Registered: 5/9/08
Re: How to check digital signature
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 21, 2012 10:59 AM   in response to: Martin Nijhoff in response to: Martin Nijhoff
Martin Nijhoff

Posts: 75
Registered: 8/26/10
Re: How to check digital signature  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 23, 2012 1:26 AM   in response to: Jason Goff in response to: Jason Goff
Martin Nijhoff

Posts: 75
Registered: 8/26/10
Re: How to check digital signature  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 14, 2012 6:46 AM   in response to: Martin Nijhoff in response to: Martin Nijhoff
I found an example in Visual Basic (using .NET Framework 4) of what I'm trying to accomplish:

Dim Alg As String = Security.Cryptography.CryptoConfig.MapNameToOID("SHA1")
 
Dim CSP As Security.Cryptography.RSACryptoServiceProvider = New Security.Cryptography.RSACryptoServiceProvider
 
CSP.FromXmlString("<RSAKeyValue><Modulus>...</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>")
 
Dim Msg As String = "<<Message>>"
 
Dim Sign() As Byte = Convert.FromBase64String("<<Signature>>")
 
If (CSP.VerifyData(Encoding.GetEncoding(&H6FAF).GetBytes(Msg), Alg, Sign)) Then
    ...
End If


'Msg' is the message string in plaintext (= arbitrary length).
'Sign' is the signature of the message (= 48 bytes).

Any idea how to do this in C++ using the Microsoft cryptography API?

--
Martin
Martin Nijhoff

Posts: 75
Registered: 8/26/10
Re: How to check digital signature  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 3, 2014 2:37 AM   in response to: Martin Nijhoff in response to: Martin Nijhoff
Reversing the byte order of the public key and the signature fixed the problem.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02