Package org.jasypt.exceptions

Examples of org.jasypt.exceptions.EncryptionInitializationException


            this.textEncryptor = new BasicTextEncryptor();
            this.useTextEncryptor = Boolean.TRUE;
        } else {
            if (this.useTextEncryptor.booleanValue()) {
                if (this.textEncryptor == null) {
                    throw new EncryptionInitializationException(
                            "PBE Password encoder not initialized: text " +
                            "encryptor is null");
                }
            } else {
                if (this.pbeStringEncryptor == null) {
                    throw new EncryptionInitializationException(
                            "PBE Password encoder not initialized: PBE " +
                            "string encryptor is null");
                }
            }
        }
View Full Code Here


            this.passwordEncryptor = new BasicPasswordEncryptor();
            this.useEncryptor = Boolean.TRUE;
        } else {
            if (this.useEncryptor.booleanValue()) {
                if (this.passwordEncryptor == null) {
                    throw new EncryptionInitializationException(
                            "Password encoder not initialized: password " +
                            "encryptor is null");
                }
            } else {
                if (this.stringDigester == null) {
                    throw new EncryptionInitializationException(
                            "Password encoder not initialized: string " +
                            "digester is null");
                }
            }
        }
View Full Code Here

        String className =
            sce.getServletContext().getInitParameter(
                    INIT_PARAM_INITIALIZER_CLASS_NAME);
       
        if (StringUtils.isEmpty(className)) {
            throw new EncryptionInitializationException(
                    INIT_PARAM_INITIALIZER_CLASS_NAME + " context " +
                    "initialization parameter not set in web.xml");
        }

        Class initializerClass = null;
        try {
            initializerClass =
                Thread.currentThread().getContextClassLoader().loadClass(className);
        } catch (ClassNotFoundException e) {
            throw new EncryptionInitializationException(e);
        }
       
        if (!WebPBEInitializer.class.isAssignableFrom(initializerClass)) {
            throw new EncryptionInitializationException("Class " +
                    className + " does not implement interface " +
                    WebPBEInitializer.class.getName());
        }
       
        WebPBEInitializer initializer = null;
        try {
            initializer =
                (WebPBEInitializer) initializerClass.newInstance();
        } catch (InstantiationException e) {
            throw new EncryptionInitializationException(e);
        } catch (IllegalAccessException e) {
            throw new EncryptionInitializationException(e);
        }

        // Let the user initialize his/her encryptors and WebPBEConfig objects.
        initializer.initializeWebPBEConfigs();
       
View Full Code Here

           
            WebPBEConfig config =
                (WebPBEConfig) configsIter.next();
           
            if (!config.isComplete()) {
                throw new EncryptionInitializationException("Incomplete " +
                        "WebPBEConfig object: all configs must specify " +
                        "both a name and a validation word");
            }
           
            strBuff.append("     <fieldset>\n");
View Full Code Here

            this.textEncryptor = new BasicTextEncryptor();
            this.useTextEncryptor = Boolean.TRUE;
        } else {
            if (this.useTextEncryptor.booleanValue()) {
                if (this.textEncryptor == null) {
                    throw new EncryptionInitializationException(
                            "PBE Password encoder not initialized: text " +
                            "encryptor is null");
                }
            } else {
                if (this.pbeStringEncryptor == null) {
                    throw new EncryptionInitializationException(
                            "PBE Password encoder not initialized: PBE " +
                            "string encryptor is null");
                }
            }
        }
View Full Code Here

    }
   
   
    public synchronized void registerConfig(WebPBEConfig config) {
        if (this.webConfigurationDone) {
            throw new EncryptionInitializationException(
                    "Cannot register: Web configuration is already done");
        }
        // Avoid duplication of encryptors because of the initialization
        // class being called more than once.
        if (!this.names.contains(config.getName())) {
View Full Code Here

            this.passwordEncryptor = new BasicPasswordEncryptor();
            this.useEncryptor = Boolean.TRUE;
        } else {
            if (this.useEncryptor.booleanValue()) {
                if (this.passwordEncryptor == null) {
                    throw new EncryptionInitializationException(
                            "Password encoder not initialized: password " +
                            "encryptor is null");
                }
            } else {
                if (this.stringDigester == null) {
                    throw new EncryptionInitializationException(
                            "Password encoder not initialized: string " +
                            "digester is null");
                }
            }
        }
View Full Code Here

                                this.providerName);
                } else {
                    this.md = MessageDigest.getInstance(this.algorithm);
                }
            } catch (NoSuchAlgorithmException e) {
                throw new EncryptionInitializationException(e);
            } catch (NoSuchProviderException e) {
                throw new EncryptionInitializationException(e);
            }
            this.initialized = true;
           
        }
       
View Full Code Here

     *
     * @param encryptor the encryptor.
     */
    public void setEncryptor(PBEByteEncryptor encryptor) {
        if (this.encryptorSet) {
            throw new EncryptionInitializationException(
                    "An encryptor has been already set: no " +
                    "further configuration possible on hibernate wrapper");
        }
        this.encryptor = encryptor;
        this.encryptorSet = true;
View Full Code Here

     *
     * @param password the password to be set for the internal encryptor
     */
    public void setPassword(String password) {
        if (this.encryptorSet) {
            throw new EncryptionInitializationException(
                    "An encryptor has been already set: no " +
                    "further configuration possible on hibernate wrapper");
        }
        StandardPBEByteEncryptor standardPBEByteEncryptor =
            (StandardPBEByteEncryptor) this.encryptor;
View Full Code Here

TOP

Related Classes of org.jasypt.exceptions.EncryptionInitializationException

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.