Property Password
Password
Gets or sets the password used to decrypt an encrypted document, or null.
Supplying a password for an unencrypted document is harmless and ignored. Omitting one for an encrypted document raises DocumentEncryptedException; supplying the wrong one raises InvalidPasswordException. Neither message repeats the value.
This is a string rather than a SecureString deliberately:
SecureString is documented by the platform as offering no protection on
non-Windows runtimes, and every crypto API this feeds takes a byte array anyway.
DocWright zeroes the material it derives; it cannot zero the caller's string.
public string? Password { get; set; }