【发布时间】:2019-02-12 22:36:20
【问题描述】:
在void Encryption() 上遇到错误。
public void Encryption()
{
#region PGP Encryption
PgpEncryptionKeys encryptionKeys = new PgpEncryptionKeys(@"C:\Keys\PGPPublicKey.asc", @"C:\Keys\PGPPrivateKey.asc", "password");
PgpEncrypt encrypter = new PgpEncrypt(encryptionKeys);
using (Stream outputStream = File.Create("C:\\Keys\\EncryptData.txt"))
{
encrypter.EncryptAndSign(outputStream, new FileInfo(@"D:\Keys\PlainText.txt"));
}
Console.WriteLine("Encryption Done !");
#endregion
}
我用https://code.msdn.microsoft.com/vstudio/Pretty-Good-Privacy-using-4f473c67 作为参考。
我对@987654324@中的参数感到困惑。
有没有人有一个可行的例子或帮助?这是我第一次加密,所以我有点迷失。
【问题讨论】:
标签: c# encryption bouncycastle public-key-encryption pgp