Ejemplo n.º 1
0
 /// <summary>
 /// Hashes the specified data bytes.
 /// </summary>
 /// <param name="hashData">The hash data.</param>
 /// <returns>
 /// Hashed bytes
 /// </returns>
 protected override byte[] Hash(byte[] hashData)
 {
     using (var sha1 = CryptoAbstraction.CreateSHA1())
     {
         return(sha1.ComputeHash(hashData, 0, hashData.Length));
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DsaDigitalSignature" /> class.
        /// </summary>
        /// <param name="key">The DSA key.</param>
        /// <exception cref="ArgumentNullException"><paramref name="key"/> is <c>null</c>.</exception>
        public DsaDigitalSignature(DsaKey key)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }

            _key = key;

            _hash = CryptoAbstraction.CreateSHA1();
        }
Ejemplo n.º 3
0
 /// <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();
 }