sign and verify using .pfx files (General questions)

by mauricio, (7379 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.

locked

Re: sign and verify using .pfx files

by Jasmine, (7379 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?

locked

Re: sign and verify using .pfx files

by mauricio @, (7378 days ago) @ Jasmine

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:]

locked

Re: sign and verify using .pfx files

by mauricio @, (7378 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:]

locked

Re: sign and verify using .pfx files

by Jasmine, (7372 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.

locked