Настройте Tink Java

After installing and setting up Tink, continue with Next Steps .

Тинк Ява

The core Java library is tink-java with 1.23.0 as the latest release. Tink Java supports Java 11 or newer.

Мэйвен

Вы можете подключить Tink Java с помощью Maven :

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

Базель

Bazel users can add Tink Java as a dependency is by adding the following in their MODULE.bazel file:

  bazel_dep(name = "tink_java", version = "1.23.0")

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

Тинк Андроид

The core Android library is tink-java with 1.23.0 as the latest release.

Tink Android полностью поддерживается начиная с API уровня 24. Ожидается, что большинство функций Tink будут работать начиная с API уровня 23. К функциям, которые не работают сразу после установки API уровня 23, относятся:

  • The JWT library requires API level 24 since it uses classes such as java.util.Optional . This limitation can be avoided with desugaring .

  • Some APIs in com.google.crypto.tink.streamingaead use SeekableByteBufferChannel which is only available from API level 24.

Due to technical reasons, we only test Tink on Android on Google internal infrastructure. We don't expect any problems because of this, but if you encounter any problems, please file an issue.

Для работы Tink Android не требуется настройка ProGuard.

Грэдл

Вы можете использовать tink-android из Gradle :

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

Расширение AWS KMS

The Tink Java AWS KMS extension is tink-java-awskms with 2.2.0 as the latest release.

Мэйвен

You can include the Tink Java AWS KMS extension using Maven :

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

Базель

артефакт выпуска Maven

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

Расширение Google Cloud KMS

The Tink Java Google Cloud KMS extension is tink-java-gcpkms with 1.12.0 as the latest release.

Мэйвен

You can include the Tink Java Google Cloud KMS extension using Maven :

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

Базель

артефакт выпуска Maven

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

Сборка из исходного кода

Добавьте следующее в файл MODULE.bazel .

bazel_dep(name = "tink_java_gcpkms")

git_override(
    module_name = "tink_java_gcpkms",
    remote = "https://github.com/tink-crypto/tink-java-gcpkms",
    tag = "v1.12.0",
)

Приложения Tink на Java

Библиотека Tink Java Apps предоставляет реализации для токена платежного метода Google , серверной проверки рекламы Google AdMob с вознаграждением и RFC 8291 — шифрования сообщений для веб-push-уведомлений, последняя версия — 1.15.0 .

Мэйвен

You can include the Tink Java Apps library using Maven :

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

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

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

Базель

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.15.0",
        "com.google.crypto.tink:apps-paymentmethodtoken:1.15.0",
        "com.google.crypto.tink:apps-rewardedads:1.15.0",
        # ... other dependencies ...
    ],
    repositories = [
        "https://maven.google.com",
        "https://repo1.maven.org/maven2",
    ],
)

Следующие шаги

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

  • Choose a primitive – Decide which primitive to use based on your use case
  • Manage keys – Protect your keys with your external KMS, generate keysets, and rotate your keys