public final class ReplicationTrustManager extends Object implements X509TrustManager
Modifier and Type | Method and Description |
---|---|
static void |
addCertificate(String certAlias,
byte[] certificate)
stores the given certificate into the keystore with the given alias name
|
static void |
addCertificates(Map<String,byte[]> aliasCertMap)
loads the given map of [alias-name, certificate-data] entries into the keystore
to be used by the trust manager
|
void |
checkClientTrusted(X509Certificate[] chain,
String authType) |
void |
checkServerTrusted(X509Certificate[] chain,
String authType) |
X509Certificate[] |
getAcceptedIssuers() |
static ReplicationTrustManager |
getInstance()
returns the singleton instance of ReplicationTrustManager, note that this
return instance can only be used after calling the
addCertificates(Map) method |
public static void addCertificates(Map<String,byte[]> aliasCertMap) throws Exception
aliasCertMap
- the map of [alias-name, certificate-data] entriesException
- in case of any issues related to certificate data parsingpublic static void addCertificate(String certAlias, byte[] certificate) throws Exception
certAlias
- the alias name to be used for this certificatecertificate
- the X509 certificate dataException
- in case of any issues related to certificate data parsingpublic static ReplicationTrustManager getInstance()
addCertificates(Map)
methodpublic void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException
checkClientTrusted
in interface X509TrustManager
CertificateException
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException
checkServerTrusted
in interface X509TrustManager
CertificateException
public X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers
in interface X509TrustManager
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.