java获取keyvault_用于 Java 的 Azure Key Vault 库

您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

用于 Java 的 Azure Key Vault 库Azure Key Vault libraries for Java

07/20/2017

本文内容

概述Overview

使用 Azure Key Vault 保护及管理云应用程序与服务使用的加密密钥和机密。Safeguard and manage cryptographic keys and secrets used by cloud applications and services with Azure Key Vault.

若要开始使用 Azure Key Vault,请参阅 Azure Key Vault 入门。To get started with Azure Key Vault, see Get started with Azure Key Vault.

客户端库Client library

使用客户端库在 Azure Key Vault 中创建、更新和删除密钥与机密。Create, update, and delete keys and secrets in Azure Key Vault with the client libraries.

向 Maven pom.xml 文件中添加依赖项,以便在项目中使用客户端库。Add a dependency to your Maven pom.xml file to use the client library in your project.

com.microsoft.azure

azure-keyvault

1.1.2

示例Example

从 Key Vault 检索JSON Web 密钥。Retrieve a JSON web key from a Key Vault.

KeyVaultClient kvc = new KeyVaultClient(credentials);

KeyBundle returnedKeyBundle = kvc.getKey(vaultUrl, keyName);

JsonWebKey jsonKey = returnedKeyBundle.key();

管理 APIManagement API

使用 Azure Key Vault 管理库来创建 Key Vault、授权应用程序及管理权限。Use the Azure Key Vault management libraries to create key vaults, authorize applications, and manage permissions.

向 Maven pom.xml 文件中添加依赖项,以便在项目中使用管理 API。Add a dependency to your Maven pom.xml file to use the management API in your project.

com.microsoft.azure

azure-mgmt-keyvault

1.15.0

示例Example

使用服务主体 clientId 授权运行的应用程序,以便从 Key Vault 中检索机密。Authorize and application running with service principal clientId to list and retrieve secrets from a key vault.

vault1 = vault1.update()

.defineAccessPolicy()

.forServicePrincipal(clientId)

.allowKeyAllPermissions()

.allowSecretPermissions(SecretPermissions.GET)

.allowSecretPermissions(SecretPermissions.LIST)

.attach()

.apply();

示例Samples

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值