HmacInfo.cs 519 B

123456789101112131415161718192021
  1. using System;
  2. using System.Diagnostics.Contracts;
  3. using System.Security.Cryptography;
  4. namespace FxSsh.Algorithms
  5. {
  6. public class HmacInfo
  7. {
  8. public HmacInfo(KeyedHashAlgorithm algorithm, int keySize)
  9. {
  10. Contract.Requires(algorithm != null);
  11. KeySize = keySize;
  12. Hmac = key => new HmacAlgorithm(algorithm, keySize, key);
  13. }
  14. public int KeySize { get; private set; }
  15. public Func<byte[], HmacAlgorithm> Hmac { get; private set; }
  16. }
  17. }