设置 Tink Go
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
所有 Tink Go 库都发布为 Go 模块,可与标准 Go 工具或 Bazel 搭配使用。
安装并设置 Tink 后,请继续执行后续步骤。
Tink Go
核心 Go 库是 tink-go,最新版本为 2.4.0。
从项目目录运行以下命令:
go get github.com/tink-crypto/tink-go/v2@v2.4.0
后续步骤
完成 Tink 设置后,请继续执行标准的 Tink 使用步骤:
- 选择基元 - 根据您的用例确定要使用的基元
- 管理密钥 - 使用外部 KMS 保护密钥、生成密钥集以及轮替密钥
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# Set up Tink Go\n\nAll Tink Go libraries are published as Go modules that are usable with [standard\nGo tooling](https://pkg.go.dev/cmd/go) or [Bazel](http://bazel.build).\n\nAfter installing and setting up Tink, continue with [Next Steps](#next_steps). \n\n### Tink Go\n\nThe core Go library is [tink-go](https://github.com/tink-crypto/tink-go) with\n[2.4.0](https://github.com/tink-crypto/tink-go/releases/tag/v2.4.0) as the latest release.\n\nGo tooling\n----------\n\nRun the following command from your project directory: \n\n go get github.com/tink-crypto/tink-go/v2@v2.4.0\n\n### AWS KMS Extension\n\nThe Tink Go [AWS KMS](https://aws.amazon.com/kms/) extension is\n[tink-go-awskms](https://github.com/tink-crypto/tink-go-awskms) with\n[2.1.0](https://github.com/tink-crypto/tink-go-awskms/releases/tag/v2.1.0) as the latest\nrelease.\n\nGo tooling\n----------\n\nRun the following command from your project directory: \n\n go get github.com/tink-crypto/tink-go-awskms/v2@2.1.0\n\n### Google Cloud KMS Extension\n\nThe Tink Go [Google Cloud KMS](https://cloud.google.com/kms/) extension is\n[tink-go-gcpkms](https://github.com/tink-crypto/tink-go-gcpkms) with\n[2.2.0](https://github.com/tink-crypto/tink-go-gcpkms/releases/tag/v2.2.0) as the latest\nrelease.\n\nGo tooling\n----------\n\nRun the following command from your project directory: \n\n go get github.com/tink-crypto/tink-go-gcpkms/v2@v2.2.0\n\n### HashiCorp Vault Extension\n\nThe Tink Go [HashiCorp Vault](https://www.vaultproject.io/) extension is\n[tink-go-hcvault](https://github.com/tink-crypto/tink-go-hcvault) with\n[2.3.0](https://github.com/tink-crypto/tink-go-hcvault/releases/tag/v2.3.0) as the latest\nrelease.\n\nGo tooling\n----------\n\nRun the following command from your project directory: \n\n go get github.com/tink-crypto/tink-go-hcvault/v2@v2.3.0\n\nNext steps\n----------\n\nOnce you've finished setting up Tink, continue with the standard Tink usage\nsteps:\n\n- [Choose a primitive](/tink/choose-primitive) -- Decide which primitive to use based on your use case\n- [Manage keys](/tink/key-management-overview) -- Protect your keys with your external KMS, generate keysets, and rotate your keys"]]