Skip to content

Commit 6f55884

Browse files
authored
Update tink to 1.1.1 (#1)
1 parent 87776e8 commit 6f55884

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repositories {
1717
dependencies {
1818
testCompile group: 'junit', name: 'junit', version: '4.12'
1919
// https://mvnrepository.com/artifact/com.google.crypto.tink/tink
20-
compile group: 'com.google.crypto.tink', name: 'tink', version: '1.1.0'
20+
compile group: 'com.google.crypto.tink', name: 'tink', version: '1.1.1'
2121
}
2222

2323
tasks.withType(Test) { task ->
@@ -32,4 +32,4 @@ jacocoTestReport {
3232
csv.enabled false
3333
html.destination "${buildDir}/jacocoHtml"
3434
}
35-
}
35+
}

src/main/java/com/cryptoexamples/java/ExampleSignatureInOneMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static void main(String[] args) {
3636

3737
// SIGN DATA/STRING
3838
byte[] signatureBytes = signer.sign(plainText.getBytes(StandardCharsets.UTF_8));
39-
String signatureForPlainTextString = new String(Base64.getEncoder().encode(signatureBytes),StandardCharsets.UTF_8);
39+
String signatureForPlainTextString = new String(Base64.getEncoder().encode(signatureBytes), StandardCharsets.UTF_8);
4040
LOGGER.log(Level.INFO, () -> String.format("Signature: %s", signatureForPlainTextString));
4141

4242
// VERIFY JUST CREATED SIGNATURE USING PUBLIC KEY

src/main/java/com/cryptoexamples/java/ExampleStringEncryptionKeyBasedInOneMethod.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ public static void main(String[] args) {
3737

3838
// ENCRYPTION
3939
Aead aeadEncryption = AeadFactory.getPrimitive(keysetHandle);
40-
byte[] cipherTextBytes = aeadEncryption.encrypt(plainText.getBytes(StandardCharsets.UTF_8),null);
40+
byte[] cipherTextBytes = aeadEncryption.encrypt(plainText.getBytes(StandardCharsets.UTF_8), null);
4141
// conversion of raw bytes to BASE64 representation
4242
String cipherText = new String(Base64.getEncoder().encode(cipherTextBytes));
4343

4444
// DECRYPTION
4545
Aead aeadDecryption = AeadFactory.getPrimitive(keysetHandle);
4646
byte[] decryptedCipherTextBytes = aeadDecryption.decrypt(Base64.getDecoder().decode(cipherText), null);
47-
String decryptedCipherText = new String(decryptedCipherTextBytes,StandardCharsets.UTF_8);
47+
String decryptedCipherText = new String(decryptedCipherTextBytes, StandardCharsets.UTF_8);
4848

4949
LOGGER.log(Level.INFO, () -> String.format("Decrypted and original plain text are the same: %b", decryptedCipherText.compareTo(plainText) == 0));
5050
} catch (GeneralSecurityException e) {

0 commit comments

Comments
 (0)