@Test public void testEncrypt() { String dummyPassword = "abcd"; assertEquals("ENCRYPT:abcd", new DecryptPassword(encryptor, decryptor).encrypt(dummyPassword)); }
public String encrypt(String unencryptedValue) { if (unencryptedValue==null) { return null; } final ExpressionParser expressionParser = new SpelExpressionParser(); final Expression encryptExpression = expressionParser.parseExpression(encryptorImpl); final StandardEvaluationContext context = new StandardEvaluationContext(); context.setVariable("stringToEncrypt", unencryptedValue); return encryptExpression.getValue(context, String.class); }
DecryptPassword { public String encrypt(String unencryptedValue) { if (unencryptedValue==null) { return null; } final ExpressionParser expressionParser = new SpelExpressionParser(); final Expression encryptExpression = expressionParser.parseExpression(encryptorImpl); final StandardEvaluationContext context = new StandardEvaluationContext(); context.setVariable("stringToEncrypt", unencryptedValue); return encryptExpression.getValue(context, String.class); } }
DecryptPassword { public String encrypt(String unencryptedValue) { if (unencryptedValue==null) { return null; } final ExpressionParser expressionParser = new SpelExpressionParser(); final Expression encryptExpression = expressionParser.parseExpression(encryptorImpl); final StandardEvaluationContext context = new StandardEvaluationContext(); context.setVariable("stringToEncrypt", unencryptedValue); return encryptExpression.getValue(context, String.class); } DecryptPassword();  DecryptPassword(String encryptImpl, String decryptImpl); }
DecryptPassword { public String encrypt(String unencryptedValue) { if (unencryptedValue==null) { return null; } final ExpressionParser expressionParser = new SpelExpressionParser(); final Expression encryptExpression = expressionParser.parseExpression(encryptorImpl); final StandardEvaluationContext context = new StandardEvaluationContext(); context.setVariable("stringToEncrypt", unencryptedValue); return encryptExpression.getValue(context, String.class); } DecryptPassword();  DecryptPassword(String encryptImpl, String decryptImpl); String decrypt(char[] encyptedValue); String decrypt(String encryptedValue); String encrypt(String unencryptedValue); }
DecryptPassword { public String encrypt(String unencryptedValue) { if (unencryptedValue==null) { return null; } final ExpressionParser expressionParser = new SpelExpressionParser(); final Expression encryptExpression = expressionParser.parseExpression(encryptorImpl); final StandardEvaluationContext context = new StandardEvaluationContext(); context.setVariable("stringToEncrypt", unencryptedValue); return encryptExpression.getValue(context, String.class); } DecryptPassword();  DecryptPassword(String encryptImpl, String decryptImpl); String decrypt(char[] encyptedValue); String decrypt(String encryptedValue); String encrypt(String unencryptedValue);  }