After installing and setting up Tink, continue with [Next Steps](https://developers.google.com/tink/setup/cc#next_steps).

## Compatibility

|   | Compatible with all libraries | Additionally compatible with Tink C++ |
|---|---|---|
| Language | C++ \>= 17 | n/a |
| 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 | MSVC \>= 2019 |
| Build system | [Bazel](http://bazel.build) \>= 7 LTS | [CMake](https://cmake.org/) \>= 3.22 |

## Installation

### Tink C++

The core C++ library is [tink-cc](https://github.com/tink-crypto/tink-cc) with
[2.9.2](https://github.com/tink-crypto/tink-cc/releases/tag/v2.9.2) as the latest release.

## Bazel

### Bzlmod

Add this to your [`MODULE.bazel`](https://bazel.build/external/migration)
file:

    bazel_dep(name = "tink_cc", version = "2.9.2")

## CMake

Add `tink-cc` as an in-tree dependency.

    cmake_minimum_required(VERSION 3.22)
    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.9.2.zip
      URL_HASH  SHA256=f5259652e09e26ca4a00c16c009a0930c18be0568e3fe34645db4208ebb57f8c
    )
    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)

> [!NOTE]
> **Note:** Tink defines the C++ standard using the `TINK_CXX_STANDARD` variable, which is 14 by default. If you want to propagate `CMAKE_CXX_STANDARD` to Tink, use `set(CMAKE_CXX_STANDARD_REQUIRED ON)`.

### AWS KMS Extension

The Tink C++ [AWS KMS](https://aws.amazon.com/kms/) extension is
[tink-cc-awskms](https://github.com/tink-crypto/tink-cc-awskms) with
[2.0.1](https://github.com/tink-crypto/tink-cc-awskms/releases/tag/v2.0.1) as the latest
release.

## Bazel

### WORKSPACE

Add this to your `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/releases/download/v2.1.3/tink-cc-2.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()

### Google Cloud KMS Extension

The Tink C++ [Google Cloud KMS](https://cloud.google.com/kms/) extension is
[tink-cc-gcpkms](https://github.com/tink-crypto/tink-cc-gcpkms) with
[2.7.0](https://github.com/tink-crypto/tink-cc-gcpkms/releases/tag/v2.7.0) as the latest
release.

### Bazel

Add the following to your `MODULE.bazel` file:

    bazel_dep(name = "tink_cc_gcpkms")

    git_override(
        module_name = "tink_cc_gcpkms",
        remote = "https://github.com/tink-crypto/tink-cc-gcpkms",
        tag = "v2.7.0",
    )

    # ... Your dependencies here ...

## Next steps

Once you've finished setting up Tink, continue with the standard Tink usage
steps:

- [Choose a primitive](https://developers.google.com/tink/choose-primitive) -- Decide which primitive to use based on your use case
- [Manage keys](https://developers.google.com/tink/key-management-overview) -- Protect your keys with your external KMS, generate keysets, and rotate your keys