public class DavGatewayX509TrustManager extends Object implements X509TrustManager
Constructor and Description |
---|
DavGatewayX509TrustManager()
Create a new custom X509 trust manager.
|
Modifier and Type | Method and Description |
---|---|
void |
checkClientTrusted(X509Certificate[] x509Certificates,
String authType) |
void |
checkServerTrusted(X509Certificate[] x509Certificates,
String authType) |
protected static String |
formatHash(byte[] buffer)
Format byte buffer to a hexadecimal hash string.
|
X509Certificate[] |
getAcceptedIssuers() |
static String |
getFormattedHash(X509Certificate certificate)
Build a formatted hash string.
|
static String |
getFormattedSerial(X509Certificate certificate)
Build a formatted certificate serial string.
|
static String |
getRDN(Principal principal)
Get rdn value from principal dn.
|
protected boolean |
isCertificateTrusted(X509Certificate certificate) |
protected void |
userCheckServerTrusted(X509Certificate[] x509Certificates) |
public DavGatewayX509TrustManager() throws NoSuchAlgorithmException, KeyStoreException
NoSuchAlgorithmException
- on errorKeyStoreException
- on errorpublic void checkServerTrusted(X509Certificate[] x509Certificates, String authType) throws CertificateException
checkServerTrusted
in interface X509TrustManager
CertificateException
public void checkClientTrusted(X509Certificate[] x509Certificates, String authType) throws CertificateException
checkClientTrusted
in interface X509TrustManager
CertificateException
public X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers
in interface X509TrustManager
protected void userCheckServerTrusted(X509Certificate[] x509Certificates) throws CertificateException
CertificateException
protected boolean isCertificateTrusted(X509Certificate certificate)
public static String getRDN(Principal principal)
principal
- security principalpublic static String getFormattedSerial(X509Certificate certificate)
certificate
- X509 certificatepublic static String getFormattedHash(X509Certificate certificate)
certificate
- X509 certificateprotected static String formatHash(byte[] buffer)
buffer
- byte arrayCopyright © 2001–2024 MickaĆ«l Guessant. All rights reserved.