java.lang.Object
javax.net.ssl.X509ExtendedTrustManager
org.snmp4j.transport.tls.TLSTMExtendedTrustManager
- All Implemented Interfaces:
TrustManager,X509TrustManager
TLSTM trust manager that implements the X509ExtendedTrustManager interface.
- Since:
- 2.5.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final LogAdapterprivate final TlsTmSecurityCallback<X509Certificate> private final CounterSupportprivate final TransportStateReference(package private) X509TrustManagerprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionTLSTMExtendedTrustManager(CounterSupport tlstmCounters, TlsTmSecurityCallback<X509Certificate> securityCallback, X509TrustManager trustManager, boolean useClientMode, TransportStateReference tmStateReference) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckClientTrusted(X509Certificate[] x509Certificates, String s) voidcheckClientTrusted(X509Certificate[] x509Certificates, String s, Socket socket) voidcheckClientTrusted(X509Certificate[] x509Certificates, String s, SSLEngine sslEngine) private booleancheckClientTrustedIntern(X509Certificate[] x509Certificates) voidcheckServerTrusted(X509Certificate[] x509Certificates, String s) voidcheckServerTrusted(X509Certificate[] x509Certificates, String s, Socket socket) voidcheckServerTrusted(X509Certificate[] x509Certificates, String s, SSLEngine sslEngine) private booleancheckServerTrustedByFingerprint(X509Certificate[] x509Certificates) private booleancheckServerTrustedBySubjectDN(X509Certificate[] x509Certificates) RFC 6353 page 47, snmpTlstmAddrServerIdentitystatic X509Certificate[]getAcceptedIssuers(X509TrustManager trustManager, TlsTmSecurityCallback<X509Certificate> securityCallback) Gets the acceptedX509Certificates from the givenX509TrustManagerand security callback.private booleanisMatchingFingerprint(X509Certificate[] x509Certificates, OctetString fingerprint, boolean useClientMode) private voidpostCheckServerTrusted(X509Certificate[] x509Certificates)
-
Field Details
-
logger
-
trustManager
X509TrustManager trustManager -
useClientMode
private final boolean useClientMode -
tmStateReference
-
tlstmCounters
-
securityCallback
-
-
Constructor Details
-
TLSTMExtendedTrustManager
public TLSTMExtendedTrustManager(CounterSupport tlstmCounters, TlsTmSecurityCallback<X509Certificate> securityCallback, X509TrustManager trustManager, boolean useClientMode, TransportStateReference tmStateReference)
-
-
Method Details
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException - Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException - Throws:
CertificateException
-
isMatchingFingerprint
private boolean isMatchingFingerprint(X509Certificate[] x509Certificates, OctetString fingerprint, boolean useClientMode) throws CertificateException - Throws:
CertificateException
-
getAcceptedIssuers
-
getAcceptedIssuers
public static X509Certificate[] getAcceptedIssuers(X509TrustManager trustManager, TlsTmSecurityCallback<X509Certificate> securityCallback) Gets the acceptedX509Certificates from the givenX509TrustManagerand security callback.- Parameters:
trustManager- a X509TrustManager providing the accepted issuers.securityCallback- a security callback that is ask to accept any returned issuer.- Returns:
- a probably empty or
nullarray of accepted issuers. - Since:
- 3.6.0
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException - Specified by:
checkClientTrustedin classX509ExtendedTrustManager- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] x509Certificates, String s, Socket socket) throws CertificateException - Specified by:
checkServerTrustedin classX509ExtendedTrustManager- Throws:
CertificateException
-
checkServerTrustedBySubjectDN
private boolean checkServerTrustedBySubjectDN(X509Certificate[] x509Certificates) throws CertificateException RFC 6353 page 47, snmpTlstmAddrServerIdentity- Throws:
CertificateException
-
postCheckServerTrusted
- Throws:
CertificateException
-
checkServerTrustedByFingerprint
private boolean checkServerTrustedByFingerprint(X509Certificate[] x509Certificates) throws CertificateException - Throws:
CertificateException
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] x509Certificates, String s, SSLEngine sslEngine) throws CertificateException - Specified by:
checkClientTrustedin classX509ExtendedTrustManager- Throws:
CertificateException
-
checkClientTrustedIntern
private boolean checkClientTrustedIntern(X509Certificate[] x509Certificates) throws CertificateException - Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] x509Certificates, String s, SSLEngine sslEngine) throws CertificateException - Specified by:
checkServerTrustedin classX509ExtendedTrustManager- Throws:
CertificateException
-