@Immutable public class TLSClientAuthentication extends ClientAuthentication
ClientAuthenticationMethod.TLS_CLIENT_AUTH
.
Related specifications:
Constructor and Description |
---|
TLSClientAuthentication(ClientID clientID,
SSLSocketFactory sslSocketFactory)
Creates a new TLS / X.509 certificate client authentication.
|
TLSClientAuthentication(ClientID clientID,
X509Certificate x509Certificate)
Creates a new TLS / X.509 certificate client authentication.
|
Modifier and Type | Method and Description |
---|---|
void |
applyTo(HTTPRequest httpRequest)
Applies the authentication to the specified HTTP request by setting
its Authorization header and/or POST entity-body parameters
(according to the implemented client authentication method).
|
X509Certificate |
getClientX509Certificate()
Returns the validated client X.509 certificate from the received
HTTPS request.
|
SSLSocketFactory |
getSSLSocketFactory()
Returns the SSL socket factory to use for the outgoing HTTPS request
and to present the client certificate(s).
|
static TLSClientAuthentication |
parse(HTTPRequest httpRequest)
Parses a client TLS / X.509 certificate authentication from the
specified HTTP request.
|
getClientID, getMethod
public TLSClientAuthentication(ClientID clientID, SSLSocketFactory sslSocketFactory)
clientID
- The client identifier. Must not be
null
.sslSocketFactory
- The SSL socket factory to use for the
outgoing HTTPS request and to present the
client certificate(s), null
to use
the default one.public TLSClientAuthentication(ClientID clientID, X509Certificate x509Certificate)
clientID
- The client identifier. Must not be
null
.x509Certificate
- The validated client X.509 certificate from
the received HTTPS request. Must not be
null
.public SSLSocketFactory getSSLSocketFactory()
null
to use the default one.public X509Certificate getClientX509Certificate()
null
for an outgoing
HTTPS request.public void applyTo(HTTPRequest httpRequest)
ClientAuthentication
applyTo
in class ClientAuthentication
httpRequest
- The HTTP request. Must not be null
.public static TLSClientAuthentication parse(HTTPRequest httpRequest) throws ParseException
httpRequest
- The HTTP request to parse. Must not be
null
and must include a validated client
X.509 certificate.ParseException
- If the client_id
or client X.509
certificate is missing.Copyright © 2017 Connect2id Ltd.. All rights reserved.