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];
                managers[i] = new WrappedX509KeyManager(manager, keys);
            }
        }
       
        // Get the default trust managers
View Full Code Here


    }
  }

  private SSLContext createContextForName(String name) throws GeneralSecurityException {
    final HostCertificateData hostCertificateData = certificateCreator.createCertificateDataFor(name);
    final X509KeyManager km = new VegaX509KeyManager(hostCertificateData);
    final SSLContext ctx = SSLContext.getInstance("SSLv3");
    ctx.init(new KeyManager[] {km}, null, null);
    return ctx;
  }
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

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

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

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

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

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

    for (Iterator it = getX509KeyManagers(myKeyManagers).iterator(); it.hasNext();) {
      final X509KeyManager keyManager = (X509KeyManager)it.next();
      final X509Certificate[] certificateChain = keyManager.getCertificateChain(location);
      if (certificateChain != null) {
        return certificateChain;
      }
    }
View Full Code Here

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

    for (Iterator it = getX509KeyManagers(myKeyManagers).iterator(); it.hasNext();) {
      final X509KeyManager keyManager = (X509KeyManager)it.next();
      final PrivateKey privateKey = keyManager.getPrivateKey(string);
      if (privateKey != null) {
        return privateKey;
      }
    }
View Full Code Here

     */
    public X509Certificate[] getCertificateChain(String alias) {
        if(_logger.isLoggable(Level.FINE)){
            _logger.log(Level.FINE,"Getting certificate chain");
        }
        X509KeyManager keyMgr = getManagerFromToken(alias);
        if (keyMgr != null) {
            String aliasName = alias.substring(alias.indexOf(':') + 1);
            return keyMgr.getCertificateChain(aliasName);
        } else {
            return mgr.getCertificateChain(alias);
        }
    }
View Full Code Here

     */
    public PrivateKey getPrivateKey(String alias) {
        if(_logger.isLoggable(Level.FINE)){
      _logger.log(Level.FINE, "Getting private key for alias:{0}", 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

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.