Method SetWriteProtectionPassword
- Namespace
- DocWright.Cryptography
- Assembly
- DocWright.Cryptography.dll
SetWriteProtectionPassword(DocumentProtection, string, OfficeHashAlgorithmKind, int, IRandomSource?)
Records a write-protection password on the settings.
public static void SetWriteProtectionPassword(DocumentProtection protection, string password, OfficeHashAlgorithmKind algorithm = OfficeHashAlgorithmKind.Sha512, int spinCount = 100000, IRandomSource? randomSource = null)
Parameters
protectionDocumentProtectionThe protection settings to update.
passwordstringThe password to record.
algorithmOfficeHashAlgorithmKindThe hash algorithm.
spinCountintThe iteration count.
randomSourceIRandomSourceThe salt source, or null for the platform RNG.
Exceptions
- ArgumentNullException
An argument is null.