static SecureString GetKeyPassword(string keyId, string userId) { PasswordForm form = new PasswordForm(); form.DescriptionText = "A password is needed to unlock the secret key for " + userId; return(form.ShowDialog() == DialogResult.OK ? form.GetPassword() : null); }
static SecureString GetDecryptionPassword() { PasswordForm form = new PasswordForm(); form.DescriptionText = "This data is encrypted with a password. Enter the password to decrypt the data."; return(form.ShowDialog() == DialogResult.OK ? form.GetPassword() : null); }