Package com.azure.security.keyvault.jca
Class KeyVaultTrustManager
- java.lang.Object
-
- javax.net.ssl.X509ExtendedTrustManager
-
- com.azure.security.keyvault.jca.KeyVaultTrustManager
-
- All Implemented Interfaces:
TrustManager,X509TrustManager
public final class KeyVaultTrustManager extends X509ExtendedTrustManager
The Azure Key Vault variant of the X509TrustManager.- See Also:
X509ExtendedTrustManager
-
-
Constructor Summary
Constructors Constructor Description KeyVaultTrustManager()Constructor.KeyVaultTrustManager(KeyStore keyStore)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckClientTrusted(X509Certificate[] chain, String authType)Check if the client is trusted.voidcheckClientTrusted(X509Certificate[] chain, String authType, Socket socket)Check if the client is trusted.voidcheckClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine)Check if the client is trusted.voidcheckServerTrusted(X509Certificate[] chain, String authType)Check if the server is trusted.voidcheckServerTrusted(X509Certificate[] chain, String authType, Socket socket)Check if the server is trusted.voidcheckServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine)Check if the server is trusted.X509Certificate[]getAcceptedIssuers()Get accepted issuers.
-
-
-
Constructor Detail
-
KeyVaultTrustManager
public KeyVaultTrustManager()
Constructor.
-
KeyVaultTrustManager
public KeyVaultTrustManager(KeyStore keyStore)
Constructor.- Parameters:
keyStore- the keystore.
-
-
Method Detail
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException
Check if the client is trusted.- Parameters:
chain- the chainauthType- the authType- Throws:
CertificateException- if any of the certificates in the keystore could not be loaded.
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException
Check if the server is trusted.- Parameters:
chain- the chainauthType- the authType- Throws:
CertificateException- if any of the certificates in the keystore could not be loaded.
-
getAcceptedIssuers
public X509Certificate[] getAcceptedIssuers()
Get accepted issuers.- Returns:
- X509Certificate the X509Certificate
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException
Check if the client is trusted.- Specified by:
checkClientTrustedin classX509ExtendedTrustManager- Parameters:
chain- the chainauthType- the authTypesocket- the socket- Throws:
CertificateException- if any of the certificates in the keystore could not be loaded.
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException
Check if the server is trusted.- Specified by:
checkServerTrustedin classX509ExtendedTrustManager- Parameters:
chain- the chainauthType- the authTypesocket- the socket- Throws:
CertificateException- if any of the certificates in the keystore could not be loaded.
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException
Check if the client is trusted.- Specified by:
checkClientTrustedin classX509ExtendedTrustManager- Parameters:
chain- the chainauthType- the authTypeengine- the engine- Throws:
CertificateException- if any of the certificates in the keystore could not be loaded.
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException
Check if the server is trusted.- Specified by:
checkServerTrustedin classX509ExtendedTrustManager- Parameters:
chain- the chainauthType- the authTypeengine- the engine- Throws:
CertificateException- if any of the certificates in the keystore could not be loaded.
-
-