Skip to content

Commit e7f8828

Browse files
committed
chore: add private key meta support
1 parent 2c35b22 commit e7f8828

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dotenvx-spring-boot/src/main/java/org/mvnsearch/dotenvx/spring/encryptor/DotenvxEncryptorImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ public class DotenvxEncryptorImpl implements DotenvxEncryptor {
2020

2121
public DotenvxEncryptorImpl(@Nullable String publicKeyHex, @Nullable String privateKeyHex, HashMap<String, String> profileKeyPairs) {
2222
this.publicKeyHex = publicKeyHex;
23-
this.privateKeyHex = privateKeyHex;
2423
this.profileKeyPairs = profileKeyPairs;
24+
if (privateKeyHex != null && privateKeyHex.contains("{")) {
25+
this.privateKeyHex = privateKeyHex.substring(0, privateKeyHex.indexOf("{"));
26+
} else {
27+
this.privateKeyHex = privateKeyHex;
28+
}
2529
}
2630

2731
/**

0 commit comments

Comments
 (0)