예제 #1
0
파일: UnitTest1.cs 프로젝트: mateof/ChoPGP
 private string DecryptNVerifyInMemory(MemoryStream text, string pass)
 {
     using (ChoPGPEncryptDecrypt pgp = new ChoPGPEncryptDecrypt())
     {
         using (MemoryStream a = new System.IO.MemoryStream())
         {
             Stream message;
             message = pgp.DecryptAndVerifyInMemory(text, a, "Sample_Pub.asc", "Sample_Pri.asc", pass);
             MemoryStream ms = new MemoryStream();;
             message.CopyTo(ms);
             ms = new MemoryStream(a.ToArray());
             StreamReader reader = new StreamReader(ms);
             return(reader.ReadToEnd());
         }
     }
 }