Class HashCryptographer
- Namespace
- Ecng.Security.Cryptographers
- Assembly
- Ecng.Security.dll
Represents basic cryptography services for a HashAlgorithm.
public class HashCryptographer : Disposable, IDisposable
- Inheritance
-
HashCryptographer
- Implements
- Inherited Members
- Extension Methods
Constructors
HashCryptographer(HashAlgorithm, byte[])
Initialize a new instance of the HashCryptographer with an algorithm type and key.
public HashCryptographer(HashAlgorithm algorithm, byte[] key = null)
Parameters
algorithm
HashAlgorithmA fully qualifed type name derived from HashAlgorithm.
key
byte[]The key for a KeyedHashAlgorithm.
Remarks
While this overload will work with a specified HashAlgorithm, the protectedKey is only relevant when initializing with a specified KeyedHashAlgorithm.
Methods
ComputeHash(byte[])
Computes the hash value of the plaintext.
public byte[] ComputeHash(byte[] plaintext)
Parameters
plaintext
byte[]The plaintext in which you wish to hash.
Returns
- byte[]
The resulting hash.
DisposeManaged()
Disposes the managed resources. Override this method to add custom clean up of managed resources.
protected override void DisposeManaged()