Class OfficeHashAlgorithm
- Namespace
- DocWright.Cryptography
- Assembly
- DocWright.Cryptography.dll
Maps the algorithm names used in ECMA-376 encryption and protection descriptors onto BCL implementations.
public static class OfficeHashAlgorithm
- Inheritance
-
OfficeHashAlgorithm
- Inherited Members
Remarks
Dispatch is an explicit switch rather than HashAlgorithm.Create(name) or
CryptoConfig: those resolve by reflection over a name table, which the trim and AOT
analyzers reject and which would let a document name any algorithm registered on the
machine. A switch keeps the set of reachable algorithms to the ones written here.
Methods
- Create(OfficeHashAlgorithmKind)
Creates a hash algorithm instance.
- CreateHmac(OfficeHashAlgorithmKind, byte[])
Creates a keyed HMAC instance.
- GetHashSize(OfficeHashAlgorithmKind)
Returns the digest length in bytes.
- Parse(string?)
Parses an algorithm name as it appears in a
w:algorithmNameattribute or an agilehashAlgorithmattribute.