Base class for standard crypt/sign API
Inheritance: IDisposable
Example #1
0
        /// <summary>
        /// Gets the decrypting stream.
        /// </summary>
        /// <param name="output">The output.</param>
        /// <returns></returns>
        public override FinishingStream GetDecryptingStream(Stream output, Keyczar.Keyczar 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));
        }
Example #2
0
        /// <summary>
        /// Gets the encrypting stream.
        /// </summary>
        /// <param name="output">The output.</param>
        /// <returns></returns>
        public override FinishingStream GetEncryptingStream(Stream output, Keyczar.Keyczar 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));
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AttachedSignerHelper"/> class.
 /// </summary>
 /// <param name="keySet">The key set.</param>
 public AttachedSignerHelper(IKeySet keySet, Keyczar parent)
     : base(keySet)
 {
     Config = parent.Config;
 }
Example #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, Keyczar parent) : base(keySet)
 {
     Config = parent.Config;
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TimeoutSignerHelper"/> class.
 /// </summary>
 /// <param name="keySet">The key set.</param>
 public TimeoutSignerHelper(IKeySet keySet, Keyczar parent)
     : base(keySet)
 {
     Config = parent.Config;
 }