Package org.apache.commons.ssl

Examples of org.apache.commons.ssl.HttpSecureProtocol


      throws GeneralSecurityException
  {
    Protocol ssafProtocol = null;
    try
    {
      HttpSecureProtocol httpSecureProtocol = new HttpSecureProtocol();
      // setup keyStore
      File keystore = new File(keyStoreFilePath);
      char[] keyStorePasswordInCharArray = keyStorePassword.toCharArray();
     
      KeyMaterial keyMaterial = new KeyMaterial(keystore,
          keyStorePasswordInCharArray);
     
      // setup trustStore
      File TrustMaterial = new File(trustStoreFilePath);
      char[] trustStorePasswordPasswordInCharArray = trustStorePassword
          .toCharArray();
     
      TrustMaterial trustMaterial = new TrustMaterial(TrustMaterial,
          trustStorePasswordPasswordInCharArray);

      httpSecureProtocol.setKeyMaterial(keyMaterial);
      httpSecureProtocol.setTrustMaterial(trustMaterial);
      httpSecureProtocol.setCheckCRL(true);
      httpSecureProtocol.setCheckExpiry(true);
      httpSecureProtocol.setCheckHostname(true);

      ssafProtocol = new Protocol("https",
          (ProtocolSocketFactory) httpSecureProtocol, portNumber);
    }
    catch (GeneralSecurityException e1)
View Full Code Here

TOP

Related Classes of org.apache.commons.ssl.HttpSecureProtocol

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.