Package org.jasypt.exceptions

Examples of org.jasypt.exceptions.EncryptionInitializationException


     *
     * @param provider the JCE provider to be used
     */
    public void setProvider(Provider provider) {
        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 stringOutputType the type of String output
     */
    public void setStringOutputType(String stringOutputType) {
        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 config the PBEConfig to be set for the internal encryptor
     */
    public void setConfig(PBEConfig config) {
        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 message the message to be encrypted.
     * @return the encryption result.
     */
    public String encrypt(String message) {
        if (this.encryptor == null) {
            throw new EncryptionInitializationException(
                    "Encryptor has not been set into Hibernate wrapper");
        }
        return this.encryptor.encrypt(message);
    }
View Full Code Here

     * @param encryptedMessage the message to be decrypted.
     * @return the result of decryption.
     */
    public String decrypt(String encryptedMessage) {
        if (this.encryptor == null) {
            throw new EncryptionInitializationException(
                    "Encryptor has not been set into Hibernate wrapper");
        }
        return this.encryptor.decrypt(encryptedMessage);
    }
View Full Code Here

     * @param lengthBytes length in bytes.
     * @return the generated salt.
     */
    public byte[] generateSalt(int lengthBytes) {
        if (this.salt == null) {
            throw new EncryptionInitializationException(
                    "Salt has not been set");
        }
        if (this.saltBytes == null) {
            try {
                this.saltBytes = this.salt.getBytes(this.charset);
            } catch (UnsupportedEncodingException e) {
                throw new EncryptionInitializationException(
                    "Invalid charset specified: " + this.charset);
            }
        }
        if (this.saltBytes.length < lengthBytes) {
            throw new EncryptionInitializationException(
                    "Requested salt larger than set");
        }
        return ArrayUtils.subarray(this.saltBytes, 0, lengthBytes);
    }
View Full Code Here

     * @param lengthBytes length in bytes.
     * @return the generated salt.
     */
    public byte[] generateSalt(int lengthBytes) {
        if (this.salt == null) {
            throw new EncryptionInitializationException(
                    "Salt has not been set");
        }
        if (this.salt.length < lengthBytes) {
            throw new EncryptionInitializationException(
                    "Requested salt larger than set");
        }
        return ArrayUtils.subarray(this.salt, 0, lengthBytes);
    }
View Full Code Here

        super();
        try {
            this.random = SecureRandom.getInstance(secureRandomAlgorithm);
            this.random.setSeed(System.currentTimeMillis());
        } catch (NoSuchAlgorithmException e) {
            throw new EncryptionInitializationException(e);
        }
    }
View Full Code Here

     *
     * @param encryptor the encryptor.
     */
    public void setEncryptor(PBEBigDecimalEncryptor 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");
        }
        StandardPBEBigDecimalEncryptor standardPBEBigDecimalEncryptor =
            (StandardPBEBigDecimalEncryptor) 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.