KeyVaultLoadStoreParameter Class

  • java.lang.Object
    • com.azure.security.keyvault.jca.KeyVaultLoadStoreParameter

Implements

java.security.KeyStore.LoadStoreParameter

public final class KeyVaultLoadStoreParameter
implements java.security.KeyStore.LoadStoreParameter

The Azure Key Vault configuration used to load the KeyStoreSpi.

Create an instance explicitly for programmatic configuration, or use fromSystemProperties() to capture the supported system properties in a configuration snapshot.

Constructor Summary

Constructor Description
KeyVaultLoadStoreParameter(String keyVaultUri)

Constructor.

KeyVaultLoadStoreParameter(String keyVaultUri, String managedIdentity)

Constructor.

KeyVaultLoadStoreParameter(String keyVaultUri, String tenantId, String clientId, String clientSecret)

Constructor.

KeyVaultLoadStoreParameter(String keyVaultUri, String tenantId, String clientId, String clientSecret, String managedIdentity)

Constructor.

Method Summary

Modifier and Type Method and Description
void disableAiaDownload()

Disables AIA certificate downloads.

void disableChallengeResourceVerification()

Disables verifying if the authentication challenge resource matches the Key Vault or Managed HSM domain.

static KeyVaultLoadStoreParameter fromSystemProperties()

Creates a load-store parameter that captures all supported system properties and their defaults.

String getAccessToken()

Get the access token.

Set<String> getCertificateAliasFilterPatterns()

Gets the certificate alias filter patterns.

Duration getCertificatesRefreshInterval()

Gets the certificate refresh interval.

String getCertPathCustom()

Gets the custom certificate path.

String getCertPathWellKnown()

Gets the well-known certificate path.

String getClientId()

Get the client id.

String getClientSecret()

Get the client secret.

String getManagedIdentity()

Get the Managed Identity.

java.security.KeyStore.ProtectionParameter getProtectionParameter()

Get the protection parameter.

String getTenantId()

Get the tenant id.

String getUri()

Get the Azure Key Vault URI.

boolean isAiaDownloadDisabled()

Gets whether AIA certificate downloads are disabled.

boolean isDisableChallengeResourceVerification()

Gets whether challenge resource verification is disabled.

boolean isRefreshCertificatesWhenHaveUnTrustCertificate()

Gets whether certificates are refreshed when an untrusted certificate is encountered.

KeyVaultLoadStoreParameter setAccessToken(String accessToken)

Set the access token.

KeyVaultLoadStoreParameter setCertificateAliasFilterPatterns(Set<String> certificateAliasFilterPatterns)

Sets the certificate alias filter patterns.

KeyVaultLoadStoreParameter setCertificatesRefreshInterval(Duration certificatesRefreshInterval)

Sets the certificate refresh interval.

KeyVaultLoadStoreParameter setCertPathCustom(String certPathCustom)

Sets the custom certificate path.

KeyVaultLoadStoreParameter setCertPathWellKnown(String certPathWellKnown)

Sets the well-known certificate path.

KeyVaultLoadStoreParameter setRefreshCertificatesWhenHaveUnTrustCertificate(boolean refreshCertificatesWhenHaveUnTrustCertificate)

Sets whether certificates are refreshed when an untrusted certificate is encountered.

Methods inherited from java.lang.Object

Constructor Details

KeyVaultLoadStoreParameter

public KeyVaultLoadStoreParameter(String keyVaultUri)

Constructor.

Parameters:

keyVaultUri - The Azure Key Vault URI.

KeyVaultLoadStoreParameter

public KeyVaultLoadStoreParameter(String keyVaultUri, String managedIdentity)

Constructor.

Parameters:

keyVaultUri - The Azure Key Vault URI.
managedIdentity - The managed identity.

KeyVaultLoadStoreParameter

public KeyVaultLoadStoreParameter(String keyVaultUri, String tenantId, String clientId, String clientSecret)

Constructor.

Parameters:

keyVaultUri - The Azure Key Vault URI.
tenantId - The tenant id.
clientId - The client id.
clientSecret - The client secret.

KeyVaultLoadStoreParameter

public KeyVaultLoadStoreParameter(String keyVaultUri, String tenantId, String clientId, String clientSecret, String managedIdentity)

Constructor.

Parameters:

keyVaultUri - The Azure Key Vault URI.
tenantId - The tenant id.
clientId - The client id.
clientSecret - The client secret.
managedIdentity - The managed identity.

Method Details

disableAiaDownload

