@@ -21,12 +21,15 @@ public class KmsService {
21
21
@ Value ("${aws.kms.keyId}" )
22
22
private static String KEY_ID ;
23
23
24
- @ Value ("${spring.profiles.active}" )
25
- private static String PROFILE ;
24
+ // @Value("${spring.profiles.active}")
25
+ // private static String PROFILE;
26
26
27
27
public String encrypt (String text ) {
28
+ // AWSKMS kmsClient = AWSKMSClientBuilder.standard()
29
+ // .withCredentials(new ProfileCredentialsProvider(PROFILE))
30
+ // .withRegion(Regions.AP_NORTHEAST_2)
31
+ // .build();
28
32
AWSKMS kmsClient = AWSKMSClientBuilder .standard ()
29
- .withCredentials (new ProfileCredentialsProvider (PROFILE ))
30
33
.withRegion (Regions .AP_NORTHEAST_2 )
31
34
.build ();
32
35
@@ -40,10 +43,13 @@ public String encrypt(String text) {
40
43
}
41
44
42
45
public String decrypt (String cipherBase64 ) {
46
+ // AWSKMS kmsClient = AWSKMSClientBuilder.standard()
47
+ // .withCredentials(new ProfileCredentialsProvider(PROFILE))
48
+ // .withRegion(Regions.AP_NORTHEAST_2)
49
+ // .build();
43
50
AWSKMS kmsClient = AWSKMSClientBuilder .standard ()
44
- .withCredentials (new ProfileCredentialsProvider (PROFILE ))
45
- .withRegion (Regions .AP_NORTHEAST_2 )
46
- .build ();
51
+ .withRegion (Regions .AP_NORTHEAST_2 )
52
+ .build ();
47
53
48
54
DecryptRequest request = new DecryptRequest ();
49
55
request .withKeyId (KEY_ID );
0 commit comments