Example usage for javax.net.ssl KeyManager toString

List of usage examples for javax.net.ssl KeyManager toString

Introduction

In this page you can find the example usage for javax.net.ssl KeyManager toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.openhealthtools.openatna.net.ConnectionCertificateHandler.java

public static void main(String[] args) {
    try {/*  ww w .  j  a  va  2  s.  co  m*/
        //ConnectionCertificateHandler cch = new ConnectionCertificateHandler();
        KeyStore ks = ConnectionCertificateHandler.createKeyStore(new URL("file:certs/keystore"), "password");
        ConnectionCertificateHandler.printKeyCertificates(ks);
        KeyManager[] kms = ConnectionCertificateHandler.createKeyManagers(ks, "password");
        System.out.println("Printing all key managers:");
        for (KeyManager km : kms) {
            System.out.println(km.toString());
        }
        KeyStore ts = ConnectionCertificateHandler.createKeyStore(new URL("file:certs/truststore"), "password");
        ConnectionCertificateHandler.printTrustCerts(ts);
        TrustManager[] tms = ConnectionCertificateHandler.createTrustManagers(ts, null);
        System.out.println("Printing all trust managers:");
        for (TrustManager tm : tms) {
            System.out.println(tm.toString());
        }

    } catch (Exception e) {
        System.out.println("Top Level Error: " + e);
    }
}