-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44310d7
commit 4c4c492
Showing
3 changed files
with
49 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,40 @@ | ||
1. Generating the encrypted value: | ||
# Encrypting properties file in Spring boot | ||
|
||
Download and extract from http://www.jasypt.org/download.html | ||
1.Generating the encrypted value: | ||
|
||
Download and extract from <http://www.jasypt.org/download.html> | ||
|
||
Run the below from the bin of the extracted download: | ||
|
||
WINDOWS :- encrypt.bat input="testuser" password=MY_PASS | ||
LINUX :- ./encrypt.sh input="postgres" password=INDsolv | ||
```bash | ||
WINDOWS :- encrypt.bat input="testuser" password=MY_PASS | ||
LINUX :- ./encrypt.sh input="postgres" password=INDsolv | ||
``` | ||
|
||
2.Added dependency to the project: | ||
|
||
2. Added dependency to the project: | ||
```bash | ||
<dependency> | ||
<groupId>com.github.ulisesbocchio</groupId> | ||
<artifactId>jasypt-spring-boot-starter</artifactId> | ||
<version>1.14</version> | ||
</dependency> | ||
``` | ||
|
||
<dependency> | ||
<groupId>com.github.ulisesbocchio</groupId> | ||
<artifactId>jasypt-spring-boot-starter</artifactId> | ||
<version>1.14</version> | ||
</dependency> | ||
3.Using encrypted username/password in properties.yml: | ||
|
||
3. Using encrypted username/password in properties.yml: | ||
Place the generated text between `“ENC(” and “)”` | ||
Build the project. | ||
|
||
Place the generated text between “ENC(” and “)” | ||
Build the project. | ||
4.Running your project using spring-boot:run: Run the below from project directory: | ||
|
||
4. Running your project using spring-boot:run: Run the below from project directory: | ||
|
||
mvn spring-boot:run -Djasypt.encryptor.password=MY_PASS | ||
./gradlew bootRun -Djasypt.encryptor.password=MY_PASS | ||
|
||
5. Running project’s jar: | ||
Run the below from project target directory: | ||
```bash | ||
mvn spring-boot:run -Djasypt.encryptor.password=MY_PASS | ||
./gradlew bootRun -Djasypt.encryptor.password=MY_PASS | ||
``` | ||
|
||
java -jar target\jasypt-test-0.0.1-SNAPSHOT.jar --jasypt.encryptor.password=MY_PASS | ||
|
||
5.Running project’s jar: Run the below from project target directory: | ||
|
||
```bash | ||
java -jar target\jasypt-test-0.0.1-SNAPSHOT.jar --jasypt.encryptor.password=MY_PASS | ||
``` |