public async Task Process(Stream input, Func <Stream, Task> act)
 {
     using (MemoryStream ms = new MemoryStream()) {
         input.CopyTo(ms);
         ms.Seek(0, SeekOrigin.Begin);
         var bytes         = ms.ToArray();
         var cypheredBytes = _method.Decrypt(bytes);
         using (MemoryStream output = new MemoryStream(cypheredBytes)) {
             await act(output);
         }
     }
 }
Exemplo n.º 2
0
 public byte[] AsDecodedBuffer(IEncryptionMethod method)
 {
     ResultStream.Seek(0, SeekOrigin.Begin);
     return(method.Decrypt(AsBuffer()));
 }
Exemplo n.º 3
0
        public string AsDecodedString(IEncryptionMethod method)
        {
            var retv = Fi.StandardEncoding.GetString(method.Decrypt(AsBuffer()));

            return(retv);
        }
Exemplo n.º 4
0
 public static String DecryptToBase64(this IEncryptionMethod self, byte[] bytes)
 {
     return(Convert.ToBase64String(self.Decrypt(bytes)));
 }