All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.springframework.security.crypto.encrypt.EncryptorsCustom Maven / Gradle / Ivy

package org.springframework.security.crypto.encrypt;

import org.springframework.security.crypto.encrypt.AesBytesEncryptor.CipherAlgorithm;
import org.springframework.security.crypto.keygen.KeyGenerators;

/**
 * @see org.springframework.security.crypto.encrypt.Encryptors
 */
public class EncryptorsCustom {
  public static TextEncryptor text(CharSequence password, CharSequence salt, String alg, int iterationCount, int keyLength, String algorithm) {
    return new HexEncodingTextEncryptor(new AesBytesEncryptorCustom(password.toString(), salt, KeyGenerators.secureRandom(16), CipherAlgorithm.valueOf(alg), iterationCount, keyLength, algorithm));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy