Skip to content

tink-crypto/tink-java-apps

Repository files navigation

Tink Java Apps

Test GCP Ubuntu MacOS
Tink (Bazel) Bazel_GcpUbuntu Bazel_MacOs
Maven Maven_GcpUbuntu N/A

This repository contains extensions and applications of the Tink Java library:

The latest version of these applications is 1.11.0.

The official Tink documentation is available at https://developers.google.com/tink.

apps-paymentmethodtoken

You can add this library as a Maven dependency:

<dependency>
  <groupId>com.google.crypto.tink</groupId>
  <artifactId>apps-paymentmethodtoken</artifactId>
  <version>1.11.0</version>
</dependency>

The Javadoc for the latest release can be found here.

apps-rewardedads

You can add this library as a Maven dependency:

<dependency>
  <groupId>com.google.crypto.tink</groupId>
  <artifactId>apps-rewardedads</artifactId>
  <version>1.11.0</version>
</dependency>

The Javadoc for the latest release can be found here.

apps-webpush

You can add this library as a Maven dependency:

<dependency>
  <groupId>com.google.crypto.tink</groupId>
  <artifactId>apps-webpush</artifactId>
  <version>1.11.0</version>
</dependency>

The Javadoc for the latest release can be found here.

You can encrypt a plaintext as follows:

import com.google.crypto.tink.HybridEncrypt;
import java.security.interfaces.ECPublicKey;

ECPublicKey reicipientPublicKey = ...;
byte[] authSecret = ...;
HybridEncrypt hybridEncrypt = new WebPushHybridEncrypt.Builder()
     .withAuthSecret(authSecret)
     .withRecipientPublicKey(recipientPublicKey)
     .build();
byte[] plaintext = ...;
byte[] ciphertext = hybridEncrypt.encrypt(plaintext, null /* contextInfo, must be null */);

To decrypt:

import com.google.crypto.tink.HybridDecrypt;
import java.security.interfaces.ECPrivateKey;
import java.security.interfaces.ECPublicKey;

ECPrivateKey recipientPrivateKey = ...;
ECPublicKey  recipientPublicKey = ...;
HybridDecrypt hybridDecrypt = new WebPushHybridDecrypt.Builder()
     .withAuthSecret(authSecret)
     .withRecipientPublicKey(recipientPublicKey)
     .withRecipientPrivateKey(recipientPrivateKey)
     .build();
byte[] ciphertext = ...;
byte[] plaintext = hybridDecrypt.decrypt(ciphertext, /* contextInfo, must be null */);

Contact and mailing list

If you want to contribute, please read CONTRIBUTING and send us pull requests. You can also report bugs or file feature requests.

If you'd like to talk to the developers or get notified about major product updates, you may want to subscribe to our mailing list.

Maintainers

Tink is maintained by (A-Z):

  • Moreno Ambrosin
  • Taymon Beal
  • William Conner
  • Thomas Holenstein
  • Stefan Kölbl
  • Charles Lee
  • Cindy Lin
  • Fernando Lobato Meeser
  • Ioana Nedelcu
  • Sophie Schmieg
  • Elizaveta Tretiakova
  • Jürg Wullschleger

Alumni:

  • Haris Andrianakis
  • Daniel Bleichenbacher
  • Tanuj Dhir
  • Thai Duong
  • Atul Luykx
  • Rafael Misoczki
  • Quan Nguyen
  • Bartosz Przydatek
  • Enzo Puig
  • Laurent Simon
  • Veronika Slívová
  • Paula Vidas