diff --git a/sdk/keyvault/azure-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultLoadStoreParameter.java b/sdk/keyvault/azure-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultLoadStoreParameter.java index 7fe90e9567fa7..e4feb8c69c458 100644 --- a/sdk/keyvault/azure-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultLoadStoreParameter.java +++ b/sdk/keyvault/azure-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultLoadStoreParameter.java @@ -14,7 +14,7 @@ public class KeyVaultLoadStoreParameter implements KeyStore.LoadStoreParameter { * Stores the URI. */ private final String uri; - + /** * Stores the Azure AD authentication URL. */ @@ -34,7 +34,7 @@ public class KeyVaultLoadStoreParameter implements KeyStore.LoadStoreParameter { * Stores the client secret. */ private final String clientSecret; - + /** * Stores the user-assigned identity. */ @@ -44,19 +44,9 @@ public class KeyVaultLoadStoreParameter implements KeyStore.LoadStoreParameter { * Constructor. * * @param uri the Azure Key Vault URI. - * @param aadAuthenticationUrl the Azure AD authentication URL. - * @param tenantId the tenant ID. - * @param clientId the client ID. - * @param clientSecret the client secret. */ - public KeyVaultLoadStoreParameter(String uri, String aadAuthenticationUrl, - String tenantId, String clientId, String clientSecret) { - this.uri = uri; - this.aadAuthenticationUrl = aadAuthenticationUrl; - this.tenantId = tenantId; - this.clientId = clientId; - this.clientSecret = clientSecret; - this.managedIdentity = null; + public KeyVaultLoadStoreParameter(String uri) { + this(uri, null); } /** @@ -78,16 +68,35 @@ public KeyVaultLoadStoreParameter(String uri, String managedIdentity) { * Constructor. * * @param uri the Azure Key Vault URI. + * @param tenantId the tenant ID. + * @param clientId the client ID. + * @param clientSecret the client secret. */ - public KeyVaultLoadStoreParameter(String uri) { + public KeyVaultLoadStoreParameter(String uri, String tenantId, String clientId, String clientSecret) { + this(uri, null, tenantId, clientId, clientSecret); + } + + + /** + * Constructor. + * + * @param uri the Azure Key Vault URI. + * @param aadAuthenticationUrl the Azure AD authentication URL. + * @param tenantId the tenant ID. + * @param clientId the client ID. + * @param clientSecret the client secret. + */ + public KeyVaultLoadStoreParameter(String uri, String aadAuthenticationUrl, + String tenantId, String clientId, String clientSecret) { this.uri = uri; - this.aadAuthenticationUrl = null; - this.tenantId = null; - this.clientId = null; - this.clientSecret = null; + this.aadAuthenticationUrl = aadAuthenticationUrl; + this.tenantId = tenantId; + this.clientId = clientId; + this.clientSecret = clientSecret; this.managedIdentity = null; } - + + /** * Get the protection parameter. * @@ -100,7 +109,7 @@ public KeyStore.ProtectionParameter getProtectionParameter() { /** * Get the Azure AD authentication URL. - * + * * @return the Azure AD authentication URL. */ public String getAadAuthenticationUrl() { @@ -127,7 +136,7 @@ public String getClientSecret() { /** * Get the managed identity. - * + * * @return the managed identity. */ public String getManagedIdentity() {