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 TypeMethodDescriptionvoid
checkClientTrusted
(X509Certificate[] chain, String authType) void
checkServerTrusted
(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:
getAcceptedIssuers
in interfaceX509TrustManager
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException - Specified by:
checkClientTrusted
in interfaceX509TrustManager
- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException - Specified by:
checkServerTrusted
in interfaceX509TrustManager
- Throws:
CertificateException
-