Exemplo n.º 1
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 protected override void Dispose(bool disposing)
 {
     Mode        = null;
     AesKeyBytes = AesKeyBytes.Clear();
     HmacKey     = HmacKey.SafeDispose();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Generates the key.
 /// </summary>
 /// <param name="size">The size.</param>
 protected override void GenerateKey(int size, KeyczarConfig config)
 {
     AesKeyBytes = new byte[size / 8];
     Secure.Random.NextBytes(AesKeyBytes);
     HmacKey = (HmacSha1Key)Generate(KeyType.HmacSha1, 0 /*uses default size*/);
 }