-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,276 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,28 @@ | ||
description = "Library for Paseto in Java, see https://github.com/paragonie/paseto for more information" | ||
apply plugin: 'java' | ||
compileJava { | ||
group = 'org.paseto4j' | ||
version = System.properties['buildNumber'] ?: '0.0.8' | ||
sourceCompatibility = 1.8 | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url "https://consensys.bintray.com/consensys" } | ||
allprojects { | ||
group = 'org.paseto4j' | ||
version = System.properties['buildNumber'] ?: '0.0.7' | ||
} | ||
|
||
dependencies { | ||
compile('com.google.guava:guava:23.5-jre') | ||
compile('com.github.jnr:jnr-ffi:2.1.8') | ||
compile('net.consensys.cava:cava-crypto:0.3.0') | ||
compile('net.consensys.cava:cava-bytes:0.3.0') | ||
compile('com.squareup.okio:okio:1.14.1') | ||
testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0') | ||
testCompile('org.junit.jupiter:junit-jupiter-params:5.2.0') | ||
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0') | ||
} | ||
subprojects { | ||
apply plugin: 'java' | ||
sourceCompatibility = 1.8 | ||
|
||
test { | ||
useJUnitPlatform() | ||
testLogging { | ||
events "passed", "skipped", "failed" | ||
dependencies { | ||
testCompile('org.junit.jupiter:junit-jupiter-api:5.2.0') | ||
testCompile('org.junit.jupiter:junit-jupiter-params:5.2.0') | ||
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.2.0') | ||
} | ||
reports { | ||
html.enabled = true | ||
|
||
test { | ||
useJUnitPlatform() | ||
testLogging { | ||
events "passed", "skipped", "failed" | ||
} | ||
reports { | ||
html.enabled = true | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apply plugin: 'java' | ||
|
||
dependencies { | ||
repositories { | ||
jcenter() | ||
maven { url 'https://jitpack.io' } | ||
maven { url 'https://consensys.bintray.com/consensys' } | ||
} | ||
|
||
dependencies { | ||
implementation 'com.github.nbaars:paseto4j:0.0.8' | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
examples/src/main/java/org/paseto4j/version2/Version2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.paseto4j.version2; | ||
|
||
import net.consensys.cava.crypto.sodium.CryptoCavaWrapper; | ||
|
||
import static net.consensys.cava.crypto.sodium.CryptoCavaWrapper.crypto_sign_ed25519_seed_keypair; | ||
|
||
public class Version2 { | ||
|
||
public static void main(String... args) { | ||
new Version2().signToken(); | ||
} | ||
|
||
private void signToken() { | ||
byte[] seed = CryptoCavaWrapper.randomBytes(32); | ||
byte[] privateKey = new byte[64]; | ||
byte[] publicKey = new byte[32]; | ||
crypto_sign_ed25519_seed_keypair(seed, publicKey, privateKey); | ||
|
||
String signedToken = Paseto.sign( | ||
privateKey, | ||
"{\"data\":\"this is a signed message\",\"expires\":\"2019-01-01T00:00:00+00:00\"}", | ||
"Paragon Initiative Enterprises"); | ||
System.out.println("Token is: " + signedToken); | ||
|
||
String token = Paseto.parse(publicKey, signedToken, "Paragon Initiative Enterprises"); | ||
System.out.println("Token is: " + token); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
rootProject.name = 'paseto4j' | ||
|
||
include 'version1' | ||
include 'version2' | ||
|
||
project(":version1").name = "paseto4j-version1" | ||
project(":version2").name = "paseto4j-version2" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/test/java/net/consensys/cava/crypto/sodium/CryptoCavaWrapperTest.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.