sign and verify using .pfx files - WeOnlyDo Discussion board

sign and verify using .pfx files (General questions)

by mauricio, Thursday, February 17, 2005, 14:05 (7030 days ago)

hi guys its me again...

VB6 code :

Dim oCert as new Certificate
Dim oCrypt as wodCryptCom
Dim hashBlob as new MemBlob
Dim signBlob as new MemBlob

oCert.LoadKey useDrive & genexus.pfx ' self signed pfx
oCert.Load useDrive & genexus.pfx
lblOWNER.Caption = oCert.CommonName & < & oCert.Email & >
hashBlob.Text = QPxo1S95hM2nLzgcVKq5sg==
Set oCrypto = New wodCryptCom
oCrypto.Type = RSA
oCrypto.Padding = PadPKCS7
oCrypto.SecretKey = * how can I load private key from oCert ????
oCrypto.Sign hashBlob, signBlob

and...

when I would try to verify how can I load public key from oCert before oCrypto.Verify(hashBlob,signBlob) ???

thank you again.

Re: sign and verify using .pfx files

by wodSupport, Thursday, February 17, 2005, 22:54 (7029 days ago) @ mauricio

Mauricio,

regarding private key, did you try doing

Crypt.SecretKey = oCert

and for public key, you can do this
Crypt.SecretKey = oCert.PublicKeyOpenSSH

can you try that?

Re: sign and verify using .pfx files

by mauricio, Friday, February 18, 2005, 11:05 (7029 days ago) @ wodSupport

Mauricio,

regarding private key, did you try doing

Crypt.SecretKey = oCert

and for public key, you can do this
Crypt.SecretKey = oCert.PublicKeyOpenSSH

can you try that?

let give it a try... let me see... it says:

Run-time error '30005': Secret Password is not set, or cannot be applied to selected algorithm. [:sad:]

Re: sign and verify using .pfx files

by mauricio, Friday, February 18, 2005, 11:10 (7029 days ago) @ mauricio

P.S.

about public key: my apologizes, there is already a topic that explains how to load public key from certificate. [:happy:]

Re: sign and verify using .pfx files

by wodSupport, Thursday, February 24, 2005, 21:33 (7022 days ago) @ mauricio

You were right. As seems, wodCertificate's PrivateKey cannot be used with wodCrypt.

ok, we fixed that. Now you're safe to do

oCrypt.SecretKey = oCertificate

and that's it. Make sure you request update, version 1.2.4

Best regards.