Skip to content

exploit-org/TSSClient

Repository files navigation

TKeeper SDK

Add dependency

To use TKeeper Client in your project, add the following dependency to your pom.xml:

Maven

<dependency>
    <groupId>org.exploit.tkeeper</groupId>
    <artifactId>tss-client</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle

implementation 'org.exploit:tss-client:1.0.0'

Usage

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:

Signing

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.

Verifying

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);

Fetching Public Key

PublicKeyDto publicKey = client.publicKey("your-key-id");

Generating Key

// Set true if you want to overwrite existing key
Generate body = new Generate("your-key-id", CurveName.SECP256K1, false);
client.generate(body);

Authentication

To authenticate requests, implement an Authenticator that provides the necessary credentials. For example, using Auth0: Out of box supported authenticators:

  • Auth0Authenticator – for Auth0-based authentication
  • NoAuthenticator - no authentication

You can create a custom Authenticator by extending the Authenticator class. It should return Jettyx Authorization object in createJettyxAuth method.

About

TKeeper SDK

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages