Tink setup

You can build Tink from source or use language-specific packages. The following instructions get you started.

C++

Tink provides the following C++ libraries:

Tink C++ (tink-cc)

Tink C++ depends on:

Tink C++ supports:

  • C++ >= 14
  • OS:
    • UbuntuLTS >= 20.04 (x86_64)
    • macOS >= 12.5 Monterey (x86_64)
    • Windows Server >= 2019 (x86_64)
  • Compiler:
    • GCC >= 7.5.0
    • Apple Clang >= 14
  • Build system:

CMake

You should add tink-cc as an in-tree dependency. For example:

cmake_minimum_required(VERSION 3.13)
project(YourProject CXX)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 14)
include(FetchContent)

# Import Tink as an in-tree dependency.
FetchContent_Declare(
  tink
  URL       https://github.com/tink-crypto/tink-cc/archive/refs/tags/v2.1.3.zip
  URL_HASH  SHA256=14a3f64a56d7e9296889d7eba7a3b8787c3281e5bc5791033c54baf810a0b6ef
)
FetchContent_GetProperties(tink)
if(NOT googletest_POPULATED)
  FetchContent_Populate(tink)
    add_subdirectory(${tink_SOURCE_DIR} ${tink_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

add_executable(your_app your_app.cc)
target_link_libraries(your_app tink::static)

Bazel

You should add the following to you project's WORKSPACE file:

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

http_archive(
    name = "tink_cc",
    urls = ["https://github.com/tink-crypto/tink-cc/archive/refs/tags/v2.1.3.zip"],
    strip_prefix = "tink-2.1.3",
    sha256 = "14a3f64a56d7e9296889d7eba7a3b8787c3281e5bc5791033c54baf810a0b6ef",
)

load("@tink_cc//:tink_cc_deps.bzl", "tink_cc_deps")

tink_cc_deps()

load("@tink_cc//:tink_cc_deps_init.bzl", "tink_cc_deps_init")

tink_cc_deps_init()

Tink C++ AWS KMS extension (tink-cc-awskms)

Tink C++ Google Cloud KMS depends on:

Tink C++ AWS KMS supports:

  • C++ >= 14
  • OS:
    • UbuntuLTS >= 20.04 (x86_64)
    • macOS >= 12.5 Monterey (x86_64)
  • Compiler:
    • GCC >= 7.5.0
    • Apple Clang >= 14
  • Build system:

Bazel

You should add the following to you project's WORKSPACE file:

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

http_archive(
    name = "tink_cc",
    urls = ["https://github.com/tink-crypto/tink-cc/archive/refs/tags/v2.1.3.zip"],
    strip_prefix = "tink-2.1.3",
    sha256 = "14a3f64a56d7e9296889d7eba7a3b8787c3281e5bc5791033c54baf810a0b6ef",
)

load("@tink_cc//:tink_cc_deps.bzl", "tink_cc_deps")

tink_cc_deps()

load("@tink_cc//:tink_cc_deps_init.bzl", "tink_cc_deps_init")

tink_cc_deps_init()

http_archive(
    name = "tink_cc_awskms",
    urls = ["https://github.com/tink-crypto/tink-cc-awskms/archive/refs/tags/v2.0.1.zip"],
    strip_prefix = "tink-cc-awskms-2.0.1",
    sha256 = "366319b269f62af120ee312ce4c99ce3738ceb23ce3f9491b4859432f8b991a4",
)

load("@tink_cc_awskms//:tink_cc_awskms_deps.bzl", "tink_cc_awskms_deps")

tink_cc_awskms_deps()

Tink C++ Google Cloud KMS extension (tink-cc-gcpkms)

Tink C++ Google Cloud KMS depends on:

Tink C++ Google Cloud KMS supports:

  • C++ >= 14
  • OS:
    • UbuntuLTS >= 20.04 (x86_64)
    • macOS >= 12.5 Monterey (x86_64)
  • Compiler:
    • GCC >= 7.5.0
    • Apple Clang >= 14
  • Build system:

Bazel

You should add the following to you project's WORKSPACE file:

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

http_archive(
    name = "tink_cc_gcpkms",
    urls = ["https://github.com/tink-crypto/tink-cc-gcpkms/releases/download/v2.2.0/tink-cc-gcpkms-2.2.0.zip"],
    strip_prefix = "tink-cc-gcpkms-2.2.0",
    sha256 = "ffb9d05c64ca28b5eb54fe79e7c3f93fad68f00e45f74f6b9ce1bd3a32b3d6fd",
)

load("@tink_cc_gcpkms//:tink_cc_gcpkms_deps.bzl", "tink_cc_gcpkms_deps")

tink_cc_gcpkms_deps()

load("@tink_cc_gcpkms//:tink_cc_gcpkms_deps_init.bzl", "tink_cc_gcpkms_deps_init")

tink_cc_gcpkms_deps_init(register_go = True)

Go

Tink provides the following Go libraries:

All the Tink Go libraries are published as Go modules that can be used with standard Go tooling or Bazel.

Tink Go (tink-go)

Go tooling

Running the following command from you project directory:

go get github.com/tink-crypto/tink-go/v2@v2.1.0

See the official Go documentation.

Bazel

If you want to use Tink Go with Bazel., you should use bazel-gazelle. You can use it as follows in your WORKSPACE:

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

http_archive(
    name = "io_bazel_rules_go",
    sha256 = "6dc2da7ab4cf5d7bfc7c949776b1b7c733f05e56edc4bcd9022bb249d2e2a996",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
    ],
)

http_archive(
    name = "bazel_gazelle",
    sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
    ],
)

