Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 24 additions & 26 deletions sdk/keyvault/azure-security-keyvault-jca/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
# JCA Provider for Azure Key Vault
# Azure Key Vault JCA client library for Java

# Getting started

# Key concepts

The JCA Provider for Azure Key Vault is a JCA provider for certificates in
Azure Key Vault. It is built on four principles:

1. Must be extremely thin to run within a JVM
1. Must not introduce any library version conflicts with Java app code dependencies
1. Must not introduce any class loader hierarchy conflicts with Java app code dependencies
1. Must be extremely thin to run within a JVM.
1. Must not introduce any library version conflicts with Java app code dependencies.
1. Must not introduce any class loader hierarchy conflicts with Java app code dependencies.
1. Must be ready for "never trust, always verify and credential-free" Zero Trust environments.

## Testing the version under development

If you want to test the current version under development you will have to
build and install it into your local Maven repository. To do so use the
following command line:

```
mvn clean install -DskipTests=true
```
# Examples

## Server side SSL

If you are looking to integrate the JCA provider to create a SSLServerSocket
If you are looking to integrate the JCA provider to create an SSLServerSocket
see the example below.

```java
Expand All @@ -45,7 +41,7 @@ see the example below.
SSLServerSocket serverSocket = (SSLServerSocket) factory.createServerSocket(8765);
```

Note if you want to use Azure managed identity, you should set the value
Note if you want to use Azure Managed Identity, you should set the value
of `azure.keyvault.uri`, and the rest of the parameters would be `null`.

## Client side SSL
Expand Down Expand Up @@ -104,24 +100,26 @@ connections, see the Apache HTTP client example below.
Note if you want to use Azure managed identity, you should set the value
of `azure.keyvault.uri`, and the rest of the parameters would be `null`.

# Troubleshooting

# Next steps

## Spring Boot

For Spring Boot applications see our [Spring Boot starter]<!--(../../spring/azure-spring-boot-starter-keyvault-certificates/README.md)-->.
For Spring Boot applications see our [Spring Boot starter](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/spring/azure-spring-boot-starter-keyvault-certificates/README.md).

## Reference

1. [Java Cryptography Architecture (JCA) Reference Guide](https://docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec.html)

# Azure KeyVault JCA client library for Java

# Getting started

# Key concepts

# Examples
# Contributing

# Troubleshooting
## Testing the version under development
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section should be somewhere other than the bottom to have more visibility. What about as a part of "Getting Started"?


# Next steps
If you want to test the current version under development you will have to
build and install it into your local Maven repository. To do so use the
following command line:

# Contributing
```
mvn clean install -DskipTests=true
```
4 changes: 2 additions & 2 deletions sdk/keyvault/azure-security-keyvault-jca/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<artifactId>azure-security-keyvault-jca</artifactId>
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.azure:azure-security-keyvault-jca;current} -->
<name>JCA Provider for Azure Key Vault</name>
<description>The Java Crypto Architecture (JCA) Provider for Azure KeyVault</description>
<description>The Java Crypto Architecture (JCA) Provider for Azure Key Vault</description>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -195,7 +195,7 @@

To run the integration tests pass in the following system properties

- azure.keyvault.uri - the KeyVault URI
- azure.keyvault.uri - the Azure Key Vault URI
- azure.tenant.id - your tenant ID
- azure.client.id - the (application) client ID
- azure.client.secret - the (application) client secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Set;

