Test | GCP Ubuntu | MacOS |
---|---|---|
Tink (Bazel) | ||
Maven | N/A |
This repository contains extensions and applications of the Tink Java library:
apps-paymentmethodtoken
: An implementation of Google Payment Method Tokenapps-rewardedads
: An implementation of the verifier side of Server-Side Verification of Google AdMob Rewarded Adsapps-webpush
: An implementation of RFC 8291 - Message Encryption for Web Push
The latest version of these applications is 1.11.0.
The official Tink documentation is available at https://developers.google.com/tink.
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.
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.
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 */);
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.
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