public final class SSLUtils extends Object
Constructor and Description |
---|
SSLUtils() |
public static void addCertificate(KeyStore keyStore, X509Certificate cert) throws KeyStoreException, InvalidNameException
public static KeyStore createEmptyKeyStore() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException
public static boolean equals(X509Certificate cert1, X509Certificate cert2)
public static String getCertificateAlias(KeyStore keyStore, X509Certificate cert)
public static X509Certificate[] getCertificateChain(String host) throws NoSuchAlgorithmException, KeyManagementException, IOException
public static X509Certificate[] getCertificateChain(String host, int port) throws NoSuchAlgorithmException, KeyManagementException, IOException
public static X509Certificate[] getCertificateChain(String host, int port, int timeout) throws NoSuchAlgorithmException, KeyManagementException, IOException
public static Map<String,X509Certificate> getCertificates(KeyStore keyStore)
public static X509TrustManager getCustomTrustManager(KeyStore trustStore)
public static X509TrustManager getDefaultTrustManager()
public static File getCustomTrustStoreFile()
public static X509Certificate[] getExpiredCertificates(KeyStore keyStore)
public static Set<X509Certificate> getTrustedCertificates(KeyStore ks)
public static boolean hasTrustedCertificates(KeyStore ks)
public static KeyStore loadKeyStore(File file, char[] password) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException
public static KeyStore loadKeyStore(InputStream input, char[] password) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException
public static Map<String,String> parseDN(String dn) throws InvalidNameException
InvalidNameException
public static void saveEmptyKeyStore(File keyStoreFile, char[] keyStorePassword) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException
public static void saveKeyStore(KeyStore keyStore, File keyStoreFile, char[] keyStorePassword) throws IOException, CertificateException, NoSuchAlgorithmException, KeyStoreException
public static void writeCertificate(Certificate cert, File file, boolean binary) throws IOException, CertificateEncodingException
public static void writeCertificateAsAscii(Certificate cert, Writer output) throws IOException, CertificateEncodingException
public static void writeCertificateAsBinary(Certificate cert, OutputStream output) throws IOException, CertificateEncodingException
public static String writeMD5FingerPrint(X509Certificate cert) throws CertificateEncodingException
CertificateEncodingException
public static String writeSerialNumber(X509Certificate cert)
public static String writeSHA1FingerPrint(X509Certificate cert) throws CertificateEncodingException
CertificateEncodingException
public static String writeSHA256FingerPrint(X509Certificate cert) throws CertificateEncodingException
CertificateEncodingException
Copyright © 2019 OpenEstate. All rights reserved.