Package org.jasypt.util.text

Examples of org.jasypt.util.text.BasicTextEncryptor


    }

    @Test
    public void propsTest() throws IOException {

        BasicTextEncryptor encryptor = new BasicTextEncryptor();
        encryptor.setPassword("secret");

        Properties props = new EncryptableProperties(encryptor);
        URL url = JasyptTest.class.getClassLoader().getResource("secret.conf");

        props.load(new FileInputStream(url.getFile()));
View Full Code Here


      if (this.strongEncryption) {
        StrongTextEncryptor encryptor = new StrongTextEncryptor();
        encryptor.setPassword(this.password);
        return asJuTextEncryptor(encryptor);
      } else {
        BasicTextEncryptor encryptor = new BasicTextEncryptor();
        encryptor.setPassword(this.password);
        return asJuTextEncryptor(encryptor);
      }
    }
View Full Code Here

     * Checks that the PasswordEncoder has been correctly initialized
     * (either a text encryptor or a PBE string encryptor has been set).
     */
    private synchronized void checkInitialization() {
        if (this.useTextEncryptor == null) {
            this.textEncryptor = new BasicTextEncryptor();
            this.useTextEncryptor = Boolean.TRUE;
        } else {
            if (this.useTextEncryptor.booleanValue()) {
                if (this.textEncryptor == null) {
                    throw new EncryptionInitializationException(
View Full Code Here

     * Checks that the PasswordEncoder has been correctly initialized
     * (either a text encryptor or a PBE string encryptor has been set).
     */
    private synchronized void checkInitialization() {
        if (this.useTextEncryptor == null) {
            this.textEncryptor = new BasicTextEncryptor();
            this.useTextEncryptor = Boolean.TRUE;
        } else {
            if (this.useTextEncryptor.booleanValue()) {
                if (this.textEncryptor == null) {
                    throw new EncryptionInitializationException(
View Full Code Here

     * Checks that the PasswordEncoder has been correctly initialized
     * (either a text encryptor or a PBE string encryptor has been set).
     */
    private synchronized void checkInitialization() {
        if (this.useTextEncryptor == null) {
            this.textEncryptor = new BasicTextEncryptor();
            this.useTextEncryptor = Boolean.TRUE;
        } else {
            if (this.useTextEncryptor.booleanValue()) {
                if (this.textEncryptor == null) {
                    throw new EncryptionInitializationException(
View Full Code Here

    private String encryptedValue;
    private Properties encryptedProperties;

    @Before
    public void setUp() throws Exception {
        final BasicTextEncryptor basicTextEncryptor = new BasicTextEncryptor();
        basicTextEncryptor.setPassword(ENCRYPTION_KEY);
        encryptedValue = basicTextEncryptor.encrypt(UNENCRYPTED_VALUE);
        encryptedProperties = new Properties();
        encryptedProperties.put(KEY, encryptedValue);

    }
View Full Code Here

TOP

Related Classes of org.jasypt.util.text.BasicTextEncryptor

Copyright © 2018 www.massapicom. 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.