Ejemplo n.º 1
0
        public void GPPrefPwdObfuscator_Encrypt_EmptyInput()
        {
            SecureString password = new SecureString();
            string       result   = GPPrefPwdObfuscator.Encrypt(password);

            Assert.AreEqual(String.Empty, result);
        }
Ejemplo n.º 2
0
        public void GPPrefPwdObfuscator_Encrypt_Test1()
        {
            SecureString password  = "******".ToSecureString();
            string       encrypted = "v9NWtCCOKEUHkZBxakMd6HLzo4+DzuizXP83EaImqF8";
            string       result    = GPPrefPwdObfuscator.Encrypt(password);

            Assert.AreEqual(encrypted, result);
        }
Ejemplo n.º 3
0
        public void GPPrefPwdObfuscator_Decrypt_TestVector2()
        {
            string encrypted = "v9NWtCCOKEUHkZBxakMd6IyXC7oVAVOIz0O6imVn+fM7rAFz8kC2EPSQSYob/r7+";
            string decrypted = "Pa$$w0rdPa$$w0rd";
            string result    = GPPrefPwdObfuscator.Decrypt(encrypted);

            Assert.AreEqual(decrypted, result);
        }
Ejemplo n.º 4
0
        public void GPPrefPwdObfuscator_Decrypt_TestVector1()
        {
            string encrypted = "v9NWtCCOKEUHkZBxakMd6HLzo4+DzuizXP83EaImqF8";
            string decrypted = "Pa$$w0rd";
            string result    = GPPrefPwdObfuscator.Decrypt(encrypted);

            Assert.AreEqual(decrypted, result);
        }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 7
0
 public void GPPrefPwdObfuscator_Encrypt_NullInput()
 {
     string result = GPPrefPwdObfuscator.Encrypt(null);
 }
Ejemplo n.º 8
0
 public void GPPrefPwdObfuscator_Decrypt_EmptyInput()
 {
     string result = GPPrefPwdObfuscator.Decrypt(String.Empty);
 }