Package ch.inftec.ju.security

Examples of ch.inftec.ju.security.JuTextEncryptor.encrypt()


  public void canEncryptText_usingBasicEncryptor() {
    JuTextEncryptor encryptor = JuSecurityUtils.buildEncryptor()
        .password("secret")
        .createTextEncryptor();
   
    String encryptedString = encryptor.encrypt("String"); // The encrypted String will not be constant...
    Assert.assertNotNull(encryptor.encrypt("String"));
    Assert.assertEquals("String", encryptor.decrypt(encryptedString));
  }
 
  @Test
View Full Code Here


    JuTextEncryptor encryptor = JuSecurityUtils.buildEncryptor()
        .password("secret")
        .createTextEncryptor();
   
    String encryptedString = encryptor.encrypt("String"); // The encrypted String will not be constant...
    Assert.assertNotNull(encryptor.encrypt("String"));
    Assert.assertEquals("String", encryptor.decrypt(encryptedString));
  }
 
  @Test
  public void canDencryptText_usingBasicEncryptor() {
View Full Code Here

    JuTextEncryptor encryptor = JuSecurityUtils.buildEncryptor()
        .strong()
        .password("secret")
        .createTextEncryptor();
   
    String encryptedString = encryptor.encrypt("String"); // The encrypted String will not be constant...
    Assert.assertNotNull(encryptor.encrypt("String"));
    Assert.assertEquals("String", encryptor.decrypt(encryptedString));
  }
}
View Full Code Here

        .strong()
        .password("secret")
        .createTextEncryptor();
   
    String encryptedString = encryptor.encrypt("String"); // The encrypted String will not be constant...
    Assert.assertNotNull(encryptor.encrypt("String"));
    Assert.assertEquals("String", encryptor.decrypt(encryptedString));
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.