Example usage for javax.net.ssl X509KeyManager toString

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

Introduction

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

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:de.betterform.connector.http.ssl.BetterFORMKeyStoreManager.java

public PrivateKey getPrivateKey(String alias) {
    Iterator<X509KeyManager> iterator = this.customX509KeyManagers.iterator();
    while (iterator.hasNext()) {
        X509KeyManager x509KeyManager = iterator.next();
        if (x509KeyManager.getPrivateKey(alias) != null) {
            BetterFORMKeyStoreManager.LOGGER
                    .trace("BetterFORMKeyStoreManager.getPrivateKey: Private key found for " + alias
                            + " in custom keystore: " + x509KeyManager.toString());
            //Found private key in a custom keystore return it.
            return x509KeyManager.getPrivateKey(alias);
        }/*from  www  . j ava 2 s . c  o  m*/
    }

    //Return private key from JAVA VM keystor or null;
    return javaDefaultKeyManager.getPrivateKey(alias);
}

From source file:de.betterform.connector.http.ssl.BetterFORMKeyStoreManager.java

public String chooseClientAlias(String[] keyType, Principal[] principals, Socket socket) {
    Iterator<X509KeyManager> iterator = this.customX509KeyManagers.iterator();
    while (iterator.hasNext()) {
        X509KeyManager x509KeyManager = iterator.next();
        if (x509KeyManager.chooseClientAlias(keyType, principals, socket) != null) {
            BetterFORMKeyStoreManager.LOGGER.trace(
                    "BetterFORMKeyStoreManager.chooseClientAlias: Found client alias in custom keystore: "
                            + x509KeyManager.toString());
            //Found client alias in a custom keystore return it.
            return x509KeyManager.chooseClientAlias(keyType, principals, socket);
        }/* w  w  w  . j a  v a 2  s .c o  m*/
    }

    //Return client alias from JAVA VM keystor or null;
    return javaDefaultKeyManager.chooseClientAlias(keyType, principals, socket);
}

From source file:de.betterform.connector.http.ssl.BetterFORMKeyStoreManager.java

public String chooseServerAlias(String keyType, Principal[] principals, Socket socket) {
    Iterator<X509KeyManager> iterator = this.customX509KeyManagers.iterator();
    while (iterator.hasNext()) {
        X509KeyManager x509KeyManager = iterator.next();
        if (x509KeyManager.chooseServerAlias(keyType, principals, socket) != null) {
            BetterFORMKeyStoreManager.LOGGER.trace(
                    "BetterFORMKeyStoreManager.chooseServerAlias: Found server alias in custom keystore: "
                            + x509KeyManager.toString());
            //Found server alias in a custom keystore return it.
            return x509KeyManager.chooseServerAlias(keyType, principals, socket);
        }/*ww w . j  a  v a2  s . co m*/
    }

    //Return server alias from JAVA VM keystor or null;
    return javaDefaultKeyManager.chooseServerAlias(keyType, principals, socket);
}

From source file:de.betterform.connector.http.ssl.BetterFORMKeyStoreManager.java

public X509Certificate[] getCertificateChain(String alias) {
    Iterator<X509KeyManager> iterator = this.customX509KeyManagers.iterator();
    while (iterator.hasNext()) {
        X509KeyManager x509KeyManager = iterator.next();
        X509Certificate[] certificateChain = x509KeyManager.getCertificateChain(alias);
        if (certificateChain != null && certificateChain.length > 0) {
            BetterFORMKeyStoreManager.LOGGER
                    .trace("BetterFORMKeyStoreManager.getCertificateChain: Certificate chain found for " + alias
                            + " in custom keystore: " + x509KeyManager.toString());
            //Found server alias in a custom keystore return it.
            return x509KeyManager.getCertificateChain(alias);
        }/*from   w w w  . j  av  a2s  .co m*/
    }

    //Return server alias from JAVA VM keystor or null;
    return javaDefaultKeyManager.getCertificateChain(alias);
}