Tink Java 1.9.0
Tink is a multi-language, cross-platform library that provides simple and misuse-proof APIs for common cryptographic tasks.
This is Tink Java 1.9.0
To get started using Tink, see the setup guide.
Maven:
<dependency>
<groupId>com.google.crypto.tink</groupId>
<artifactId>tink</artifactId>
<version>1.9.0</version>
</dependency>
Gradle:
dependencies {
implementation 'com.google.crypto.tink:tink-android:1.9.0'
}
Bazel:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "4.5"
RULES_JVM_EXTERNAL_SHA ="b17d7388feb9bfa7f2fa09031b32707df529f26c91ab9e5d909eb1676badd9a6"
http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
sha256 = RULES_JVM_EXTERNAL_SHA,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/refs/tags/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
rules_jvm_external_deps()
load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")
rules_jvm_external_setup()
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = [
"com.google.crypto.tink:tink:1.9.0",
# ... other dependencies ...
],
repositories = [
"https://repo1.maven.org/maven2",
],
)
Alternatively, one can build Tink from source, and include it with http_archive
:
http_archive(
name = "com_github_tink_crypto_tink_java",
urls = ["https://github.com/tink-crypto/tink-java/archive/refs/tags/v1.9.0.zip"],
strip_prefix = "tink-java-1.9.0",
sha256 = "9735df7992df73d1518661ac6cf8918fa4693673adaaf0bdee253c24c521c832",
)
load("@tink_java//:tink_java_deps.bzl", "TINK_MAVEN_ARTIFACTS", "tink_java_deps")
tink_java_deps()
load("@tink_java//:tink_java_deps_init.bzl", "tink_java_deps_init")
tink_java_deps_init()
# ...
maven_install(
artifacts = TINK_MAVEN_ARTIFACTS + # ... other dependencies ...
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
WARNING: When building from source users that require KMS extensions as well must now explicitly include them, since they are published in separate repositories:
For example, to use tink-java-gcpkms
your WORKSPACE
file becomes as follows (analogously for tink-java-awskms
):
http_archive(
name = "com_github_tink_crypto_tink_java",
urls = ["https://github.com/tink-crypto/tink-java/archive/refs/tags/v1.9.0.zip"],
strip_prefix = "tink-java-1.9.0",
sha256 = "9735df7992df73d1518661ac6cf8918fa4693673adaaf0bdee253c24c521c832",
)
http_archive(
name = "tink_java_gcpkms",
urls = ["https://github.com/tink-crypto/tink-java-gcpkms/archive/refs/tags/v<SOME_RELEASE>.zip"],
strip_prefix = "tink-java-gcpkms-<SOME_RELEASE>",
sha256 = ...
)
load("@tink_java//:tink_java_deps.bzl", "TINK_MAVEN_ARTIFACTS", "tink_java_deps")
tink_java_deps()
load("@tink_java//:tink_java_deps_init.bzl", "tink_java_deps_init")
tink_java_deps_init()
load("@tink_java_gcpkms//:tink_java_gcpkms_deps.bzl", "TINK_JAVA_GCPKMS_MAVEN_ARTIFACTS")
# ...
maven_install(
artifacts = TINK_MAVEN_ARTIFACTS +
TINK_JAVA_GCPKMS_MAVEN_ARTIFACTS + # ... other dependencies ...
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
Dependencies to targets in //src/main/java/com/google/crypto/tink/integration/gcpkms
now are located in @tink_java_gcpkms
.
What's new
The complete list of changes since 1.8.0 can be found here.
- Removed deprecation of some APIs
- Minor refactorings/code improvements
- Added new key/parameter interfaces for StreamingAead, DeterministicAead, HmacPrf and JwtMac
- Added new key/parameter/serialization classes:
- AesGcmHkdfStreaming
- AesCtrHmacAead
- AesCtrHmacStreaming
- AesCmacPrf
- Ed25519
- RsaSsaPkcs1
- AesSiv
- JwtHmac
- Add Refaster (https://errorprone.info/docs/refaster) templates to easily migrate away from deprecated APIs
- Improved performance of
AesGcmSiv
(commit) - Fixed Maven dependency issues:
- Upgraded dependencies:
- com.google.code.gson:gson:2.10.1
- com.google.errorprone:error_prone_annotations:2.18
- com.google.http-client:google-http-client:1.43.1
- com.google.http-client:google-http-client-gson:1.43.1
- joda-time:joda-time:2.12.5
- junit:junit:4.13.2
- androidx.annotation:annotation:1.5.0
To see what we're working towards, check our project roadmap.