Class AnyClientCertificateTrustManager
java.lang.Object
com.irurueta.authserver.authorization.api.web.x509.AnyClientCertificateTrustManager
- All Implemented Interfaces:
TrustManager,X509TrustManager
The trust manager of the dedicated TLS port: it accepts any client certificate and advertises no certificate
authority. The port requests a certificate without validating it against an authority (
optionalNoCA); what
identifies the client is the SHA-256 fingerprint of the certificate, which has to be bound to an account, and what
the application checks is that the certificate is within its validity (CertificatePrincipalExtractor). The
empty list of accepted issuers matters: with the default trust manager the server lists the authorities of the JVM's
default trust store, and a client presents only a certificate issued by a listed authority. Tomcat creates the class
by name, so it is public with a public constructor and no state.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final X509Certificate[]No authority is advertised, so the client may present any certificate it holds. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckClientTrusted(X509Certificate[] chain, String authType) Accepts the certificate chain of a client: the binding of its fingerprint decides.voidcheckServerTrusted(X509Certificate[] chain, String authType) Refuses to vouch for a server: this manager is only ever used by the server side of the connector.Advertises no certificate authority.
-
Field Details
-
NO_ISSUERS
No authority is advertised, so the client may present any certificate it holds.
-
-
Constructor Details
-
AnyClientCertificateTrustManager
public AnyClientCertificateTrustManager()
-
-
Method Details
-
checkClientTrusted
Accepts the certificate chain of a client: the binding of its fingerprint decides.- Specified by:
checkClientTrustedin interfaceX509TrustManager- Parameters:
chain- the chain of the client.authType- the authentication type.
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException Refuses to vouch for a server: this manager is only ever used by the server side of the connector.- Specified by:
checkServerTrustedin interfaceX509TrustManager- Parameters:
chain- the chain of the server.authType- the authentication type.- Throws:
CertificateException- always.
-
getAcceptedIssuers
Advertises no certificate authority.- Specified by:
getAcceptedIssuersin interfaceX509TrustManager- Returns:
- an empty array.
-