我使用GnuPG和C#来加密文件,并导入公钥。但是当我尝试加密时,GnuPG会用主用户的公钥加密文件。我确定我传递了正确的接收者。
GnuPG gpg = new GnuPG();
gpg.Recipient = "myfriend@domain.com";
FileStream sourceFile = new FileStream(@"c:\temp\source.txt", FileMode.Open);
FileStream outputFile = new FileStream(@"c:\temp\output.txt", FileMode.Create);
// encrypt the data using IO Streams - any type of input and output IO Stream can be used
gpg.Encrypt(sourceFile, outputFile);