]>
git.datanom.net - vault.git/blob - src/test/java/dk/cbs/soa/soasi/secret/vault/security/AesGcmTest.java
1 package dk
.cbs
.soa
.soasi
.secret
.vault
.security
;
3 import static org
.junit
.jupiter
.api
.Assertions
.*;
5 import org
.junit
.jupiter
.api
.Test
;
6 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
7 import org
.springframework
.boot
.test
.context
.SpringBootTest
;
9 import lombok
.extern
.slf4j
.Slf4j
;
16 private AesGcm aesGcm
;
20 String expected
= "This text is going to be encrypted";
21 String password
= "This is the Big Secret 1234";
23 log
.info("Plain: {}", expected
);
24 String cipher
= aesGcm
.encrypt(expected
, password
);
25 log
.info("Cipher: {}", cipher
);
26 String plain
= aesGcm
.decrypt(cipher
, password
);
27 log
.info("Decrypted: {}", plain
);
29 assertEquals(expected
, plain
);
This page took 0.516959 seconds and 6 git commands to generate.