Last active
April 4, 2021 09:25
-
-
Save mehmetcemyucel/ea932a25248b6a8cc72e16034c02d939 to your computer and use it in GitHub Desktop.
mcy-sb-jasypt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
public class McySbJasyptApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(McySbJasyptApplication.class, args); | |
} | |
@Bean(name = "mcyEncryptor") | |
public StringEncryptor stringEncryptor() { | |
PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor(); | |
SimpleStringPBEConfig config = new SimpleStringPBEConfig(); | |
config.setPassword("anyPrivateKey"); | |
config.setAlgorithm("PBEWithMD5AndDES"); | |
config.setKeyObtentionIterations("1000"); | |
config.setPoolSize("1"); | |
config.setProviderName("SunJCE"); | |
config.setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator"); | |
config.setStringOutputType("base64"); | |
encryptor.setConfig(config); | |
return encryptor; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment