/// <summary> /// Hashes the specified data bytes. /// </summary> /// <param name="hashData">The hash data.</param> /// <returns> /// Hashed bytes /// </returns> protected virtual byte[] Hash(byte[] hashData) { using (var sha1 = CryptoAbstraction.CreateSha1()) { return(sha1.ComputeHash(hashData, 0, hashData.Length)); } }
/// <summary> /// Initializes a new instance of the <see cref="DsaDigitalSignature" /> class. /// </summary> /// <param name="key">The DSA key.</param> /// <exception cref="System.ArgumentNullException">key</exception> public DsaDigitalSignature(DsaKey key) { if (key == null) { throw new ArgumentNullException("key"); } _key = key; _hash = CryptoAbstraction.CreateSha1(); }
/// <summary> /// Initializes a new instance of the <see cref="RsaDigitalSignature"/> class. /// </summary> /// <param name="rsaKey">The RSA key.</param> public RsaDigitalSignature(RsaKey rsaKey) : base(new ObjectIdentifier(1, 3, 14, 3, 2, 26), new RsaCipher(rsaKey)) { _hash = CryptoAbstraction.CreateSha1(); }