Skip to content

Commit a9f6404

Browse files
committed
Release 1.0.0
0 parents  commit a9f6404

35 files changed

+1059
-0
lines changed

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea/modules.xml
9+
.idea/jarRepositories.xml
10+
.idea/compiler.xml
11+
.idea/libraries/
12+
*.iws
13+
*.iml
14+
*.ipr
15+
out/
16+
!**/src/main/**/out/
17+
!**/src/test/**/out/
18+
19+
### Eclipse ###
20+
.apt_generated
21+
.classpath
22+
.factorypath
23+
.project
24+
.settings
25+
.springBeans
26+
.sts4-cache
27+
bin/
28+
!**/src/main/**/bin/
29+
!**/src/test/**/bin/
30+
31+
### NetBeans ###
32+
/nbproject/private/
33+
/nbbuild/
34+
/dist/
35+
/nbdist/
36+
/.nb-gradle/
37+
38+
### VS Code ###
39+
.vscode/
40+
41+
### Mac OS ###
42+
.DS_Store

LICENSE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
BSD 2-Clause License
2+
3+
Copyright (c) 2025, exploit.org
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9+
10+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# TKeeper SDK
2+
3+
## Add dependency
4+
To use TKeeper Client in your project, add the following dependency to your `pom.xml`:
5+
6+
### Maven
7+
```xml
8+
<dependency>
9+
<groupId>org.exploit.tkeeper</groupId>
10+
<artifactId>tss-client</artifactId>
11+
<version>1.0.0</version>
12+
</dependency>
13+
```
14+
15+
### Gradle
16+
```groovy
17+
implementation 'org.exploit:tss-client:1.0.0'
18+
```
19+
20+
## Usage
21+
First create a `TSecurityClient` instance that connects to your TKeeper node or balancer:
22+
23+
```java
24+
var client = new TSecurityClient("https://your-node", authenticator);
25+
```
26+
27+
Then you can use it to sign messages, verify signatures, and manage keys:
28+
29+
### Signing
30+
31+
```java
32+
Map<String, String> operations = Map.of(
33+
"operation1", "base64-encoded-data1",
34+
"operation2", "base64-encoded-data2"
35+
);
36+
37+
Sign request = Sign.newBuilder()
38+
.type(SessionType.FROST)
39+
.keyId("your-key-id")
40+
.operations(new OperationsDto(operations))
41+
.curve(CurveName.ED25519)
42+
.build();
43+
44+
ComputedSignature signature = client.sign(request);
45+
```
46+
47+
> GG20 session type supports only 1 operation per request. It is protocol limitation.
48+
49+
### Verifying
50+
51+
```java
52+
Verify verifyRequest = Verify.newBuilder()
53+
.keyId("your-key-id")
54+
.signature64("base64-encoded-signature")
55+
.data64("base64-encoded-data")
56+
.curve(CurveName.SECP256K1)
57+
.build();
58+
59+
VerifyResult verifyResult = client.verify(verifyRequest);
60+
```
61+
62+
### Fetching Public Key
63+
64+
```java
65+
PublicKeyDto publicKey = client.publicKey("your-key-id");
66+
```
67+
68+
### Generating Key
69+
```java
70+
// Set true if you want to overwrite existing key
71+
Generate body = new Generate("your-key-id", CurveName.SECP256K1, false);
72+
client.generate(body);
73+
```
74+
75+
### Authentication
76+
To authenticate requests, implement an `Authenticator` that provides the necessary credentials. For example, using Auth0:
77+
Out of box supported authenticators:
78+
79+
- `Auth0Authenticator` – for Auth0-based authentication
80+
- `NoAuthenticator` - no authentication
81+
82+
You can create a custom Authenticator by extending the `Authenticator` class. It should return [Jettyx](https://github.com/exploit-org/Jettyx) Authorization object in `createJettyxAuth` method.

build.gradle

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
plugins {
2+
id 'java'
3+
id 'tech.yanand.maven-central-publish' version '1.2.0'
4+
id 'signing'
5+
id 'maven-publish'
6+
}
7+
8+
group = 'org.exploit'
9+
version = '0.0.1'
10+
11+
repositories {
12+
mavenCentral()
13+
}
14+
15+
dependencies {
16+
testImplementation platform('org.junit:junit-bom:5.9.1')
17+
testImplementation 'org.junit.jupiter:junit-jupiter'
18+
compileOnly 'org.projectlombok:lombok:1.18.38'
19+
annotationProcessor 'org.projectlombok:lombok:1.18.38'
20+
implementation 'org.exploit:jettyx:0.1.6'
21+
implementation 'org.exploit:jettyx-jackson:0.1.6'
22+
implementation 'org.exploit:jettyx-http2:0.1.6'
23+
implementation 'com.auth0:auth0:2.20.0'
24+
}
25+
26+
jar {
27+
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
28+
29+
from(configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }) {
30+
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
31+
}
32+
}
33+
34+
java {
35+
withSourcesJar()
36+
withJavadocJar()
37+
}
38+
39+
tasks.withType(Javadoc).configureEach {
40+
options.addStringOption("Xdoclint:none", "-quiet")
41+
options.addBooleanOption("html5", true)
42+
options.addBooleanOption("Xdoclint:-missing", true)
43+
}
44+
45+
mavenCentral {
46+
repoDir = layout.buildDirectory.dir('repos/bundles')
47+
authToken = System.getenv("CENTRAL_MAVEN_TOKEN")
48+
publishingType = 'USER_MANAGED'
49+
}
50+
51+
52+
publishing {
53+
publications {
54+
mavenJava(MavenPublication) {
55+
from components.java
56+
57+
pom {
58+
name = 'TSS Client'
59+
description = 'TKeeper SDK'
60+
url = 'https://github.com/exploit-org/TSSClient'
61+
62+
licenses {
63+
license {
64+
name = 'Apache License 2.0'
65+
url = 'https://github.com/exploit-org/TSSClient/blob/main/LICENSE'
66+
}
67+
}
68+
69+
developers {
70+
developer {
71+
id = '0'
72+
name = 'Martin Belov'
73+
74+
}
75+
}
76+
77+
scm {
78+
connection = 'scm:git:https://github.com/exploit-org/TSSClient.git'
79+
developerConnection = 'scm:git:ssh://github.com/exploit-org/TSSClient.git'
80+
url = 'https://github.com/exploit-org/TSSClient'
81+
}
82+
}
83+
}
84+
}
85+
86+
repositories {
87+
maven {
88+
name = "Local"
89+
url = file("${buildDir}/repos/bundles")
90+
}
91+
}
92+
93+
signing {
94+
sign publishing.publications.mavenJava
95+
}
96+
}
97+
98+
test {
99+
useJUnitPlatform()
100+
}

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed May 07 14:06:21 GST 2025
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)