public class AsadminTrustManager extends Object implements X509TrustManager
X509TrustManager
that provides basic support
for Trust Management. It checks if the server is trusted and displays the
certificate that was received from the server. The user is then prompted
to confirm the certificate. If confirmed, the certificate is entered into
the client side asadmintruststore (default name is ~/.gfclient/truststore).
Once in the truststore, the user is never prompted to confirm a second time.Constructor and Description |
---|
AsadminTrustManager()
Creates an instance of the SunOneBasicX509TrustManager
A date/time stamp is used of the trusted server certificate in the
client side trust store.
|
AsadminTrustManager(Object alias,
Map env)
Creates an instance of the AsadminTrustManager
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkCertificate(X509Certificate[] chain)
This function validates the cert and ensures that it is trusted.
|
void |
checkClientTrusted(X509Certificate[] x509Certificate,
String authType)
Checks if client is trusted given the certificate chain and
authorization type string, e.g., "RSA".
|
void |
checkServerTrusted(X509Certificate[] chain,
String authType)
Checs if the server is trusted.
|
X509Certificate[] |
getAcceptedIssuers() |
void |
setInteractive(boolean mode)
Set the interactive mode for the trust manager.
|
public AsadminTrustManager(Object alias, Map env)
alias
- The toString() of the alias object concatenated with a
date/time stamp is used as the alias of the trusted server certificate
in the client side trust store. When null,
only a date / timestamp is used as an alias.public AsadminTrustManager()
public void setInteractive(boolean mode)
public void checkClientTrusted(X509Certificate[] x509Certificate, String authType) throws CertificateException
checkClientTrusted
in interface X509TrustManager
CertificateException
UnsupportedOperationException
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException
checkServerTrusted
in interface X509TrustManager
chain
- The server certificate to be validated.authType
- CertificateException
public X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers
in interface X509TrustManager
protected void checkCertificate(X509Certificate[] chain) throws RuntimeException, CertificateException, IllegalArgumentException
chain
- RuntimeException
CertificateException
IllegalArgumentException
Copyright © 2019. All rights reserved.