Package javax.net.ssl

Examples of javax.net.ssl.X509KeyManager


        log.debug(keys.getClass().toString());

        // Now wrap the default managers with our key manager
        for (int i = 0; i < managers.length; i++) {
            if (managers[i] instanceof X509KeyManager) {
                X509KeyManager manager = (X509KeyManager) managers[i];
                newManagers[i] = new WrappedX509KeyManager(manager, keys);
            } else {
                newManagers[i] = managers[i];
            }
        }
View Full Code Here


        log.debug(keys.getClass().toString());

        // Now wrap the default managers with our key manager
        for (int i = 0; i < managers.length; i++) {
            if (managers[i] instanceof X509KeyManager) {
                X509KeyManager manager = (X509KeyManager) managers[i];
                newManagers[i] = new WrappedX509KeyManager(manager, keys);
            } else {
                newManagers[i] = managers[i];
            }
        }
View Full Code Here

        log.debug(keys.getClass().toString());

        // Now wrap the default managers with our key manager
        for (int i = 0; i < managers.length; i++) {
            if (managers[i] instanceof X509KeyManager) {
                X509KeyManager manager = (X509KeyManager) managers[i];
                newManagers[i] = new WrappedX509KeyManager(manager, keys);
            } else {
                newManagers[i] = managers[i];
            }
        }
View Full Code Here

        log.debug(keys.getClass().toString());

        // Now wrap the default managers with our key manager
        for (int i = 0; i < managers.length; i++) {
            if (managers[i] instanceof X509KeyManager) {
                X509KeyManager manager = (X509KeyManager) managers[i];
                managers[i] = new WrappedX509KeyManager(manager, keys);
            }
        }

        // Get the default trust managers
View Full Code Here

     */
    public PrivateKey getPrivateKey(String alias) {
        if(_logger.isLoggable(Level.FINE)){
      _logger.log(Level.FINE,"Getting private key for alias:" + alias);
  }
        X509KeyManager keyMgr = getManagerFromToken(alias);
        if (keyMgr != null) {
            String aliasName = alias.substring(alias.indexOf(':') + 1);
            return keyMgr.getPrivateKey(aliasName);
        } else {
            return mgr.getPrivateKey(alias);
        }
    }   
View Full Code Here

     * Find the corresponding X509KeyManager associated to token in alias.
     * It returns null if there is n
     * @param tokenAlias of the form &lt;tokenName&gt;:&lt;aliasName&gt;
     */
    private X509KeyManager getManagerFromToken(String tokenAlias) {
        X509KeyManager keyMgr = null;
        int ind = -1;
        if (supportTokenAlias && tokenAlias != null && (ind = tokenAlias.indexOf(':')) != -1) {
            String tokenName = alias.substring(0, ind);
            keyMgr = (X509KeyManager)tokenName2MgrMap.get(tokenName);
        }
View Full Code Here

        log.debug(keys.getClass().toString());

        // Now wrap the default managers with our key manager
        for (int i = 0; i < managers.length; i++) {
            if (managers[i] instanceof X509KeyManager) {
                X509KeyManager manager = (X509KeyManager) managers[i];
                managers[i] = new WrappedX509KeyManager(manager, keys);
            }
        }

        // Get the default trust managers
View Full Code Here

    }

    protected void validateKeyManagers(KeyManager[] kms) {
        assertEquals(1, kms.length);
        assertTrue(kms[0] instanceof X509KeyManager);
        X509KeyManager km = (X509KeyManager) kms[0];
        assertNotNull(km.getPrivateKey("server"));
    }
View Full Code Here

    if (!initializeNoException()) {
      return null;
    }

    for (Iterator it = getX509KeyManagers(myKeyManagers).iterator(); it.hasNext();) {
      final X509KeyManager keyManager = (X509KeyManager)it.next();
      final String[] clientAliases = keyManager.getClientAliases(location, principals);
      if (clientAliases != null) {
        return clientAliases;
      }
    }
View Full Code Here

    if (!initializeNoException()) {
      return null;
    }

    for (Iterator it = getX509KeyManagers(myKeyManagers).iterator(); it.hasNext();) {
      final X509KeyManager keyManager = (X509KeyManager)it.next();
      final String clientAlias = keyManager.chooseClientAlias(strings, principals, socket);
      if (clientAlias != null) {
        return clientAlias;
      }
    }
View Full Code Here

TOP

Related Classes of javax.net.ssl.X509KeyManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.