Package net.dona.doip.util.tls
Class TrustManagerForSpecifiedServerIdAndKeys
java.lang.Object
net.dona.doip.util.tls.TrustManagerForSpecifiedServerIdAndKeys
- All Implemented Interfaces:
TrustManager,X509TrustManager
A trust manager which expects the server certificate to both have the
specified identitifier, and to have one of a list of specified public keys.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a trust manager which expects the server certificate to both have the specified identitifier, and to have one of a list of specified public keys. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckClientTrusted(X509Certificate[] chain, String authType) voidcheckServerTrusted(X509Certificate[] chain, String authType)
-
Constructor Details
-
TrustManagerForSpecifiedServerIdAndKeys
Constructs a trust manager which expects the server certificate to both have the specified identitifier, and to have one of a list of specified public keys.- Parameters:
id- the expected server identifierkeys- the list of permissible server public keys
-
-
Method Details
-
getAcceptedIssuers
- Specified by:
getAcceptedIssuersin interfaceX509TrustManager
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException - Specified by:
checkClientTrustedin interfaceX509TrustManager- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException - Specified by:
checkServerTrustedin interfaceX509TrustManager- Throws:
CertificateException
-