Skip to content

Commit

Permalink
updates used jdks in travis ci, updated tink to 1.2.2, updated gradle…
Browse files Browse the repository at this point in the history
… to 6.1.1
  • Loading branch information
kmindi committed Feb 16, 2020
1 parent 996926c commit fd3b81c
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 25 deletions.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
language: java
jdk:
- oraclejdk8
- openjdk8
- oraclejdk9
- openjdk9
- oraclejdk11
- openjdk11
- oraclejdk13
- openjdk13
#- oraclejdk14
#- openjdk14
#- oraclejdk15
#- openjdk15
addons:
sonarcloud:
organization: "kmindi-github" # the key of the org you chose at step #3
Expand Down
16 changes: 1 addition & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,5 @@ repositories {
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
// https://mvnrepository.com/artifact/com.google.crypto.tink/tink
compile group: 'com.google.crypto.tink', name: 'tink', version: '1.1.1'
}

tasks.withType(Test) { task ->
jacoco {
append = false
}
}

jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.destination "${buildDir}/jacocoHtml"
}
compile group: 'com.google.crypto.tink', name: 'tink', version: '1.2.2'
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
13 changes: 12 additions & 1 deletion java_string_encryption_key_based_symmetric.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,25 @@ current_reviews: [

]
# Indicates when this example was last updated/created. Reviews don't change this.
last_updated: "2018-06-28"
last_updated: "2020-02-16"
tags: [Java, AES, GCM, AEAD]
---

## Use cases

- String encryption


## Java version

- openjdk8
- oraclejdk9
- openjdk9
- oraclejdk11
- openjdk11
- oraclejdk13
- openjdk13

## Example Code

```java
Expand Down
13 changes: 12 additions & 1 deletion java_string_sign.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,25 @@ current_reviews: [

]
# Indicates when this example was last updated/created. Reviews don't change this.
last_updated: "2018-06-28"
last_updated: "2020-02-16"
tags: [Java]
---

## Use cases

- Verifying if a string has been changed


## Java version

- openjdk8
- oraclejdk9
- openjdk9
- oraclejdk11
- openjdk11
- oraclejdk13
- openjdk13

## Example Code

```java
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.cryptoexamples.java;

import com.google.crypto.tink.Config;
import com.google.crypto.tink.KeysetHandle;
import com.google.crypto.tink.PublicKeySign;
import com.google.crypto.tink.PublicKeyVerify;
import com.google.crypto.tink.config.TinkConfig;
import com.google.crypto.tink.signature.PublicKeySignFactory;
import com.google.crypto.tink.signature.PublicKeyVerifyFactory;
import com.google.crypto.tink.signature.SignatureConfig;
import com.google.crypto.tink.signature.SignatureKeyTemplates;

import java.nio.charset.StandardCharsets;
Expand All @@ -28,7 +27,7 @@ public static void main(String[] args) {
String plainText = "Text that should be signed to prevent unknown tampering with its content.";
try {
// Initialize Tink configuration
Config.register(SignatureConfig.TINK_1_1_0);
TinkConfig.register();

// GENERATE NEW KEYPAIR
KeysetHandle privateKeysetHandle = KeysetHandle.generateNew(SignatureKeyTemplates.ED25519);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.cryptoexamples.java;

import com.google.crypto.tink.Aead;
import com.google.crypto.tink.Config;
import com.google.crypto.tink.KeysetHandle;
import com.google.crypto.tink.aead.AeadConfig;
import com.google.crypto.tink.aead.AeadFactory;
import com.google.crypto.tink.aead.AeadKeyTemplates;
import com.google.crypto.tink.config.TinkConfig;

import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
Expand All @@ -29,7 +28,7 @@ public static void main(String[] args) {

try {
// Initialize Tink configuration
Config.register(AeadConfig.TINK_1_1_0);
TinkConfig.register();

// GENERATE key
// TODO key should only be generated once and then stored in a secure location.
Expand Down

0 comments on commit fd3b81c

Please sign in to comment.