Download source code
This sample cryptographically encrypts / decrypts files with digital x509 certificate.
procedure TForm1.btnEncryptClick(Sender: TObject); var dlg: TGetCertDialog; begin dlg := TGetCertDialog.Create(nil); try dlg.Caption := 'Get encryption certificate'; if (dlg.ShowModal() = mrOK) then begin clEncryptor1.EncryptStore := dlg.edtStore.Text; clEncryptor1.EncryptCertificate := dlg.edtEmail.Text; end; finally dlg.Free(); end; clEncryptor1.Encrypt(edtSource.Text, edtDestination.Text); ShowMessage(Format('The file %s was encrypted and stored to %s', [edtSource.Text, edtDestination.Text])); end;
procedure TForm1.btnDecryptClick(Sender: TObject); var dlg: TGetCertDialog; begin dlg := TGetCertDialog.Create(nil); try dlg.Caption := 'Get encryption certificate'; if (dlg.ShowModal() = mrOK) then begin clEncryptor1.EncryptStore := dlg.edtStore.Text; clEncryptor1.EncryptCertificate := dlg.edtEmail.Text; end; finally dlg.Free(); end; clEncryptor1.Decrypt(edtSource.Text, edtDestination.Text); ShowMessage(Format('The file %s was decrypted and stored to %s', [edtSource.Text, edtDestination.Text])); end;
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add admin@clevercomponents.com to your trusted senders list in your email software.