GnuPG wrapper with C #

I use GnuPG and C # to encrypt files with imported public keys. But when I try to do encryption, GnuPG will encrypt the public key file of the primary user. I am sure that I transfer the right of the recipient.

+3
source share
1 answer

You can try using my open source code and the free GnuPG shell for C # (and VB.NET). All code is licensed using the limitations of MIT, non-GPL. You can find the source release in CodePlex. Find the Alpha release to find the GPG library.

http://biko.codeplex.com/

Example:

  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);
+11
source

Source: https://habr.com/ru/post/1714085/


All Articles