Package org.jasypt.exceptions

Examples of org.jasypt.exceptions.EncryptionInitializationException


           HibernatePBEEncryptorRegistry.getInstance();
       PBEStringEncryptor encryptor =
           encryptorRegistry.getPBEStringEncryptor(encryptorRegisteredName);
      
       if (encryptor == null) {
           throw new EncryptionInitializationException(
                   "No string encryptor registered for hibernate " +
                   "with name \"" + encryptorRegisteredName + "\"");
       }

       // Get the original values, which may be encrypted
View Full Code Here


           HibernatePBEEncryptorRegistry.getInstance();
       PBEStringEncryptor encryptor =
           encryptorRegistry.getPBEStringEncryptor(encryptorRegisteredName);
      
       if (encryptor == null) {
           throw new EncryptionInitializationException(
                   "No string encryptor registered for hibernate " +
                   "with name \"" + encryptorRegisteredName + "\"");
       }

       // Get the original values, which may be encrypted
View Full Code Here

           
            if ((paramAlgorithm != null) ||
                (paramPassword != null) ||
                (paramKeyObtentionIterations != null)) {
               
                throw new EncryptionInitializationException(
                        "If \"" + ParameterNaming.ENCRYPTOR_NAME +
                        "\" is specified, none of \"" +
                        ParameterNaming.ALGORITHM + "\", \"" +
                        ParameterNaming.PASSWORD + "\" or \"" +
                        ParameterNaming.KEY_OBTENTION_ITERATIONS + "\" " +
                        "can be specified");
               
            }
            this.encryptorName = paramEncryptorName;
            this.useEncryptorName = true;
           
        } else if ((paramPassword != null)) {

            this.password = paramPassword;
           
            if (paramAlgorithm != null) {
                this.algorithm = paramAlgorithm;
            }
           
            if (paramProviderName != null) {
                this.providerName = paramProviderName;
            }
           
            if (paramKeyObtentionIterations != null) {

                try {
                    this.keyObtentionIterations =
                        new Integer(
                                Integer.parseInt(paramKeyObtentionIterations));
                } catch (NumberFormatException e) {
                    throw new EncryptionInitializationException(
                            "Value specified for \"" +
                            ParameterNaming.KEY_OBTENTION_ITERATIONS +
                            "\" is not a valid integer");
                }
               
            }
           
            if (paramStringOutputType != null) {
                this.stringOutputType = paramStringOutputType;
            }
           
        } else {
           
            throw new EncryptionInitializationException(
                    "If \"" + ParameterNaming.ENCRYPTOR_NAME +
                    "\" is not specified, then \"" +
                    ParameterNaming.PASSWORD + "\" (and optionally \"" +
                    ParameterNaming.ALGORITHM + "\" and \"" +
                    ParameterNaming.KEY_OBTENTION_ITERATIONS + "\") " +
View Full Code Here

                HibernatePBEEncryptorRegistry registry =
                    HibernatePBEEncryptorRegistry.getInstance();
                PBEStringEncryptor pbeEncryptor =
                    registry.getPBEStringEncryptor(this.encryptorName);
                if (pbeEncryptor == null) {
                    throw new EncryptionInitializationException(
                            "No string encryptor registered for hibernate " +
                            "with name \"" + this.encryptorName + "\"");
                }
                this.encryptor = pbeEncryptor;
               
View Full Code Here

     *
     * @param encryptor the encryptor.
     */
    public synchronized void setEncryptor(PBEStringEncryptor 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");
        }
        StandardPBEStringEncryptor standardPBEStringEncryptor =
            (StandardPBEStringEncryptor) this.encryptor;
View Full Code Here

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

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

     * @param saltGenerator the salt generator to be set for the internal
     *                      encryptor.
     */
    public void setSaltGenerator(SaltGenerator saltGenerator) {
        if (this.encryptorSet) {
            throw new EncryptionInitializationException(
                    "An encryptor has been already set: no " +
                    "further configuration possible on hibernate wrapper");
        }
        StandardPBEStringEncryptor standardPBEStringEncryptor =
            (StandardPBEStringEncryptor) this.encryptor;
View Full Code Here

     *
     * @param providerName the name of the JCE provider (already registered)
     */
    public void setProviderName(String providerName) {
        if (this.encryptorSet) {
            throw new EncryptionInitializationException(
                    "An encryptor has been already set: no " +
                    "further configuration possible on hibernate wrapper");
        }
        StandardPBEStringEncryptor standardPBEStringEncryptor =
            (StandardPBEStringEncryptor) 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.