Table of Contents

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

protection DocumentProtection

The protection settings to update.

password string

The password to record.

algorithm OfficeHashAlgorithmKind

The hash algorithm.

spinCount int

The iteration count.

randomSource IRandomSource

The salt source, or null for the platform RNG.

Exceptions

ArgumentNullException

An argument is null.