public abstract class CertificateAuthentication extends HTTPAuthentication
Supports certificates in pk12 or pem format. This method has a Keystone authentication method as fallback.
Example:
HTTPAuthentication auth = new CertificateAuthentication("/path/to/certificate.pem", "password");
auth.setCAPath("/etc/grid-security/certificates/"); //path to CA directory
Client client = new HTTPClient(URI.create("https://remote.server.net"), auth);| Constructor and Description |
|---|
CertificateAuthentication() |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate()
Runs the authentication.
|
protected SSLContext |
createSSLContext()
Creates a ssl context with custom CAs if set.
|
String |
getCertificate()
Returns user's certificate.
|
String |
getPassword()
Returns user's password.
|
void |
setCertificate(String certificate)
Sets user's certificate.
|
void |
setPassword(String password)
Sets user's password.
|
getCAFile, getCAPath, getConnection, getCredentialsProvider, getFallback, getIdentifier, getTarget, loadCAs, setCAFile, setCAPath, setConnection, setCredentialsProvider, setTargetpublic String getCertificate()
public void setCertificate(String certificate)
certificate - user's certificate, cannot be null nor emptypublic String getPassword()
public void setPassword(String password)
password - user's password, cannot be nullprotected SSLContext createSSLContext() throws AuthenticationException
HTTPAuthenticationcreateSSLContext in class HTTPAuthenticationAuthenticationExceptionpublic void authenticate()
throws CommunicationException
Authenticationauthenticate in interface Authenticationauthenticate in class HTTPAuthenticationCommunicationException - when error occures during the
communicationCopyright © 2016. All rights reserved.