Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Trying to sign a hash
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 22nd April 16:25
erick daniel tinajero
External User
 
Posts: 1
Default Trying to sign a hash



Hi all:

I am trying to perform a PKCS#1 Hash Sign with a RSA key.
I am currently trying to do this:

Dim store As Microsoft.Web.Services2.Security.X509.X509Certific ateStore =
Microsoft.Web.Services2.Security.X509.X509Certific ateStore.CurrentUserStore(Microsoft.Web.Services2. Security.X509.X509CertificateStore.MyStore)

store.Open()

Dim cert As Microsoft.Web.Services2.Security.X509.X509Certific ate =
store.Certificates(0)
Dim RSA As System.Security.Cryptography.RSA = cert.Key
Dim Crypt As New
System.Security.Cryptography.RSAPKCS1SignatureForm atter(RSA)
Dim hash As New System.Security.Cryptography.MD5CryptoServiceProvi der()

Dim hashed As Byte()
Dim Cypher As Byte()
Dim enc As System.Text.Encoding

hashed = hash.ComputeHash(enc.ASCII.GetBytes("Hi"))
Crypt.SetHashAlgorithm("MD5")
Cypher = Crypt.CreateSignature(hashed)

Everything goes fine until the last line, when it throws an 'DecryptValue'
not supported exception.

I think I am very close to do my task, but I can't solve that error.

Any clues? Thank you.
  Reply With Quote


  sponsored links


2 22nd April 16:26
pieter philippaerts
External User
 
Posts: 1
Default Trying to sign a hash



Take a look at this thread for the answer: http://tinyurl.com/42295

Regards,
Pieter Philippaerts
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666