Using certificates with WodCrypt (wodCrypt)
I've downloaded the evaluation version of WodCrypt and would greatly appreciate a little nudge in the right direction for what I'm hoping to achieve.
My intention is to use WodCrypt to encrypt/decrypt using keys obtained from certificate files (.cer for public keys and .pfx for private keys).
I've read in the release notes that a certificate object can be used as the SecretKey property but am having difficulty getting it to work.
My starting point was the Encrypt files VB sample that comes with the control.
I've modified cmdEncrypt_Click so that it now looks like this:
Dim srcfile As New FileBlob
Dim destfile As New FileBlob
Dim eCert As New WODCERTMNGLib.Certificate
Set oCrypt = New wodCryptCom
oCrypt.Optimized = False
oCrypt.Type = AES
eCert.Load App.Path + /test.cer
oCrypt.SecretKey = eCert
' oCrypt.SecretKey = Now is the time for all good men to come to the aid of their party.
srcfile.FileName = txtSource.Text
destfile.FileName = txtDest.Text
oCrypt.Encrypt srcfile, destfile
MsgBox Encyption Complete
When this is run, oCrypt.Encrypt returns the error 30005, Secret Password is not set, or cannot be applied to selected algorithm .
What am I doing wrong?
Thanks.