public void GPPrefPwdObfuscator_Encrypt_EmptyInput() { SecureString password = new SecureString(); string result = GPPrefPwdObfuscator.Encrypt(password); Assert.AreEqual(String.Empty, result); }
public void GPPrefPwdObfuscator_Encrypt_Test1() { SecureString password = "******".ToSecureString(); string encrypted = "v9NWtCCOKEUHkZBxakMd6HLzo4+DzuizXP83EaImqF8"; string result = GPPrefPwdObfuscator.Encrypt(password); Assert.AreEqual(encrypted, result); }
public void GPPrefPwdObfuscator_Decrypt_TestVector2() { string encrypted = "v9NWtCCOKEUHkZBxakMd6IyXC7oVAVOIz0O6imVn+fM7rAFz8kC2EPSQSYob/r7+"; string decrypted = "Pa$$w0rdPa$$w0rd"; string result = GPPrefPwdObfuscator.Decrypt(encrypted); Assert.AreEqual(decrypted, result); }
public void GPPrefPwdObfuscator_Decrypt_TestVector1() { string encrypted = "v9NWtCCOKEUHkZBxakMd6HLzo4+DzuizXP83EaImqF8"; string decrypted = "Pa$$w0rd"; string result = GPPrefPwdObfuscator.Decrypt(encrypted); Assert.AreEqual(decrypted, result); }
protected override void ProcessRecord() { WriteVerbose("Decrypting GP Preferences password."); try { string password = GPPrefPwdObfuscator.Decrypt(EncryptedPassword); this.WriteObject(password); } catch (Exception ex) { ErrorRecord error = new ErrorRecord(ex, "Error1", ErrorCategory.NotSpecified, EncryptedPassword); this.WriteError(error); } }
protected override void ProcessRecord() { this.WriteVerbose("Encrypting GP Preferences password."); try { string encryptedPassword = GPPrefPwdObfuscator.Encrypt(Password); this.WriteObject(encryptedPassword); } catch (ArgumentException ex) { ErrorRecord error = new ErrorRecord(ex, "Error1", ErrorCategory.InvalidArgument, this.Password); this.WriteError(error); } }
public void GPPrefPwdObfuscator_Encrypt_NullInput() { string result = GPPrefPwdObfuscator.Encrypt(null); }
public void GPPrefPwdObfuscator_Decrypt_EmptyInput() { string result = GPPrefPwdObfuscator.Decrypt(String.Empty); }