@Override protected PasswordEncoder createStringEncoder() { byte[] password = lookupPasswordFromKeyStore(); char[] chars = toChars(password); try { stringEncrypter = new StandardPBEStringEncryptor(); stringEncrypter.setPasswordCharArray(chars); if (getProviderName() != null && !getProviderName().isEmpty()) { stringEncrypter.setProviderName(getProviderName()); } stringEncrypter.setAlgorithm(getAlgorithm()); JasyptPBEPasswordEncoderWrapper encoder = new JasyptPBEPasswordEncoderWrapper(); encoder.setPbeStringEncryptor(stringEncrypter); return encoder; } finally { scramble(password); scramble(chars); } }
/** * <p> * Sets the name of the security provider to be asked for the * encryption algorithm. This security provider has to be registered * beforehand at the JVM security framework. * </p> * <p> * The provider can also be set with the {@link #setProvider(Provider)} * method, in which case it will not be necessary neither registering * the provider beforehand, * nor calling this {@link #setProviderName(String)} method to specify * a provider name. * </p> * <p> * Note that a call to {@link #setProvider(Provider)} overrides any value * set by this method. * </p> * <p> * If no provider name / provider is explicitly set, the default JVM * provider will be used. * </p> * * @param providerName the name of the security provider to be asked * for the encryption algorithm. */ public void setProviderName(final String providerName) { this.firstEncryptor.setProviderName(providerName); }
/** * <p> * Sets the name of the security provider to be asked for the * encryption algorithm. This security provider has to be registered * beforehand at the JVM security framework. * </p> * <p> * The provider can also be set with the {@link #setProvider(Provider)} * method, in which case it will not be necessary neither registering * the provider beforehand, * nor calling this {@link #setProviderName(String)} method to specify * a provider name. * </p> * <p> * Note that a call to {@link #setProvider(Provider)} overrides any value * set by this method. * </p> * <p> * If no provider name / provider is explicitly set, the default JVM * provider will be used. * </p> * * @param providerName the name of the security provider to be asked * for the encryption algorithm. */ public void setProviderName(final String providerName) { this.firstEncryptor.setProviderName(providerName); }
/** * <p> * Sets the name of the security provider to be asked for the * encryption algorithm. This security provider has to be registered * beforehand at the JVM security framework. * </p> * <p> * The provider can also be set with the {@link #setProvider(Provider)} * method, in which case it will not be necessary neither registering * the provider beforehand, * nor calling this {@link #setProviderName(String)} method to specify * a provider name. * </p> * <p> * Note that a call to {@link #setProvider(Provider)} overrides any value * set by this method. * </p> * <p> * If no provider name / provider is explicitly set, the default JVM * provider will be used. * </p> * * @param providerName the name of the security provider to be asked * for the encryption algorithm. */ public void setProviderName(final String providerName) { this.firstEncryptor.setProviderName(providerName); }
/** * Sets provider name. * * @param pName the p name */ public void setProviderName(final String pName) { if (StringUtils.isNotBlank(pName)) { LOGGER.debug("Configured Jasypt provider"); this.jasyptInstance.setProviderName(pName); } }
/** * Sets the name of the JCE provider to be used by the internal encryptor, * if a specific encryptor has not been set with <tt>setEncryptor(...)</tt>. * * @since 1.3 * * @param providerName the name of the JCE provider (already registered) */ public void setProviderName(final String providerName) { if (this.encryptorSet) { throw new EncryptionInitializationException( "An encryptor has been already set: no " + "further configuration possible on hibernate wrapper"); } final StandardPBEStringEncryptor standardPBEStringEncryptor = (StandardPBEStringEncryptor) this.encryptor; standardPBEStringEncryptor.setProviderName(providerName); }
newEncryptor.setProviderName(this.providerName);
@Override protected PasswordEncoder createStringEncoder() { byte[] password = lookupPasswordFromKeyStore(); char[] chars = toChars(password); try { stringEncrypter = new StandardPBEStringEncryptor(); stringEncrypter.setPasswordCharArray(chars); if (getProviderName() != null && !getProviderName().isEmpty()) { stringEncrypter.setProviderName(getProviderName()); } stringEncrypter.setAlgorithm(getAlgorithm()); PBEPasswordEncoder encoder = new PBEPasswordEncoder(); encoder.setPbeStringEncryptor(stringEncrypter); return encoder; } finally { scramble(password); scramble(chars); } }