현재 내가 사용중인 라이브러리에서 사용가능한 알고리즘 목록을 출력할 수 있다.
버전을 올린다던지 알고리즘 변경할때 사용하면 좋을 것 같다.
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.EnvironmentPBEConfig;
import org.jasypt.exceptions.EncryptionOperationNotPossibleException;
import org.jasypt.registry.AlgorithmRegistry;
for (Object algorithm : AlgorithmRegistry.getAllPBEAlgorithms()) {
try {
StandardPBEStringEncryptor encryptor2 = new StandardPBEStringEncryptor();
encryptor2.setPassword("somePassword");
encryptor2.setAlgorithm(String.valueOf(algorithm));
String str = "test";
String encStr = encryptor2.encrypt(str);
String decStr = encryptor2.decrypt(encStr);
System.out.println("supported :::: " +algorithm);
} catch (EncryptionOperationNotPossibleException e) {
System.out.println("unsupported :::: " + algorithm);
}
}'프로그래밍' 카테고리의 다른 글
| Apache 환경 설정 방법! (0) | 2020.09.23 |
|---|---|
| ping port 확인하는 방법 ( tcping 사용법) (0) | 2020.09.21 |
| 이중화 된 서버 구조와 설명 (0) | 2020.09.14 |
| Window) Oracle Table Space 설정 방법 (0) | 2020.09.14 |
| 톰캣과 아파치를 같이 사용하는 이유는 무엇일까? (0) | 2020.09.11 |