TINK_GO_VERSION="2.1.0"
TINK_GO_SHA256="84b4b233fb20b570812e61ccb134d230222b79d2fd765c1d57352a53d439d746"

http_archive(
    name = "com_github_tink_crypto_tink_go_v2",
    urls = ["https://github.com/tink-crypto/tink-go/releases/download/v%s/tink-go-%s.zip" % (TINK_GO_VERSION, TINK_GO_VERSION)],
    strip_prefix = "tink-go-%s" % TINK_GO_VERSION,
    sha256 = TINK_GO_SHA256,
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

load("@com_github_tink_crypto_tink_go_v2//:deps.bzl", tink_go_dependencies="go_dependencies")

tink_go_dependencies()

#######################################
#
# Your project dependencies here.
#
#######################################

go_rules_dependencies()

go_register_toolchains(version = "1.20.10")

gazelle_dependencies()

Tink Go AWS KMS extension (tink-go-awskms)

Go tooling

Run the following command from you project directory:

go get github.com/tink-crypto/tink-go-awskms/v2@v2.0.0

See the official Go documentation.

Bazel

If you want to use the Tink Go AWS KMS extension with Bazel., you should use bazel-gazelle. You can use it as follows in your WORKSPACE:

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

http_archive(
    name = "io_bazel_rules_go",
    sha256 = "6dc2da7ab4cf5d7bfc7c949776b1b7c733f05e56edc4bcd9022bb249d2e2a996",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
    ],
)

http_archive(
    name = "bazel_gazelle",
    sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
    ],
)

# [Optional]: tink-go is imported as a go_repository by tink_go_awskms_dependencies.
# this is needed only if the user wants to pin to a specific commit/version of tink-go.
# TINK_GO_VERSION="2.1.0"
# TINK_GO_SHA256="84b4b233fb20b570812e61ccb134d230222b79d2fd765c1d57352a53d439d746"
#
# http_archive(
#     name = "com_github_tink_crypto_tink_go_v2",
#     urls = ["https://github.com/tink-crypto/tink-go/releases/download/v%s/tink-go-%s.zip" % (TINK_GO_VERSION, TINK_GO_VERSION)],
#     strip_prefix = "tink-go-%s" % TINK_GO_VERSION,
#     sha256 = TINK_GO_SHA256,
# )

