Super late to this, but going through this myself. I think you'll have to export the keys, and then point at the file path where you store them to use in C#
Kleopatra
Export private key: right-click and select 'backup secret keys'
Export public key: right-click' export keys' to back up the public key.
PGPCore code for encryption and decryption:
Encryption using the public key:
// Load keys
EncryptionKeys encryptionKeys;
using (Stream publicKeyStream = new FileStream(@"C:\TEMP\Keys\public.asc", FileMode.Open))
encryptionKeys = new EncryptionKeys(publicKeyStream);
PGP pgp = new PGP(encryptionKeys);
// Reference input/output files
using (FileStream inputFileStream = new FileStream(@"C:\TEMP\Content\content.txt", FileMode.Open))
using (Stream outputFileStream = File.Create(@"C:\TEMP\Content\encrypted.pgp"))
// Encrypt
await pgp.EncryptStreamAsync(inputFileStream, outputFileStream);
Decryption using the private key and password:
// Load keys
EncryptionKeys encryptionKeys;
using (Stream privateKeyStream = new FileStream(@"C:\TEMP\Keys\private.asc", FileMode.Open))
encryptionKeys = new EncryptionKeys(privateKeyStream, "password");
PGP pgp = new PGP(encryptionKeys);
// Reference input/output files
using (FileStream inputFileStream = new FileStream(@"C:\TEMP\Content\encryptedContent.pgp", FileMode.Open))
using (Stream outputFileStream = File.Create(@"C:\TEMP\Content\decrypted.txt"))
// Decrypt
await pgp.DecryptStreamAsync(inputFileStream, outputFileStream);
Obviously change the file paths to the corresponding key path, , encrypt = public, decrypt = private