public void disableAiaDownload()

Disables AIA certificate downloads.

disableChallengeResourceVerification

public void disableChallengeResourceVerification()

Disables verifying if the authentication challenge resource matches the Key Vault or Managed HSM domain. This verification is performed by default.

fromSystemProperties

public static KeyVaultLoadStoreParameter fromSystemProperties()

Creates a load-store parameter that captures all supported system properties and their defaults.

Returns:

The load-store parameter snapshot.

getAccessToken

public String getAccessToken()

Get the access token.

Returns:

The access token.

getCertificateAliasFilterPatterns

public Set<String> getCertificateAliasFilterPatterns()

Gets the certificate alias filter patterns.

Returns:

A copy of the certificate alias filter patterns.

getCertificatesRefreshInterval

public Duration getCertificatesRefreshInterval()

Gets the certificate refresh interval.

Returns:

The certificate refresh interval. Defaults to Duration#ZERO, which disables periodic refresh.

getCertPathCustom

public String getCertPathCustom()

Gets the custom certificate path.

Returns:

The custom certificate path.

getCertPathWellKnown

public String getCertPathWellKnown()

Gets the well-known certificate path.

Returns:

The well-known certificate path.

getClientId

public String getClientId()

Get the client id.

Returns:

The client id.

getClientSecret

public String getClientSecret()

Get the client secret.

Returns:

The client secret.

getManagedIdentity

public String getManagedIdentity()

Get the Managed Identity.

Returns:

The Managed Identity.

getProtectionParameter

public KeyStore.ProtectionParameter getProtectionParameter()

Get the protection parameter.

Returns:

null.

getTenantId

public String getTenantId()

Get the tenant id.

Returns:

the tenant id.

getUri

public String getUri()

Get the Azure Key Vault URI.

Returns:

The Azure Key Vault URI.

isAiaDownloadDisabled

public boolean isAiaDownloadDisabled()

Gets whether AIA certificate downloads are disabled.

Returns:

true if AIA certificate downloads are disabled; otherwise, false.

isDisableChallengeResourceVerification

public boolean isDisableChallengeResourceVerification()

Gets whether challenge resource verification is disabled.

Returns:

true if challenge resource verification is disabled; otherwise, false.

isRefreshCertificatesWhenHaveUnTrustCertificate

public boolean isRefreshCertificatesWhenHaveUnTrustCertificate()

Gets whether certificates are refreshed when an untrusted certificate is encountered.

Returns:

true if certificates are refreshed; otherwise, false.

setAccessToken

public KeyVaultLoadStoreParameter setAccessToken(String accessToken)

Set the access token.

Parameters:

accessToken - The access token.

Returns:

The KeyVaultLoadStoreParameter.

setCertificateAliasFilterPatterns

public KeyVaultLoadStoreParameter setCertificateAliasFilterPatterns(Set<String> certificateAliasFilterPatterns)

Sets the certificate alias filter patterns.

Parameters:

certificateAliasFilterPatterns - The certificate alias filter patterns.

Returns:

The KeyVaultLoadStoreParameter.

setCertificatesRefreshInterval

public KeyVaultLoadStoreParameter setCertificatesRefreshInterval(Duration certificatesRefreshInterval)

Sets the certificate refresh interval. Zero or negative intervals disable periodic refresh.

Parameters:

certificatesRefreshInterval - The certificate refresh interval, for example Duration.parse("PT30S").

Returns:

The KeyVaultLoadStoreParameter.

setCertPathCustom

public KeyVaultLoadStoreParameter setCertPathCustom(String certPathCustom)

Sets the custom certificate path.

Parameters:

certPathCustom - The custom certificate path.

Returns:

The KeyVaultLoadStoreParameter.

setCertPathWellKnown

public KeyVaultLoadStoreParameter setCertPathWellKnown(String certPathWellKnown)

Sets the well-known certificate path.

Parameters:

certPathWellKnown - The well-known certificate path.

Returns:

The KeyVaultLoadStoreParameter.

setRefreshCertificatesWhenHaveUnTrustCertificate

public KeyVaultLoadStoreParameter setRefreshCertificatesWhenHaveUnTrustCertificate(boolean refreshCertificatesWhenHaveUnTrustCertificate)

Sets whether certificates are refreshed when an untrusted certificate is encountered.

Parameters:

refreshCertificatesWhenHaveUnTrustCertificate - Whether certificates are refreshed.

Returns:

The KeyVaultLoadStoreParameter.

Applies to