Created
September 11, 2018 20:00
-
-
Save mizanRahman/dc6af0160a0d79778b1276e3e66a3d16 to your computer and use it in GitHub Desktop.
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
package com.example.kpcat; | |
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; | |
import org.jasypt.encryption.StringEncryptor; | |
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor; | |
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig; | |
import org.springframework.boot.CommandLineRunner; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.annotation.Bean; | |
@SpringBootApplication | |
@EnableEncryptableProperties | |
public class KpcatApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(KpcatApplication.class, args); | |
} | |
@Bean("jasyptStringEncryptor") | |
public StringEncryptor stringEncryptor() { | |
return new StringEncryptor() { | |
@Override | |
public String encrypt(String message) { | |
return "encrypted " + message; | |
} | |
@Override | |
public String decrypt(String encryptedMessage) { | |
return "decrypted " + encryptedMessage; | |
} | |
}; | |
} | |
} |
Author
mizanRahman
commented
Sep 11, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment