Method Compute
- Namespace
- DocWright.Cryptography
- Assembly
- DocWright.Cryptography.dll
Compute(string, OfficeHashAlgorithmKind, byte[], int, ResourceLimits?)
Computes a protection hash.
public static byte[] Compute(string password, OfficeHashAlgorithmKind algorithm, byte[] salt, int spinCount, ResourceLimits? limits = null)
Parameters
passwordstringThe password.
algorithmOfficeHashAlgorithmKindThe hash algorithm.
saltbyte[]The salt bytes.
spinCountintThe iteration count.
limitsResourceLimitsThe resource caps, or null for the defaults.
Returns
- byte[]
The hash bytes.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentOutOfRangeException
spinCountis negative.- ResourceLimitExceededException
The spin count exceeds the cap.