Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.guvnor.structure.backend.config;
 
 
 import  org.guvnor.structure.server.config.PasswordService;
 import  org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
 import  org.jasypt.exceptions.EncryptionOperationNotPossibleException;
public class DefaultPasswordServiceImpl implements PasswordService {
    private static final Logger log = LoggerFactory.getLoggerDefaultPasswordServiceImpl.class );
    private static final String SECURE_STRING = System.getProperty"org.uberfire.secure.key""org.uberfire.admin" );
    private static final String SECURE_ALGORITHM = System.getProperty"org.uberfire.secure.alg""PBEWithMD5AndDES" );
    @Override
    public String encryptfinal String plainText ) {
        final StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
        encryptor.setPassword(  );
        encryptor.setAlgorithm(  );
        String result = plainText;
        try {
            result = encryptor.encrypt( plainText );
        } catch ( EncryptionOperationNotPossibleException e ) {
            .error"Unable to encrypt",
                       e );
        }
        return result;
    }
    @Override
    public String decryptfinal String encryptedText ) {
        final StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
        encryptor.setPassword(  );
        encryptor.setAlgorithm(  );
        String result = encryptedText;
        try {
            result = encryptor.decrypt( encryptedText );
        } catch ( EncryptionOperationNotPossibleException e ) {
            .error"Unable to decrypt"e );
        }
        return result;
    }
New to GrepCode? Check out our FAQ X