Esempio n. 1
0
        /// <summary>
        /// Gets the decrypting stream.
        /// </summary>
        /// <param name="output">The output.</param>
        /// <returns></returns>
        public override FinishingStream GetDecryptingStream(Stream output, Keyczar.KeyczarBase keyczar)
        {
            var alg = new AesManaged
            {
                Mode      = GetMode(),
                Key       = AesKeyBytes,
                Padding   = PaddingMode.PKCS7,
                BlockSize = BlockLength * 8
            };

            return(new DotNetSymmetricStream(alg, output, HmacKey.Maybe(h => h.HashLength, () => 0), encrypt: false));
        }
Esempio n. 2
0
        /// <summary>
        /// Gets the encrypting stream.
        /// </summary>
        /// <param name="output">The output.</param>
        /// <returns></returns>
        public override FinishingStream GetEncryptingStream(Stream output, Keyczar.KeyczarBase keyczar)
        {
            var alg = new AesManaged
            {
                Mode      = GetMode(),
                Key       = AesKeyBytes,
                Padding   = PaddingMode.PKCS7,
                BlockSize = BlockLength * 8
            };

            alg.GenerateIV();


            int hashlength = HmacKey.Maybe(h => h.HashLength, () => 0);

            return(new DotNetSymmetricStream(alg, output, hashlength, encrypt: true));
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TimeoutSignerHelper"/> class.
 /// </summary>
 /// <param name="keySet">The key set.</param>
 public TimeoutSignerHelper(IKeySet keySet, KeyczarBase parent)
     : base(keySet)
 {
     _parent = parent;
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HelperAttachedVerify"/> class.
 /// </summary>
 /// <param name="keySet">The key set.</param>
 public HelperAttachedVerify(IKeySet keySet, KeyczarBase parent) : base(keySet)
 {
     _parent = parent;
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AttachedSignerHelper"/> class.
 /// </summary>
 /// <param name="keySet">The key set.</param>
 /// <param name="parent"></param>
 public AttachedSignerHelper(IKeySet keySet, KeyczarBase parent)
     : base(keySet)
 {
     _parent = parent;
 }