Пример #1
0
        public async Task InvokeAsync(HttpContext context)
        {
            using (MemoryStream clone = new())
            {
                await context.Request.Body.CopyToAsync(clone).ConfigureAwait(false);

                if (clone.Length != 0L)
                {
                    clone.Position       = 0L;
                    context.Request.Body = PgpMethods.Decrypt(clone, this._keys.PrivateKey);
                }
            }
            await this._next(context).ConfigureAwait(false);
        }
Пример #2
0
 public SecureController(PgpKeys keys)
 {
     this._publicKey = Encoding.ASCII.GetString(PgpMethods.GetKeyBytes(keys.PublicKey.Encode));
 }