public class X509Authentication extends CertificateAuthentication
Supports certificates in pk12 or pem format. This method has a Keystone authentication method as fallback.
Example:
HTTPAuthentication auth = new X509Authentication("/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);
Modifier and Type | Field and Description |
---|---|
static String |
IDENTIFIER |
Constructor and Description |
---|
X509Authentication(String certificate,
String password)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Authentication |
getFallback()
Returns authentication's fallback authentication method.
|
String |
getIdentifier()
Returns unique identifier for this authentication method.
|
void |
setPassword(String password)
Sets user's password.
|
authenticate, createSSLContext, getCertificate, getPassword, setCertificate
getCAFile, getCAPath, getConnection, getCredentialsProvider, getTarget, loadCAs, setCAFile, setCAPath, setConnection, setCredentialsProvider, setTarget
public static final String IDENTIFIER
public String getIdentifier()
Authentication
getIdentifier
in interface Authentication
getIdentifier
in class HTTPAuthentication
public Authentication getFallback()
Authentication
getFallback
in interface Authentication
getFallback
in class HTTPAuthentication
public void setPassword(String password)
setPassword
in class CertificateAuthentication
password
- user's password, cannot be null nor emptyCopyright © 2016. All Rights Reserved.