To use TKeeper Client in your project, add the following dependency to your pom.xml
:
<dependency>
<groupId>org.exploit.tkeeper</groupId>
<artifactId>tss-client</artifactId>
<version>1.0.0</version>
</dependency>
implementation 'org.exploit:tss-client:1.0.0'
First create a TSecurityClient
instance that connects to your TKeeper node or balancer:
var client = new TSecurityClient("https://your-node", authenticator);
Then you can use it to sign messages, verify signatures, and manage keys:
Map<String, String> operations = Map.of(
"operation1", "base64-encoded-data1",
"operation2", "base64-encoded-data2"
);
Sign request = Sign.newBuilder()
.type(SessionType.FROST)
.keyId("your-key-id")
.operations(new OperationsDto(operations))
.curve(CurveName.ED25519)
.build();
ComputedSignature signature = client.sign(request);
GG20 session type supports only 1 operation per request. It is protocol limitation.
Verify verifyRequest = Verify.newBuilder()
.keyId("your-key-id")
.signature64("base64-encoded-signature")
.data64("base64-encoded-data")
.curve(CurveName.SECP256K1)
.build();
VerifyResult verifyResult = client.verify(verifyRequest);
PublicKeyDto publicKey = client.publicKey("your-key-id");
// Set true if you want to overwrite existing key
Generate body = new Generate("your-key-id", CurveName.SECP256K1, false);
client.generate(body);
To authenticate requests, implement an Authenticator
that provides the necessary credentials. For example, using Auth0:
Out of box supported authenticators:
Auth0Authenticator
– for Auth0-based authenticationNoAuthenticator
- no authentication
You can create a custom Authenticator by extending the Authenticator
class. It should return Jettyx Authorization object in createJettyxAuth
method.