Sample code for 30+ languages & platforms
B4X

Example: Crypt2.SetDecryptCert method

Demonstrates how to call the SetDecryptCert method.

Chilkat B4X Downloads

B4X
Dim success As Boolean = False

Dim cert As ChilkatCert
cert.Initialize("cert")

success = cert.LoadPfxFile("c:/pfx_files/my.pfx", "password")
If success <> True Then
    Log(cert.LastErrorText)
    Return
End If


Dim decrypt As ChilkatCrypt2
decrypt.Initialize("decrypt")
decrypt.CryptAlgorithm = "pki"

success = decrypt.SetDecryptCert(cert)
If success <> True Then
    Log(decrypt.LastErrorText)
    Return
End If


Dim bd As ChilkatBinData
bd.Initialize
success = bd.LoadFile("c:/someDir/pkcs7_encrypted.dat")

success = decrypt.DecryptBd(bd)
If success <> True Then
    Log(decrypt.LastErrorText)
    Return
End If


'  bd contains the decrypted content.