Class ThreadLocalX509TrustEngineSupport
java.lang.Object
org.opensaml.security.x509.tls.impl.ThreadLocalX509TrustEngineSupport
Support class for centralizing evaluation of a certificate chain using trust engine and criteria
from
ThreadLocalX509TrustEngineContext.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidevaluate(X509Certificate[] chain) Perform trust evaluation on the specified certificate chain using the current data inThreadLocalX509TrustEngineContext.static voidPerform trust evaluation on the specifiedSSLSocketusing the current data inThreadLocalX509TrustEngineContext.private static X509CredentialextractCredential(X509Certificate[] chain) Extract the server TLSX509Credentialfrom the suppliedSSLSocket.private static booleanperformTrustEval(X509Certificate[] chain, TrustEngine<? super X509Credential> trustEngine, CriteriaSet criteriaSet) Perform trust evaluation on the specified certificate chain using the supplied trust engine and criteria.
-
Field Details
-
LOG
@Nonnull private static final org.slf4j.Logger LOGLogger.
-
-
Constructor Details
-
ThreadLocalX509TrustEngineSupport
private ThreadLocalX509TrustEngineSupport()Constructor.
-
-
Method Details
-
evaluate
Perform trust evaluation on the specifiedSSLSocketusing the current data inThreadLocalX509TrustEngineContext.- Parameters:
sslSocket- the socket whose certificates are to be evaluated- Throws:
SSLPeerUnverifiedException- if the certificate chain was not trusted by the supplied TrustEngine
-
evaluate
Perform trust evaluation on the specified certificate chain using the current data inThreadLocalX509TrustEngineContext.- Parameters:
chain- the certificate chain to be evaluated- Throws:
CertificateException- if the certificate chain is not trusted by the supplied TrustEngine
-
extractCredential
@Nonnull private static X509Credential extractCredential(@Nonnull @NotEmpty X509Certificate[] chain) throws CertificateException Extract the server TLSX509Credentialfrom the suppliedSSLSocket.- Parameters:
chain- the chain of X509 certificates- Returns:
- an X509Credential representing the entity certificate as well as the supplied supporting intermediate certificate chain (if any)
- Throws:
CertificateException- if credential data can not be extracted from the socket
-