http_archive(
    name = "com_github_tink_crypto_tink_go_awskms_v2",
    urls = ["https://github.com/tink-crypto/tink-go-awskms/releases/tag/v2.0.0.zip"],
    strip_prefix = "tink-go-awskms-2.0.0",
    sha256 = "8f1281ab0f04af4c114b46aeb3a5db5040604225c7797782c1274f75eb6f660c",
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

# [Optional]: tink-go is imported as a go_repository by tink_go_awskms_dependencies.
# this is needed only if the user wants to pin to a specific commit/version of tink-go.
# load("@com_github_tink_crypto_tink_go_v2//:deps.bzl", tink_go_dependencies="go_dependencies")
#
# tink_go_dependencies()

load("@com_github_tink_crypto_tink_go_awskms_v2//:deps.bzl", "tink_go_awskms_dependencies")

tink_go_awskms_dependencies()

#######################################
#
# Your project dependencies here.
#
#######################################

go_rules_dependencies()

go_register_toolchains(version = "1.19.9")

gazelle_dependencies()

Tink Go Google Cloud KMS extension (tink-go-gcpkms)

Go tooling

Run the following command from you project directory:

go get github.com/tink-crypto/tink-go-gcpkms/v2@v2.1.0

See the official Go documentation.

Bazel

If you want to use the Tink Go Google Cloud KMS extension with Bazel, you should use bazel-gazelle. You can use it as follows in your WORKSPACE:

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

# Release X.25.2 from 2024-01-09.
http_archive(
    name = "com_google_protobuf",
    sha256 = "5e8e2b369a6fcaa24fada21135782eef147aec467cd286c108936a3277e88d2b",
    strip_prefix = "protobuf-25.2",
    urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protobuf-25.2.zip"],
)

# Release from 2023-04-20
http_archive(
    name = "io_bazel_rules_go",
    sha256 = "6dc2da7ab4cf5d7bfc7c949776b1b7c733f05e56edc4bcd9022bb249d2e2a996",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
    ],
)

# Release from 2023-01-14
http_archive(
    name = "bazel_gazelle",
    sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
    ],
)

# [Optional]: tink-go is imported as a go_repository by tink_go_gcpkms_dependencies.
# this is needed only if the user wants to pin to a specific commit/version of tink-go.
# TINK_GO_VERSION="2.1.0"
# TINK_GO_SHA256="84b4b233fb20b570812e61ccb134d230222b79d2fd765c1d57352a53d439d746"
#
# http_archive(
#     name = "com_github_tink_crypto_tink_go_v2",
#     urls = ["https://github.com/tink-crypto/tink-go/releases/download/v%s/tink-go-%s.zip" % (TINK_GO_VERSION, TINK_GO_VERSION)],
#     strip_prefix = "tink-go-%s" % TINK_GO_VERSION,
#     sha256 = TINK_GO_SHA256,
# )

http_archive(
    name = "com_github_tink_crypto_tink_go_gcpkms_v2",
    urls = ["https://github.com/tink-crypto/tink-go-gcpkms/download/v2.1.0/tink-go-gcpkms-2.1.0.zip"],
    strip_prefix = "tink-go-gcpkms-2.1.0",
    sha256 = "77ab16b26b60edb46167c9177ad4081a02de0ed1f431dde9a6b2b9be59926e13",
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

# [Optional]: tink-go is imported as a go_repository by tink_go_gcpkms_dependencies.
# this is needed only if the user wants to pin to a specific commit/version of tink-go.
# load("@com_github_tink_crypto_tink_go_v2//:deps.bzl", tink_go_dependencies="go_dependencies")
#
# tink_go_dependencies()

load("@com_github_tink_crypto_tink_go_gcpkms_v2//:deps.bzl", "tink_go_gcpkms_dependencies")

tink_go_awskms_dependencies()

#######################################
#
# Your project dependencies here.
#
#######################################

go_rules_dependencies()

go_register_toolchains(version = "1.20.13")

gazelle_dependencies()

Tink Go HashiCorp Vault extension (tink-go-hcvault)

Go tooling

Run the following command from you project directory:

go get github.com/tink-crypto/tink-go-hcvault/v2@v2.1.0

See the official Go documentation.

Bazel

If you want to use the Tink HashiCorp Vault extension with Bazel., you should use bazel-gazelle. You can use it as follows in your WORKSPACE:

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

http_archive(
    name = "io_bazel_rules_go",
    sha256 = "6dc2da7ab4cf5d7bfc7c949776b1b7c733f05e56edc4bcd9022bb249d2e2a996",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.39.1/rules_go-v0.39.1.zip",
    ],
)

http_archive(
    name = "bazel_gazelle",
    sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
    ],
)

