-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Correct Azure Key Vault Certificates .md files content inconsistency and unclear #10118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
c47eeee
2b3e1f0
3971c5f
4430d07
255bedf
fbf5880
4d773e2
cacc6a9
761b9b1
6e08140
075c55e
c90c2ee
c45e6f4
3cf136c
9ed02cf
1fbc9a5
712d776
3df4032
194b680
16d32dd
7da161b
5c442b8
5acc225
5b34fee
eaab0bb
5cd962a
9b0fcdb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| # Azure Key Vault Certificate client library for Java | ||
| Azure Key Vault allows you to create and store certificates in the Key Vault. Azure Key Vault client supports certificates backed by Rsa keys and Ec keys. It allows you to securely manage, tightly control your certificates. | ||
| Azure Key Vault allows you to securely manage and tightly control your certificates. Azure Key Vault Certificate client library supports certificates backed by RSA and EC keys. | ||
|
|
||
| Multiple certificates, and multiple versions of the same certificate, can be kept in the Key Vault. Cryptographic keys in Key Vault backing the certificates are represented as [JSON Web Key [JWK]](https://tools.ietf.org/html/rfc7517) objects. This library offers operations to create, retrieve, update, delete, purge, backup, restore and list the certificates and its versions. | ||
| Multiple certificates, and multiple versions of the same certificate, can be kept in the Key Vault. Cryptographic keys in Key Vault backing the certificates are represented as [JSON Web Key [JWK]](https://tools.ietf.org/html/rfc7517) objects. This library offers operations to create, retrieve, update, delete, purge, backup, restore, and list the certificates and its versions. | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
||
| [Source code][source_code] | [API reference documentation][api_documentation] | [Product documentation][azkeyvault_docs] | [Samples][certificates_samples] | ||
|
|
||
|
|
@@ -31,12 +31,12 @@ Maven dependency for Azure Key Client library. Add it to your project's pom file | |
| ``` | ||
|
|
||
| ### Authenticate the client | ||
| In order to interact with the Key Vault service, you'll need to create an instance of the [CertificateClient](#create-certificate-client) class. You would need a **vault url** and **client secret credentials (client id, client key, tenant id)** to instantiate a client object using the default `AzureCredential` examples shown in this document. | ||
| In order to interact with the Key Vault service, you'll need to create an instance of the [CertificateClient](#create-certificate-client) class. You need a **vault url** and **client secret credentials (client id, client secret, tenant id)** to instantiate a client object using the `DefaultAzureCredential` examples shown in this document. | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
||
| The `DefaultAzureCredential` way of authentication by providing client secret credentials is being used in this getting started section but you can find more ways to authenticate with [azure-identity][azure_identity]. | ||
|
|
||
| #### Create/Get credentials | ||
| To create/get client key credentials you can use the [Azure Portal][azure_create_application_in_portal], [Azure CLI][azure_keyvault_cli_full] or [Azure Cloud Shell](https://shell.azure.com/bash) | ||
| To create/get client secret credentials you can use the [Azure Portal][azure_create_application_in_portal], [Azure CLI][azure_keyvault_cli_full] or [Azure Cloud Shell](https://shell.azure.com/bash) | ||
|
|
||
| Here is [Azure Cloud Shell](https://shell.azure.com/bash) snippet below to | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
@@ -58,7 +58,7 @@ Here is [Azure Cloud Shell](https://shell.azure.com/bash) snippet below to | |
| } | ||
| ``` | ||
|
|
||
| * Use the above returned credentials information to set **AZURE_CLIENT_ID**(appId), **AZURE_CLIENT_SECRET**(password) and **AZURE_TENANT_ID**(tenant) environment variables. The following example shows a way to do this in Bash: | ||
| * Use the above returned credentials information to set **AZURE_CLIENT_ID** (appId), **AZURE_CLIENT_SECRET** (password), and **AZURE_TENANT_ID** (tenantId) environment variables. The following example shows a way to do this in Bash: | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```Bash | ||
| export AZURE_CLIENT_ID="generated-app-ID" | ||
|
|
@@ -69,7 +69,7 @@ Here is [Azure Cloud Shell](https://shell.azure.com/bash) snippet below to | |
| * Grant the above mentioned application authorization to perform key operations on the keyvault: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to perform certificate operations?
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```Bash | ||
| az keyvault set-policy --name <your-key-vault-name> --spn $AZURE_CLIENT_ID --certificate-permissions backup delete get list create | ||
| az keyvault set-policy --name <your-key-vault-name> --spn $AZURE_CLIENT_ID --certificate-permissions backup delete get list create update | ||
| ``` | ||
|
|
||
| > --certificate-permissions: | ||
|
|
@@ -87,6 +87,7 @@ Once you've populated the **AZURE_CLIENT_ID**, **AZURE_CLIENT_SECRET** and **AZU | |
| ```Java | ||
| import com.azure.identity.DefaultAzureCredentialBuilder; | ||
| import com.azure.security.keyvault.certificates.CertificateClient; | ||
| import com.azure.security.keyvault.certificates.CertificateClientBuilder; | ||
|
|
||
| CertificateClient client = new CertificateClientBuilder() | ||
| .vaultUrl(<your-vault-url>) | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
@@ -108,7 +109,7 @@ The Certificate client performs the interactions with the Azure Key Vault servic | |
|
|
||
| ## Examples | ||
| ### Sync API | ||
| The following sections provide several code snippets covering some of the most common Azure Key Vault Key Service tasks, including: | ||
| The following sections provide several code snippets covering some of the most common Azure Key Vault Certificate Service tasks, including: | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
| - [Create a Certificate](#create-a-certificate) | ||
| - [Retrieve a Certificate](#retrieve-a-certificate) | ||
| - [Update an existing Certificate](#update-an-existing-certificate) | ||
|
|
@@ -117,15 +118,19 @@ The following sections provide several code snippets covering some of the most c | |
|
|
||
| ### Create a Certificate | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
| Create a Certificate to be stored in the Azure Key Vault. | ||
| - `beginCreateCertificate` creates a new certificate in the key vault. if the certificate with name already exists then a new version of the certificate is created. | ||
| Create a certificate to be stored in the Azure Key Vault. | ||
| - `beginCreateCertificate` creates a new certificate in the Azure Key Vault. if the certificate with name already exists then a new version of the certificate is created. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should all certificate be updated to Certificate?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be the other way around.
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```Java | ||
| import com.azure.core.util.polling.LongRunningOperationStatus; | ||
| import com.azure.core.util.polling.SyncPoller; | ||
| import com.azure.identity.DefaultAzureCredentialBuilder; | ||
| import com.azure.security.keyvault.certificates.models.Certificate; | ||
| import com.azure.security.keyvault.certificates.models.CertificatePolicy; | ||
| import com.azure.security.keyvault.certificates.models.CertificateOperation; | ||
| import com.azure.security.keyvault.certificates.CertificateClient; | ||
| import com.azure.security.keyvault.certificates.CertificateClientBuilder; | ||
| import com.azure.security.keyvault.certificates.models.CertificateOperation; | ||
| import com.azure.security.keyvault.certificates.models.CertificatePolicy; | ||
| import com.azure.security.keyvault.certificates.models.KeyVaultCertificate; | ||
| import com.azure.security.keyvault.certificates.models.KeyVaultCertificateWithPolicy; | ||
|
|
||
| CertificateClient certificateClient = new CertificateClientBuilder() | ||
| .vaultUrl(<your-vault-url>) | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
@@ -192,7 +197,7 @@ for (CertificateProperties certificateProperties : certificateClient.listPropert | |
| ``` | ||
|
|
||
| ### Async API | ||
| The following sections provide several code snippets covering some of the most common asynchronous Azure Key Vault Key Service tasks, including: | ||
| The following sections provide several code snippets covering some of the most common asynchronous Azure Key Vault Certificate Service tasks, including: | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
| - [Create a Certificate Asynchronously](#create-a-certificate-asynchronously) | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
| - [Retrieve a Certificate Asynchronously](#retrieve-a-certificate-asynchronously) | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
| - [Update an existing Certificate Asynchronously](#update-an-existing-certificate-asynchronously) | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
@@ -203,15 +208,13 @@ The following sections provide several code snippets covering some of the most c | |
|
|
||
| ### Create a Certificate Asynchronously | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
||
|
FredGao-new marked this conversation as resolved.
|
||
| Create a Certificate to be stored in the Azure Key Vault. | ||
| - `beginCreateCertificate` creates a new certificate in the key vault. if the certificate with name already exists then a new version of the certificate is created. | ||
| Create a certificate to be stored in the Azure Key Vault. | ||
| - `beginCreateCertificate` creates a new certificate in the Azure Key Vault. if the certificate with name already exists then a new version of the certificate is created. | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```Java | ||
| import com.azure.identity.DefaultAzureCredentialBuilder; | ||
| import com.azure.security.keyvault.certificates.models.Certificate; | ||
| import com.azure.security.keyvault.certificates.models.CertificatePolicy; | ||
| import com.azure.security.keyvault.certificates.models.CertificateOperation; | ||
| import com.azure.security.keyvault.certificates.CertificateAsyncClient; | ||
| import com.azure.security.keyvault.certificates.models.CertificatePolicy; | ||
|
|
||
| //Creates a certificate using the default policy and polls on its progress. | ||
| certificateAsyncClient.beginCreateCertificate("certificateName", CertificatePolicy.getDefault()) | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
|
|
@@ -271,7 +274,7 @@ List the certificates in the key vault by calling `listPropertiesOfCertificates` | |
| ```Java | ||
| // The List Certificates operation returns certificates without their full properties, so for each certificate returned we call `getCertificate` to get all its attributes excluding the policy. | ||
| certificateAsyncClient.listPropertiesOfCertificates() | ||
| .subscribe(certificateProperties -> certificateAsyncClient.getCertificate(certificateProperties.getName(), | ||
| .subscribe(certificateProperties -> certificateAsyncClient.getCertificateVersion(certificateProperties.getName(), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line update to |
||
| certificateProperties.getVersion()); | ||
| .subscribe(certificateResponse -> System.out.printf("Received certificate with name %s and key id %s", | ||
|
FredGao-new marked this conversation as resolved.
Outdated
|
||
| certificateResponse.getName(), certificateResponse.getKeyId()))); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.