@Override protected CharArrayPasswordEncoder createCharEncoder() { return new CharArrayPasswordEncoder() { StandardByteDigester digester = new StandardByteDigester(); { digester.setAlgorithm("SHA-256"); digester.setIterations(100000); digester.setSaltSizeBytes(16); digester.initialize(); } @Override public String encodePassword(char[] rawPass, Object salt) { return new String(Base64.encodeBase64(digester.digest(toBytes(rawPass)))); } @Override public boolean isPasswordValid(String encPass, char[] rawPass, Object salt) { return digester.matches(toBytes(rawPass), Base64.decodeBase64(encPass.getBytes())); } }; }
/** * Creates a new instance of <tt>PooledStandardByteDigester</tt>. */ public PooledByteDigester() { super(); this.firstDigester = new StandardByteDigester(); }
/** * Creates a new instance of <tt>PooledStandardByteDigester</tt>. */ public PooledByteDigester() { super(); this.firstDigester = new StandardByteDigester(); }
/** * Creates a new instance of <tt>PooledStandardByteDigester</tt>. */ public PooledByteDigester() { super(); this.firstDigester = new StandardByteDigester(); }
/** * Creates a new instance of <tt>StandardStringDigester</tt>. */ public StandardStringDigester() { super(); this.byteDigester = new StandardByteDigester(); this.base64 = new Base64(); }
/** * Creates a new instance of <tt>StandardStringDigester</tt>. */ public StandardStringDigester() { super(); this.byteDigester = new StandardByteDigester(); this.base64 = new Base64(); }
/** * Creates a new instance of <tt>StandardStringDigester</tt>. */ public StandardStringDigester() { super(); this.byteDigester = new StandardByteDigester(); this.base64 = new Base64(); }
/** * Creates a new instance of <tt>Digester</tt>. It will use * the default algorithm unless one is specified with * {@link #setAlgorithm(String)}. * */ public Digester() { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); }
/** * Creates a new instance of <tt>Digester</tt>. It will use * the default algorithm unless one is specified with * {@link #setAlgorithm(String)}. * */ public Digester() { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); }
/** * Creates a new instance of <tt>Digester</tt>. It will use * the default algorithm unless one is specified with * {@link #setAlgorithm(String)}. * */ public Digester() { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); }
/** * <p> * Creates a new instance of <tt>Digester</tt>, specifying * the algorithm to be used. * </p> */ public Digester(final String algorithm) { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); this.digester.setAlgorithm(algorithm); }
/** * <p> * Creates a new instance of <tt>Digester</tt>, specifying * the algorithm to be used. * </p> */ public Digester(final String algorithm) { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); this.digester.setAlgorithm(algorithm); }
/** * <p> * Creates a new instance of <tt>Digester</tt>, specifying * the algorithm to be used. * </p> */ public Digester(final String algorithm) { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); this.digester.setAlgorithm(algorithm); }
private static StandardByteDigester newStandardByteDigester(String algorithm, int iterations, int saltSizeBytes) { final StandardByteDigester standardByteDigester = new StandardByteDigester(); standardByteDigester.setAlgorithm(algorithm); standardByteDigester.setIterations(iterations); standardByteDigester.setSaltSizeBytes(saltSizeBytes); standardByteDigester.initialize(); return standardByteDigester; } }
/** * <p> * Creates a new instance of <tt>Digester</tt>, specifying * the algorithm to be used. * </p> * * @since 1.3 */ public Digester(final String algorithm, final String providerName) { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); this.digester.setAlgorithm(algorithm); this.digester.setProviderName(providerName); }
/** * <p> * Creates a new instance of <tt>Digester</tt>, specifying * the algorithm to be used. * </p> * * @since 1.3 */ public Digester(final String algorithm, final String providerName) { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); this.digester.setAlgorithm(algorithm); this.digester.setProviderName(providerName); }
/** * <p> * Creates a new instance of <tt>Digester</tt>, specifying * the algorithm to be used. * </p> * * @since 1.3 */ public Digester(final String algorithm, final Provider provider) { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); this.digester.setAlgorithm(algorithm); this.digester.setProvider(provider); }
/** * <p> * Creates a new instance of <tt>Digester</tt>, specifying * the algorithm to be used. * </p> * * @since 1.3 */ public Digester(final String algorithm, final Provider provider) { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); this.digester.setAlgorithm(algorithm); this.digester.setProvider(provider); }
/** * <p> * Creates a new instance of <tt>Digester</tt>, specifying * the algorithm to be used. * </p> * * @since 1.3 */ public Digester(final String algorithm, final Provider provider) { super(); this.digester = new StandardByteDigester(); this.digester.setIterations(ITERATIONS); this.digester.setSaltSizeBytes(SALT_SIZE_BYTES); this.digester.setAlgorithm(algorithm); this.digester.setProvider(provider); }
private LegacyJasyptPasswordEncryptor() { this.digester = new StandardByteDigester(); this.digester.setAlgorithm("SHA-256"); this.digester.setIterations(100000); this.digester.setSaltSizeBytes(16); this.digester.initialize(); this.base64 = new Base64(); }