# [Optional]: tink-go is imported as a go_repository by tink_go_hcvault_dependencies.
# this is needed only if the user wants to pin to a specific commit/version of tink-go.
# TINK_GO_VERSION="2.1.0"
# TINK_GO_SHA256="84b4b233fb20b570812e61ccb134d230222b79d2fd765c1d57352a53d439d746"
#
# http_archive(
#     name = "com_github_tink_crypto_tink_go_v2",
#     urls = ["https://github.com/tink-crypto/tink-go/releases/download/v%s/tink-go-%s.zip" % (TINK_GO_VERSION, TINK_GO_VERSION)],
#     strip_prefix = "tink-go-%s" % TINK_GO_VERSION,
#     sha256 = TINK_GO_SHA256,
# )

http_archive(
    name = "com_github_tink_crypto_tink_go_hcvault_v2",
    urls = ["https://github.com/tink-crypto/tink-go-hcvault/download/v2.1.0/tink-go-hcvault-2.1.0.zip"],
    strip_prefix = "tink-go-hcvault-2.1.0",
    sha256 = "b053b67ccc308cfe1cff92d6a74b573d058c5ffe950263026f3d46cb67653def",
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

# [Optional]: tink-go is imported as a go_repository by tink_go_hcvault_dependencies.
# this is needed only if the user wants to pin to a specific commit/version of tink-go.
# load("@com_github_tink_crypto_tink_go_v2//:deps.bzl", tink_go_dependencies="go_dependencies")
#
# tink_go_dependencies()

load("@com_github_tink_crypto_tink_go_hcvault_v2//:deps.bzl", "tink_go_hcvault_dependencies")

tink_go_awskms_dependencies()

#######################################
#
# Your project dependencies here.
#
#######################################

go_rules_dependencies()

go_register_toolchains(version = "1.20.14")

gazelle_dependencies()

Java

Tink provides the following Java libraries:

Tink supports Java 8 or newer. You can either include the Tink Java Maven artifacts within your Maven or Gradle project, or use Bazel.

Tink Java (tink-java)

Maven

You can include Tink Java and the Tink Android library using Maven:

<dependency>
  <groupId>com.google.crypto.tink</groupId>
  <artifactId>tink</artifactId>
  <version>1.13.0</version>
</dependency>

If you are targeting Android, you can use tink-android from Gradle using:

dependencies {
  implementation 'com.google.crypto.tink:tink-android:1.13.0'
}

Bazel

The recommended way Bazel users can add Tink Java as a dependency is by installing the Maven release artifact using the rules_jvm_external tool in their WORKSPACE file:

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.13.0",
        # ... other dependencies ...
    ],
    repositories = [
        "https://maven.google.com",
        "https://repo1.maven.org/maven2",
    ],
)

If you want to build tink-java from source, for example to pin a specific commit, you can include it as an http_archive in your WORKSPACE file:

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

TINK_COMMIT="27b061bb9ed1af1a6f538410bff443290e427e66"
TINK_SHA256="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"

