Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Sign hash with public key

Reply
Thread Tools

Sign hash with public key

 
 
Daniel Godoy
Guest
Posts: n/a
 
      09-20-2006
Hello all !

Iīve developed a page to do a Asymmetric Cryptography with Digital
Certificate, but something doesnīt work.

I have a URL like that :
"FIELD1=000000000000001&FIELD2=0000&FIELD3=AAAAA&S IGN=5705236f1f462afe65f6704d24c8e1359fead41e42c460 d........"

When I receive it, I have to get the Digital Signature of all field and
after compare with the SIGN field. But I canīt cryptography the field using
"SIGNHASH", because my Certificate File (CER) havenīt the Private Key, and
the same time, I canīt use the VERIFYHASH, because I donīt know how convert
the SIGN value to a array of bytes.

The code :
'TextBox1.text = ClearText

'TextBox2.text = SIGN

Dim ClearTextBytes As Byte() = Encoding.UTF8.GetBytes(TextBox1.Text)

Dim AlgHash As HashAlgorithm = HashAlgorithm.Create("SHA1")

Dim hash As Byte() = AlgHash.ComputeHash(ClearTextBytes)

Dim Cert As X509Certificate =
X509Certificate.CreateCertFromFile("C:\Certificate File.cer")

Dim sign As New RSACryptoServiceProvider

sign.ImportParameters(Cert.PublicKey.ExportParamet ers(False))

Dim b As Byte

Dim resultHexString As String

MsgBox(sign.VerifyHash(hash, CryptoConfig.MapNameToOID("SHA1"), "????I have
to convert, but I donīt know how ????"))



Thank you !!



Daniel Godoy






 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSE 4 11-15-2006 02:40 AM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola Microsoft Certification 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd loyola MCSD 3 11-14-2006 05:18 PM
microsoft.public.certification, microsoft.public.cert.exam.mcsa, microsoft.public.cert.exam.mcad, microsoft.public.cert.exam.mcse, microsoft.public.cert.exam.mcsd realexxams@yahoo.com Microsoft Certification 0 05-10-2006 02:35 PM
microsoft.public.dotnet.faqs,microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.windowsforms,microsoft.public.dotnet.general,microsoft.public.dotnet.languages.vb Charles A. Lackman ASP .Net 1 12-08-2004 07:08 PM



Advertisments