[]
Represents a password used to protect a document.
public class Password
Gets the list of known hash algorithms.
public static readonly IReadOnlyList<CryptographicAlgorithmSid> KnownHashes
Gets the hash algorithm used to encrypt the password.
public CryptographicAlgorithmSid HashType { get; }
Gets the number of times the hashing function shall be iteratively run.
public int SpinCount { get; }
Resets the current password.
public void ResetPassword()
Sets the current password. If password is null or empty, password will be reset.
public void SetPassword(string password, CryptographicAlgorithmSid sid = CryptographicAlgorithmSid.SHA_512, int spinCount = 50000)
password
stringThe password string.
sid
CryptographicAlgorithmSidThe password hashing algorithm.
spinCount
intThe count of hash transformations used in password generation.
Compares the current password to a specified value.
public PasswordValidationResult ValidatePassword(string password)
password
stringThe value to compare the current password to.
A PasswordValidationResult representing the result of comparison.