http_archive(
    name = "tink_java",
    urls = ["https://github.com/tink-crypto/tink-java/archive/%s.zip" % TINK_COMMIT],
    strip_prefix = "tink-%s" % TINK_COMMIT,
    sha256 = TINK_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()

# rules_jvm_external is imported and initialized by tink_java_deps and
# tink_java_deps_init.
load("@rules_jvm_external//:defs.bzl", "maven_install")

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

Tink Java AWS KMS extension (tink-java-awskms)

Maven

You can include Tink Java and the Tink Android library using Maven:

<dependencies>
  <dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink-awskms</artifactId>
    <version>1.9.1</version>
  </dependency>
</dependencies>

Bazel

You can install the com.google.crypto.tink:tink-awskms Maven artifact alongside com.google.crypto.tink:tink using the rules_jvm_external tool.

# ...

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

Alternatively, you can include it as an http_archive dependency:

# ...

http_archive(
    name = "tink_java",
    urls = ["https://github.com/tink-crypto/tink-java/releases/download/v1.13.0/tink-java-1.13.0.zip"],
    strip_prefix = "tink-java-1.13.0",
    sha256 = "d795e05bd264d78f438670f7d56dbe38eeb14b16e5f73adaaf20b6bb2bd11683",
)

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

http_archive(
    name = "tink_java_awskms",
    urls = ["https://github.com/tink-crypto/tink-java-awskms/releases/download/v1.9.1/tink-java-awskms-1.9.1.zip"],
    strip_prefix = "tink-java-awskms-1.9.1",
    sha256 = "57bd15391ec949660a8d4f0b0aa3cdd1bba2938a49c2a41f64349312873bcc56",
)

load("@tink_java_awskms//:tink_java_awskms_deps.bzl", "TINK_JAVA_AWSKMS_MAVEN_ARTIFACTS")

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

Tink Java Google Cloud KMS extension (tink-java-gcpkms)

Maven

<dependencies>
  <dependency>
    <groupId>com.google.crypto.tink</groupId>
    <artifactId>tink-gcpkms</artifactId>
    <version>1.10.0/version>
  </dependency>
</dependencies>

Bazel

You can install the com.google.crypto.tink:tink-gcpkms Maven artifact alongside com.google.crypto.tink:tink using the rules_jvm_external tool.

# ...

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

Alternatively, you can include it as an http_archive dependency:

# ...

http_archive(
    name = "tink_java",
    urls = ["https://github.com/tink-crypto/tink-java/releases/download/v1.13.0/tink-java-1.13.0.zip"],
    strip_prefix = "tink-java-1.13.0",
    sha256 = "d795e05bd264d78f438670f7d56dbe38eeb14b16e5f73adaaf20b6bb2bd11683",
)

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

http_archive(
    name = "tink_java_gcpkms",
    urls = ["https://github.com/tink-crypto/tink-java-gcpkms/releases/download/v1.10.0/tink-java-gcpkms-1.10.0.zip"],
    strip_prefix = "tink-java-gcpkms-1.10.0",
    sha256 = "ad85625cc4409f2f6ab13a8eef39c965501585e9323d59652cce322b3d2c09a2",
)

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",
    ],
)

Tink Java Apps extensions (tink-java-apps)

Maven

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

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

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

Bazel

You can install any of the com.google.crypto.tink:apps-* Maven artifacts using the rules_jvm_external tool.

# ...

maven_install(
    artifacts = [
        "com.google.crypto.tink:apps-webpush:1.10.0",
        "com.google.crypto.tink:apps-paymentmethodtoken:1.10.0",
        "com.google.crypto.tink:apps-rewardedads:1.10.0",
        # ... other dependencies ...
    ],
    repositories = [
        "https://maven.google.com",
        "https://repo1.maven.org/maven2",
    ],
)

ObjC

See the HOWTO on GitHub

Python

The Tink Python library, tink-py supports Python 3.8 or newer on macOS and Linux/x86_64 and Linux/Aarch64. The latest release is 1.9.0. It can be installed locally using Pip or used with Bazel.

Tink Python provides integrations with AWS KMS and Google Cloud KMS.

Pip

You can install the Tink Python binary release for your system from PyPI, by running the following command:

pip3 install tink==1.9.0
# Core Tink + Google Cloud KMS extension.
pip3 install tink[gcpkms]==1.9.0
# Core Tink + AWS KMS extension.
pip3 install tink[awskms]==1.9.0
# Core Tink + all the KMS extensions.
pip3 install tink[all]==1.9.0

If a binary package is not published for your environment, pip automatically resorts to building the project using the source distribution published to PyPI. If this is the case, you need Bazel or Bazelisk and the protobuf compiler installed to successfully build the project.

Bazel

Bazel users can include Tink Python in their WORKSPACE file as follows:

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

http_archive(
    name = "tink_py",
    urls = ["https://github.com/tink-crypto/tink-py/releases/download/v1.9.0/tink-py-1.9.0.zip"],
    strip_prefix = "tink-py-1.9.0",
    sha256 = "c5f9a7b58b79ef0e1b957154672f766489ea0ac956ad187941f950f2dc262e71",
)

load("@tink_py//:tink_py_deps.bzl", "tink_py_deps")

tink_py_deps()

load("@tink_py//:tink_py_deps_init.bzl", "tink_py_deps_init")

tink_py_deps_init("tink_py")