What’s New

Tink

Frameworks & Libraries

A multi-language cryptography library with misuse-resistant APIs.

Latest v1.23.0 · by GoogleWebsitetink-crypto/tink-java

Changelog

v1.23.0

Tink Java v1.23.0

Changed 2
  • Upgrade protobuf-java to 4.33.6
  • Upgrade Bazel version to 9

Tink is a multi-language, cross-platform library that provides simple and misuse-proof APIs for common cryptographic tasks.

This is Tink Java 1.23.0.

The complete list of changes since 1.22.0 can be found here.

  • Upgraded dependencies:
    • com.google.protobuf:protobuf-java -> 4.33.6
  • Upgraded Bazel version to 9.
Maven:
<dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink</artifactId>
    <version>1.23.0</version>
</dependency>
Gradle:
dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.23.0'
}
Bazel:
Using bzlmod
bazel_dep(name = "tink_java")

git_override(
    module_name = "tink_java",
    remote = "https://github.com/tink-crypto/tink-java",
    tag = "v1.23.0",
)
v1.22.0

Tink Java v1.22.0

Added 4
  • Added predefined signature parameters for SLH-DSA
  • Added support for ML-DSA-44 signature primitive and PEM import
  • Added SignatureJwkSetConverter utility library that converts signature public keys from and to a JWK set
  • Added more no-prefix variants to predefined MAC and Signature parameters
Changed 2
  • Key derivation in MutableKeyDerivationRegistry no longer occurs within a synchronized block
  • Maven signatures are now ASCII-armored GPG signatures instead of binary signatures
Fixed 1
  • Tink now correctly contains class files which target Java Version 11 (major version 55)

Tink is a multi-language, cross-platform library that provides simple and misuse-proof APIs for common cryptographic tasks.

This is Tink Java 1.22.0

The complete list of changes since 1.21.0 can be found here.

  • In MutableKeyDerivationRegistry, key derivation no longer occurs within a synchronized block.
  • Maven signatures are now more usual ASCII-armored GPG signatures instead of binary signatures.
  • Added predefined signature parameters for SLH-DSA.
  • Added support for ML-DSA-44 signature primitive and PEM import.
  • Added SignatureJwkSetConverter, which is a utility library that converts signature public keys from and to a JWK set.
  • Tink now correctly contains class files which target Java Version 11 (major version 55). Tink requires Java 11 since Tink 1.19: https://github.com/tink-crypto/tink-java/releases/tag/v1.19.0. See also https://github.com/tink-crypto/tink-java/issues/68.
  • Stop running tests on API 23, in preparation for increasing Tink's minSdkVersion to 24 in line with androidx. See https://issuetracker.google.com/issues/474169350
  • Added more no-prefix variants to predefined MAC and Signature parameters.
Maven:
<dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink</artifactId>
    <version>1.22.0</version>
</dependency>
Gradle:
dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.22.0'
}
Bazel:
Using bzlmod
bazel_dep(name = "tink_java")

git_override(
    module_name = "tink_java",
    remote = "https://github.com/tink-crypto/tink-java",
    tag = "v1.22.0",
)
v1.21.0

Tink Java v1.21.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.21.0

The complete list of changes since 1.20.0 can be found here.

  • Added methods addAnnotations to KeysetHandle.Builder and getAnnotationsOrNull to KeysetHandle. This allows attaching arbitrary information to a KeysetHandle, which can be useful when one has deep stacks.
  • A set of accessor methods in RawJwt has been made public.
  • Added general support for ML-DSA-87.
  • SignaturePemKeysetReader now supports ML-DSA-65, ML-DSA-87 and Ed25519.
  • Added buildPublicKeysetHandle method to SignaturePemKeysetReader.Builder, which replaces the deprecated build method.
Maven:
<dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink</artifactId>
    <version>1.21.0</version>
</dependency>
Gradle:
dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.21.0'
}
Bazel:
Using bzlmod
bazel_dep(name = "tink_java")

git_override(
    module_name = "tink_java",
    remote = "https://github.com/tink-crypto/tink-java",
    tag = "v1.21.0",
)
v1.20.0

Tink Java v1.20.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.20.0

The complete list of changes since 1.19.0 can be found here.

  • Updated the Protobuf dependency to 4.33.0.
  • Improved performance for creating JWT signature primitives.
  • Dropped support for WORKSPACE Bazel files.
  • Allow using 32-byte keys in subtle AES-SIV primitive.
  • Fixed https://github.com/tink-crypto/tink-java/issues/63
Maven:
<dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink</artifactId>
    <version>1.20.0</version>
</dependency>
Gradle:
dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.20.0'
}
Bazel:
Using bzlmod
bazel_dep(name = "tink_java")

git_override(
    module_name = "tink_java",
    remote = "https://github.com/tink-crypto/tink-java",
    tag = "v1.20.0",
)
v1.19.0

Tink Java v1.19.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.19

The complete list of changes since 1.18.0 can be found here.

