Example #1
0
            /// <summary>
            /// Initializes a new instance of the <see cref="BCryptCipherTransform"/> class.
            /// </summary>
            /// <param name="baseKey">The key that may carry state from a prior crypto operation.</param>
            /// <param name="platformKey">The stateful platform key.</param>
            /// <param name="iv">The IV to use for the next transform operation.</param>
            internal BCryptCipherTransform(SymmetricCryptographicKey baseKey, SafeKeyHandle platformKey, byte[] iv)
            {
                Requires.NotNull(baseKey, nameof(baseKey));
                Requires.NotNull(platformKey, nameof(platformKey));

                this.baseKey     = baseKey;
                this.iv          = baseKey.CopyOrZeroIV(iv);
                this.platformKey = platformKey;
            }
 /// <summary>
 /// Initializes a new instance of the <see cref="BCryptDecryptTransform"/> class.
 /// </summary>
 /// <param name="baseKey">The key that may carry state from a prior crypto operation.</param>
 /// <param name="iv">The IV to use for the next transform operation.</param>
 internal BCryptDecryptTransform(SymmetricCryptographicKey baseKey, byte[] iv)
     : base(baseKey, baseKey.GetInitializedKey(ref baseKey.decryptorKey, iv), iv)
 {
 }
            /// <summary>
            /// Initializes a new instance of the <see cref="BCryptCipherTransform"/> class.
            /// </summary>
            /// <param name="baseKey">The key that may carry state from a prior crypto operation.</param>
            /// <param name="platformKey">The stateful platform key.</param>
            /// <param name="iv">The IV to use for the next transform operation.</param>
            internal BCryptCipherTransform(SymmetricCryptographicKey baseKey, SafeKeyHandle platformKey, byte[] iv)
            {
                Requires.NotNull(baseKey, nameof(baseKey));
                Requires.NotNull(platformKey, nameof(platformKey));

                this.baseKey = baseKey;
                this.iv = baseKey.CopyOrZeroIV(iv);
                this.platformKey = platformKey;
            }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BCryptDecryptTransform"/> class.
 /// </summary>
 /// <param name="baseKey">The key that may carry state from a prior crypto operation.</param>
 /// <param name="iv">The IV to use for the next transform operation.</param>
 internal BCryptDecryptTransform(SymmetricCryptographicKey baseKey, byte[] iv)
     : base(baseKey, baseKey.GetInitializedKey(ref baseKey.decryptorKey, iv), iv)
 {
 }