'C# with PgpCore: Progress of asymmetrical process?
i do some tests with asymmetrical encryption and decryption in C# with PgpCore, installed with nuget. This works fine so far:
using (PGP pgp_createKey = new PGP())
{
// Generate keys
pgp_createKey.GenerateKey(@"C:\TEMP\Keys\public.asc", @"C:\TEMP\Keys\private.asc", "[email protected]", "12345678");
}
// Load keys
FileInfo publicKey = new FileInfo(@"C:\TEMP\Keys\public.asc");
EncryptionKeys encryptionKeysEncrypt = new EncryptionKeys(publicKey);
// Reference input/output files
FileInfo inputFile_Encrypt = new FileInfo(@"C:\TMP\sec.zip");
FileInfo encryptedFile = new FileInfo(@"C:\TMP\sec.zip.pgp");
PGP pgp_Ecnrypt = new PGP(encryptionKeysEncrypt);
pgp_Ecnrypt.EncryptFile(inputFile_Encrypt, encryptedFile);
// Load keys
FileInfo privateKey = new FileInfo(@"C:\TEMP\Keys\private.asc");
EncryptionKeys encryptionKeysDecrypt = new EncryptionKeys(privateKey, "12345678");
// Reference input/output files
FileInfo inputFile_Decrypt = new FileInfo(@"C:\TMP\sec.zip.pgp");
FileInfo decryptedFile = new FileInfo(@"C:\TMP\sec_decrypt.zip");
// Decrypt
PGP pgp = new PGP(encryptionKeysDecrypt);
pgp.DecryptFile(inputFile_Decrypt, decryptedFile);
For the method .EncryptFile or .DecryptFile: is it possible to catch an Event or create a Listener for getting the current position / progress of encryption or decryption?
Thanks a lot.
Searched in so and via ddg for PGPCore .EncryptFile progress, callback, ... sorry, could not find some stuff :-(
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