Build changes
  • For Bazel builds, we now use Bazel 7.6.1. in our tests.
  • For Bazel builds, Tink now supports bzlmod.
  • Tink no longer supports Java 8. The minimum version starting from 1.19.0 is Java 11.
Dependencies
  • Protobuf 4.28.2 was upgraded to Protobuf 4.32.1. (Note: we plan to shade protobuf in the next minor version of Tink which should resolve compatibility issues)
Obscure behaviour changes
  • Tink will reject custom key types where the Type-Url has non-ASCII characters.

  • Tink may serialize keysets slightly differently in certain cases. For example, in the serialization of a ECDSA keyset, the points might be padded differently than before. Users should not depend on the exact format of Tink's serialization.

  • Use Conscrypt's AES-CMAC implementation when available and when the input is larger than 64 byte. This may improves the performance of AES-CMAC, AES-SIV and AES-EAX for large inputs.

  • Removed usage of thread-local Ciphers for ChaCha20Poly1305.

Added APIs
  • Added public JwtEcdsaParameters.Algorithm.getEcParameterSpec method.

  • The AES-SIV implementation in subtle now accepts multiple associated datas.

Future work

To see what we're working towards, check our project roadmap.

Getting started

To get started using Tink, see the setup guide.

Maven:
<dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink</artifactId>
    <version>1.19.0</version>
</dependency>
Gradle:
dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.19.0'
}
Bazel:
Using bzlmod
bazel_dep(name = "tink_java", version = "1.19.0")

git_override(
    module_name = "tink_java",
    remote = "https://github.com/tink-crypto/tink-java",
    tag = "v1.19.0",
)
Using WORKSPACE
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:NEXT_VERSION",
        # ... 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/NEXT_VERSION.zip"],
    strip_prefix = "tink-java-NEXT_VERSION",
    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()

# ...

maven_install(
    artifacts = TINK_MAVEN_ARTIFACTS + # ... other dependencies ...
    repositories = [
        "https://repo1.maven.org/maven2",
    ],
)
v1.18.0

Tink Java v1.18.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.18.0

The complete list of changes since 1.17.0 can be found here.

Dropped support
  • Tink Android no longer supports API level 21 and 22. From Tink 1.18.0, the minimum API level is 23.

  • Removed Registry.wrap. This API cannot have been used by users: the PrimitiveSet needed for it was already moved to internal in Tink 1.13.0.

New Features
  • Use Conscrypt's implementation of Ed25519 when available.

  • Improved performance of AES-GCM-SIV.

  • Tink now provides a flag GlobalTinkFlags.validateKeysetsOnParsing(). If set to true, Tink will run certain validations on a keyset before it creates a KeysetHandle. We plan to flip the default of this flag to true in Tink 2.0.

Bug fixes
  • AeadConfig.register() now always registers AES-GCM-SIV. If it's not supported by the registered JCE Providers, it will fail when the primitive is created.

  • The Aead implementation returned by com.google.crypto.tink.integration.android.AndroidKeystore.getAead() created invalid ciphertexts on Android API version 28 and older when the input was larger than 128kB. Now, it throws an exception instead.

  • JwtHmacKey, LegacyKmsAeadKey, and LegacyKmsEnvelopeAeadKey are now final. These cannot be properly subclassed as this would break equalsKey.

Obscure behaviour changes
  • Primitive creation of AES-GCM-SIV now will fail if the algorithm is not available. Previously, this used to work with some Configurations succeeding and the primitive then failed when encrypt or decrypt was called.
Future work

To see what we're working towards, check our project roadmap.

Getting started

To get started using Tink, see the setup guide.

Maven:
<dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink</artifactId>
    <version>1.18.0</version>
</dependency>
Gradle:
dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.18.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.18.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/1.18.0.zip"],
    strip_prefix = "tink-java-1.18.0",
    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()

# ...

maven_install(
    artifacts = TINK_MAVEN_ARTIFACTS + # ... other dependencies ...
    repositories = [
        "https://repo1.maven.org/maven2",
    ],
)
v1.17.0

Tink Java v1.17.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.17.0

What's new

The complete list of changes since 1.16.0 can be found here.

New APIs

This release does not add new functionality.

Bugfixes

Tink Java 1.17.0 fixes the following bugs:

  • Memory leak in Prf. See https://github.com/tink-crypto/tink-java/issues/53. When computing Hkdf, Tink used allocateDirect to get a buffer which is only cleaned up asynchronously. This could lead to excessive memory consumption. Thanks to behrooz-stripe@ for reporting and fixing the issue!

Future work

To see what we're working towards, check our project roadmap.

Getting started

To get started using Tink, see the setup guide.

Maven:
<dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink</artifactId>
    <version>1.17.0</version>
</dependency>
Gradle:
dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.17.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.17.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.17.0.zip"],
    strip_prefix = "tink-java-1.17.0",
    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()

# ...

maven_install(
    artifacts = TINK_MAVEN_ARTIFACTS + # ... other dependencies ...
    repositories = [
        "https://repo1.maven.org/maven2",
    ],
)
v1.16.0

Tink Java v1.16.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.16.0

What's new