/**
* The KeyVault certificate.
* The Azure Key Vault certificate.
*/
class KeyVaultCertificate extends X509Certificate {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import static java.util.logging.Level.WARNING;

/**
* The REST client specific to Azure KeyVault.
* The REST client specific to Azure Key Vault.
*/
class KeyVaultClient extends DelegateRestClient {

Expand All @@ -49,7 +49,7 @@ class KeyVaultClient extends DelegateRestClient {
private static final String API_VERSION_POSTFIX = "?api-version=7.1";

/**
* Stores the KeyVault URI.
* Stores the Azure Key Vault URI.
*/
private final String keyVaultUri;

Expand All @@ -71,11 +71,11 @@ class KeyVaultClient extends DelegateRestClient {
/**
* Constructor.
*
* @param keyVaultUri the KeyVault URI.
* @param keyVaultUri the Azure Key Vault URI.
*/
KeyVaultClient(String keyVaultUri) {
super(RestClientFactory.createClient());
LOGGER.log(INFO, "Using KeyVault: {0}", keyVaultUri);
LOGGER.log(INFO, "Using Azure Key Vault: {0}", keyVaultUri);
if (!keyVaultUri.endsWith("/")) {
keyVaultUri = keyVaultUri + "/";
}
Expand All @@ -85,7 +85,7 @@ class KeyVaultClient extends DelegateRestClient {
/**
* Constructor.
*
* @param keyVaultUri the KeyVault URI.
* @param keyVaultUri the Azure Key Vault URI.
* @param tenantId the tenant ID.
* @param clientId the client ID.
* @param clientSecret the client secret.
Expand Down Expand Up @@ -212,8 +212,8 @@ public Key getKey(String alias, char[] password) {
.orElse(false);
if (isExportable) {
// Because the certificate is exportable the private key is
// available. So we'll use the KeyVault Secrets API to get the
// private key.
// available. So we'll use the Azure Key Vault Secrets API to get
// the private key.
String certificateSecretUri = certificateBundle.getSid();
HashMap<String, String> headers = new HashMap<>();
headers.put("Authorization", "Bearer " + getAccessToken());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.util.Collections;

/**
* The Azure KeyVault security provider.
* The Azure Key Vault security provider.
*/
public class KeyVaultJcaProvider extends Provider {

Expand All @@ -22,7 +22,7 @@ public class KeyVaultJcaProvider extends Provider {
/**
* Stores the information.
*/
private static final String INFO = "Azure KeyVault JCA Provider";
private static final String INFO = "Azure Key Vault JCA Provider";

/**
* Stores the name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static java.util.logging.Level.WARNING;

/**
* The KeyVault variant of the X509ExtendedKeyManager.
* The Azure Key Vault variant of the X509ExtendedKeyManager.
*/
public class KeyVaultKeyManager extends X509ExtendedKeyManager {

Expand Down Expand Up @@ -63,8 +63,8 @@ public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket so
String alias = null;
try {
/*
* If we only have one alias and the keystore type is not 'AzureKeyVault'
* return that alias as a match.
* If we only have one alias and the keystore type is not
* 'AzureKeyVault' return that alias as a match.
*/
if (!keystore.getProvider().getName().equals("AzureKeyVault")
&& keystore.size() == 1) {
Expand All @@ -87,8 +87,8 @@ public String chooseServerAlias(String keyType, Principal[] issuers, Socket sock
String alias = null;
try {
/*
* If we only have one alias and the keystore type is not 'AzureKeyVault'
* return that alias as a match.
* If we only have one alias and the keystore type is not
* 'AzureKeyVault' return that alias as a match.
*/
if (!keystore.getProvider().getName().equals("AzureKeyVault")
&& keystore.size() == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.logging.Logger;

/**
* The KeyVault variant of the KeyManagerFactory.
* The Azure Key Vault variant of the KeyManagerFactory.
*/
public class KeyVaultKeyManagerFactory extends KeyManagerFactorySpi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import static java.util.logging.Level.WARNING;

/**
* The Azure KeyVault implementation of the KeyStoreSpi.
* The Azure Key Vault implementation of the KeyStoreSpi.
*/
public class KeyVaultKeyStore extends KeyStoreSpi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.security.KeyStore;

/**
* The Azure KeyVault LoadStoreParameter of the KeyStoreSpi.
* The Azure Key Vault LoadStoreParameter of the KeyStoreSpi.
*/
public class KeyVaultLoadStoreParameter implements KeyStore.LoadStoreParameter {

Expand All @@ -33,7 +33,7 @@ public class KeyVaultLoadStoreParameter implements KeyStore.LoadStoreParameter {
/**
* Constructor.
*
* @param uri the KeyVault URI.
* @param uri the Azure Key Vault URI.
* @param tenantId the tenant ID.
* @param clientId the client ID.
* @param clientSecret the client secret.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import javax.net.ssl.X509ExtendedTrustManager;

/**
* The KeyVault variant of the X509TrustManager.
* The Azure Key Vault variant of the X509TrustManager.
*/
public class KeyVaultTrustManager extends X509ExtendedTrustManager implements X509TrustManager {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.logging.Logger;

/**
* The KeyVault variant of the TrustManagerFactory.
* The Azure Key Vault variant of the TrustManagerFactory.
*/
public class KeyVaultTrustManagerFactory extends TrustManagerFactorySpi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.security.Provider;

/**
* The Azure KeyVault TrustManagerFactory provider.
* The Azure Key Vault TrustManagerFactory provider.
*/
public class KeyVaultTrustManagerFactoryProvider extends Provider {

Expand All @@ -20,7 +20,7 @@ public class KeyVaultTrustManagerFactoryProvider extends Provider {
/**
* Stores the information.
*/
private static final String INFO = "Azure KeyVault TrustManagerFactory Provider";
private static final String INFO = "Azure Key Vault TrustManagerFactory Provider";

/**
* Stores the name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Licensed under the MIT License.

/**
* The Azure KeyVault JCA Provider package.
* The Azure Key Vault JCA Provider package.
*/
package com.azure.security.keyvault.jca;
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

/**
* The JUnit test for the AuthClient.
*
* @author Manfred Riem ([email protected])
*/
public class AuthClientTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

/**
* The JUnit tests for the DelegateRestClient class.
*
* @author Manfred Riem ([email protected])
*/
public class DelegateRestClientTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

/**
* The JUnit tests for the JsonbJsonConverter class.
*
* @author Manfred Riem ([email protected])
*/
public class JacksonJsonConverterTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@

/**
* The JUnit tests for the KeyVaultCertificate class.
*
* @author Manfred Riem ([email protected])
*/
public class KeyVaultCertificateTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

/**
* The JUnit tests for the KeyVaultProvider class.
*
* @author Manfred Riem ([email protected])
*/
public class KeyVaultJcaProviderTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

/**
* The JUnit tests for the KeyVaultKeyStore class.
*
* @author Manfred Riem ([email protected])
*/
public class KeyVaultKeyStoreTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

/**
* The JUnit tests for the KeyVaultLoadStoreParameter class.
*
* @author Manfred Riem ([email protected])
*/
public class KeyVaultLoadStoreParameterTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

/**
* The JUnit tests for the LegacyRestClient class.
*
* @author Manfred Riem ([email protected])
*/
public class LegacyRestClientTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

/**
* The JUnit tests for the RestClientFactory class.
*
* @author Manfred Riem ([email protected])
*/
public class RestClientFactoryTest {

Expand Down
Loading