forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update key vault readme (Azure#18971)
- Loading branch information
1 parent
c58542d
commit 5e0d184
Showing
25 changed files
with
244 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+118 KB
.../azure-spring-boot-starter-keyvault-certificates/resource/add-access-policy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+153 KB
.../azure-spring-boot-starter-keyvault-certificates/resource/back-to-key-vault.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+108 KB
...pring-boot-starter-keyvault-certificates/resource/check-certificates-status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+91.6 KB
...azure-spring-boot-starter-keyvault-certificates/resource/choose-application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+132 KB
...pring/azure-spring-boot-starter-keyvault-certificates/resource/copy-secrets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+98.9 KB
...zure-spring-boot-starter-keyvault-certificates/resource/create-certificates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+93.6 KB
...pring-boot-starter-keyvault-certificates/resource/create-key-vault-resource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+118 KB
...ing/azure-spring-boot-starter-keyvault-certificates/resource/create-secrets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+126 KB
...-boot-starter-keyvault-certificates/resource/creating-an-azure-key-vault-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+118 KB
...-boot-starter-keyvault-certificates/resource/creating-an-azure-key-vault-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+145 KB
...-boot-starter-keyvault-certificates/resource/creating-an-azure-key-vault-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+169 KB
...g/azure-spring-boot-starter-keyvault-certificates/resource/get-info-for-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+119 KB
...ing/azure-spring-boot-starter-keyvault-certificates/resource/go-to-resource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+137 KB
...g/azure-spring-boot-starter-keyvault-certificates/resource/new-registration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+129 KB
...azure-spring-boot-starter-keyvault-certificates/resource/save-access-policy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+166 KB
...ing/azure-spring-boot-starter-keyvault-certificates/resource/save-vault-uri.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+168 KB
...g-boot-starter-keyvault-certificates/resource/select-azure-active-directory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85.6 KB
...g/azure-spring-boot-starter-keyvault-certificates/resource/select-configure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+110 KB
...zure-spring-boot-starter-keyvault-certificates/resource/specify-application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+83.1 KB
...pring-boot-starter-keyvault-certificates/resource/specify-certificates-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+84.6 KB
...zure-spring-boot-starter-keyvault-certificates/resource/specify-the-options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...azure-spring-boot/src/samples/java/com/azure/spring/keyvault/KeyVaultJcaClientSample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
package com.azure.spring.keyvault; | ||
|
||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory; | ||
import org.apache.http.impl.client.CloseableHttpClient; | ||
import org.apache.http.impl.client.HttpClients; | ||
import org.apache.http.ssl.SSLContexts; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; | ||
import org.springframework.web.client.RestTemplate; | ||
import org.apache.http.conn.ssl.TrustSelfSignedStrategy; | ||
|
||
import javax.net.ssl.HostnameVerifier; | ||
import javax.net.ssl.SSLContext; | ||
import javax.net.ssl.SSLSession; | ||
import java.security.KeyStore; | ||
|
||
public class KeyVaultJcaClientSample { | ||
|
||
@Bean | ||
public RestTemplate restTemplate() throws Exception { | ||
KeyStore ks = KeyStore.getInstance("AzureKeyVault"); | ||
SSLContext sslContext = SSLContexts.custom() | ||
.loadTrustMaterial(ks, new TrustSelfSignedStrategy()) | ||
.build(); | ||
|
||
HostnameVerifier allowAll = (String hostName, SSLSession session) -> true; | ||
SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext, allowAll); | ||
|
||
CloseableHttpClient httpClient = HttpClients.custom() | ||
.setSSLSocketFactory(csf) | ||
.build(); | ||
|
||
HttpComponentsClientHttpRequestFactory requestFactory = | ||
new HttpComponentsClientHttpRequestFactory(); | ||
|
||
requestFactory.setHttpClient(httpClient); | ||
RestTemplate restTemplate = new RestTemplate(requestFactory); | ||
return restTemplate; | ||
} | ||
} |
Oops, something went wrong.