The complete list of changes since 1.15.0 can be found here.

  • Added new API AndroidKeystore, which is now the preferred way to interact with the Android Keystore.
  • Before this release, the decision whether to use Conscrypt was done at time of class loading of some specific internal classes. If Conscrypt was not installed before the specific class for a primitive was loaded, Conscrypt was never used. Now, the decision is made whenever a new primitive is instantiated.
  • In HPKE, use Conscrypt implementation of X25519 when available. On Android, it is available since API version 31. This makes HPKE both faster and uses less memory.
  • Updated deps:
    • protobuf (4.28.2)
  • Allow @AccessesPartialKey to be applied to fields and local variables, as well as methods and classes.
  • Added support for X-AES-GCM, which is an AEAD algorithm with extended nonce. It uses AES-CMAC for key derivation and AES-GCM for encryption. It is a generalization of the specification in https://c2sp.org/XAES-256-GCM.
  • Added configurations that allow specifying what key types are when using Tink in your application. Tink provides defaults (ConfigurationV0) that are backwards compatible with behavior before configs were introduced.

Future work

To see what we're working towards, check our project roadmap.

Getting started

To get started using Tink, see the setup guide.

Maven:
<dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink</artifactId>
    <version>1.16.0</version>
</dependency>
Gradle:
dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.16.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.16.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.16.0.zip"],
    strip_prefix = "tink-java-1.16.0",
    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()

# ...

maven_install(
    artifacts = TINK_MAVEN_ARTIFACTS + # ... other dependencies ...
    repositories = [
        "https://repo1.maven.org/maven2",
    ],
)
v1.15.0

Tink Java v1.15.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.15.0

To get started using Tink, see the setup guide.

What's new?

  • Use Conscrypt to verify RSA SSA PKCS1 signatures if it is available. This fixes a bug when Tink is used in FIPS-only mode and when using ConfigurationFips140v2.
  • Use Conscrypt for RSA SSA PSS signatures if it is available. RSA SSA PSS is now available when Tink is used in FIPS-only mode and when using ConfigurationFips140v2.
  • RsaSsaPssSignJce and RsaSsaPssVerifyJce now throw an exception if sigHash and mgf1Hash are not equal. This makes these functions consistent with the non-subtle API and with other languages.
  • Removed AeadOrDaead and EciesAeadHkdfDemHelper from subtle API. These were internal helper classes for hybrid encryption that are not needed anymore.
  • Upgraded tink-android's androidx.annotation dependency to v1.8.2.

Future work

To see what we're working towards, check our project roadmap.

Getting started

Maven:
<dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink</artifactId>
    <version>1.15.0</version>
</dependency>
Gradle:
dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.15.0'
}
Bazel:

The recommended way to use tink-java is as a Maven dependency through rules_jvm_external.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_JVM_EXTERNAL_TAG = "6.1"
RULES_JVM_EXTERNAL_SHA ="d31e369b854322ca5098ea12c69d7175ded971435e55c18dd9dd5f29cc5249ac"

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/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, 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()

maven_install(
    artifacts = [
        "com.google.crypto.tink:tink:1.15.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 = "tink_java",
    urls = ["https://github.com/tink-crypto/tink-java/releases/download/v1.15.0/tink-java-1.15.0.zip"],
    strip_prefix = "tink-java-1.15.0",
    sha256 = "e246f848f7749e37f558955ecb50345b04d79ddb9d8d1e8ae19f61e8de530582"
)

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://repo1.maven.org/maven2",
    ],
)

v1.14.1

Tink is a multi-language, cross-platform library that provides simple and misuse-proof APIs for common cryptographic tasks.

This is Tink Java 1.14.1

To get started using Tink, see the setup guide.

What's new?

  • Downgraded protobuf to 25.3; Protobuf 26.x introduced a breaking change for <= 25.x users.

Future work

To see what we're working towards, check our project roadmap.

Getting started

Maven:
<dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink</artifactId>
    <version>1.14.1</version>
</dependency>
Gradle:
dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.14.1'
}
Bazel:

The recommended way to use tink-java is as a Maven dependency through rules_jvm_external.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_JVM_EXTERNAL_TAG = "6.1"
RULES_JVM_EXTERNAL_SHA ="d31e369b854322ca5098ea12c69d7175ded971435e55c18dd9dd5f29cc5249ac"

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/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, 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()

maven_install(
    artifacts = [
        "com.google.crypto.tink:tink:1.14.1",
        # ... other dependencies ...
    ],
    repositories = [
        "https://repo1.maven.org/maven2",
    ],
)

Alternatively, one can build Tink from source and include it with http_archive:

http_archive(
    name = "tink_java",
    urls = ["https://github.com/tink-crypto/tink-java/releases/download/v1.14.1/tink-java-1.14.1.zip"],
    strip_prefix = "tink-java-1.14.1",
    sha256 = "1f8a2df8fcbfc9b19fba0d5f58cdcc12021cb33cdc307d22d840b437fd17347c"
)

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://repo1.maven.org/maven2",
    ],
)

Discussion