示例#1
0
 private static void EncryptFile()
 {
     using (ChoPGPEncryptDecrypt pgp = new ChoPGPEncryptDecrypt())
     {
         pgp.EncryptFile("SampleData.txt", "SampleData.PGP", "Sample_Pub.asc", true, false);
         Console.WriteLine("PGP Encryption done.");
     }
 }
示例#2
0
        static void encrypt_file(string localpath, string filename)
        {
            Console.WriteLine("Encrypting file " + filename);

            try
            {
                using (ChoPGPEncryptDecrypt pgp = new ChoPGPEncryptDecrypt())
                {
                    pgp.EncryptFile(localpath, @"c:\ftp_down\" + filename + ".PGP", @"c:\ftp_down\pkey.asc", true, false);
                }

                Console.WriteLine("File encrypted and available.....");
                File.Delete(@"c:\ftp_down\" + filename);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }