Codota Logo
TLSCertificateTrust
Code IndexAdd Codota to your IDE (free)

How to use
TLSCertificateTrust
in
com.ociweb.pronghorn.network

Best Java code snippets using com.ociweb.pronghorn.network.TLSCertificateTrust (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: com.ociweb/Ph-TLS-pureJava

public static TLSService make(InputStream keyStoreInputStream, String keystorePassword, InputStream trustStoreInputStream, String keyPassword, boolean trustAll) {
  KeyManagerFactory keyManagerFactory=null;
  TrustManagerFactory trustManagerFactory=null;
  try {
    keyManagerFactory = keyStoreInputStream != null ? TLSCertificateTrust.createKeyManagers(keyStoreInputStream, keystorePassword, keyPassword) : null;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  try {
    trustManagerFactory = trustStoreInputStream != null ? TLSCertificateTrust.createTrustManagers(trustStoreInputStream, keystorePassword) : null;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  return new TLSService(keyManagerFactory, trustManagerFactory, trustAll, null);
}
origin: com.ociweb/Ph-TLS-pureJava

private TLSService(KeyManagerFactory keyManagerFactory, TrustManagerFactory trustManagerFactory, boolean trustAll, SecureRandom secureRandom) {
  try {
    //protocol The SSL/TLS protocol to be used. Java 1.6 will only run with up to TLSv1 protocol. Java 1.7 or higher also supports TLSv1.1 and TLSv1.2 protocols.
    final String PROTOCOL    = "TLSv1.2";
    final String PROTOCOL1_3 = "TLSv1.3"; //check Java version and move up to this ASAP.
    this.protocols = new String[]{PROTOCOL}; //[SSLv2Hello, TLSv1, TLSv1.1, TLSv1.2]
    KeyManager[] keyManagers = keyManagerFactory != null ? keyManagerFactory.getKeyManagers() : null;
    TrustManager[] trustManagers = null;
    if (trustAll) {
      trustManagers = TLSCertificateTrust.trustManagerFactoryTrustAllCerts();
    }
    else if (trustManagerFactory != null) {
      trustManagers = trustManagerFactory.getTrustManagers();
    }
    context = SSLContext.getInstance(PROTOCOL);
    context.init(keyManagers, trustManagers, secureRandom);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  //run once first to determine which cypher suites we will be using.
  createSSLEngineServer();
}
 
origin: com.ociweb/ph-tls-pure-java

private TLSService(KeyManagerFactory keyManagerFactory, TrustManagerFactory trustManagerFactory, boolean trustAll, SecureRandom secureRandom) {
  try {
    this.protocols = selectSupportedProtocols();		
    
    KeyManager[] keyManagers = keyManagerFactory != null ? keyManagerFactory.getKeyManagers() : null;
    TrustManager[] trustManagers = null;
    if (trustAll) {
      trustManagers = TLSCertificateTrust.trustManagerFactoryTrustAllCerts();
    } else if (trustManagerFactory != null) {
      trustManagers = trustManagerFactory.getTrustManagers();
    }
    context = SSLContext.getInstance(this.protocols[0]);
    context.init(keyManagers, trustManagers, secureRandom);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  //run once first to determine which cypher suites we will be using.
  createSSLEngineServer();
}
origin: oci-pronghorn/Pronghorn

public static TLSService make(InputStream keyStoreInputStream, String keystorePassword, InputStream trustStoreInputStream, String keyPassword, boolean trustAll) {
  KeyManagerFactory keyManagerFactory=null;
  TrustManagerFactory trustManagerFactory=null;
  try {
    keyManagerFactory = keyStoreInputStream != null ? TLSCertificateTrust.createKeyManagers(keyStoreInputStream, keystorePassword, keyPassword) : null;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  try {
    trustManagerFactory = trustStoreInputStream != null ? TLSCertificateTrust.createTrustManagers(trustStoreInputStream, keystorePassword) : null;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  return new TLSService(keyManagerFactory, trustManagerFactory, trustAll, null);
}
origin: oci-pronghorn/Pronghorn

private TLSService(KeyManagerFactory keyManagerFactory, TrustManagerFactory trustManagerFactory, boolean trustAll, SecureRandom secureRandom) {
  try {
    this.protocols = selectSupportedProtocols();		
    
    KeyManager[] keyManagers = keyManagerFactory != null ? keyManagerFactory.getKeyManagers() : null;
    TrustManager[] trustManagers = null;
    if (trustAll) {
      trustManagers = TLSCertificateTrust.trustManagerFactoryTrustAllCerts();
    } else if (trustManagerFactory != null) {
      trustManagers = trustManagerFactory.getTrustManagers();
    }
    context = SSLContext.getInstance(this.protocols[0]);
    context.init(keyManagers, trustManagers, secureRandom);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  //run once first to determine which cypher suites we will be using.
  createSSLEngineServer();
}
origin: com.ociweb/ph-tls-pure-java

public static TLSService make(InputStream keyStoreInputStream, String keystorePassword, InputStream trustStoreInputStream, String keyPassword, boolean trustAll) {
  KeyManagerFactory keyManagerFactory=null;
  TrustManagerFactory trustManagerFactory=null;
  try {
    keyManagerFactory = keyStoreInputStream != null ? TLSCertificateTrust.createKeyManagers(keyStoreInputStream, keystorePassword, keyPassword) : null;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  try {
    trustManagerFactory = trustStoreInputStream != null ? TLSCertificateTrust.createTrustManagers(trustStoreInputStream, keystorePassword) : null;
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  return new TLSService(keyManagerFactory, trustManagerFactory, trustAll, null);
}
com.ociweb.pronghorn.networkTLSCertificateTrust

Most used methods

  • createKeyManagers
    Creates the key managers required to initiate the SSLContext, using a JKS keystore as an input.
  • createTrustManagers
    Creates the trust managers required to initiate the SSLContext, using a JKS keystore as an input.
  • trustManagerFactoryTrustAllCerts

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • Notification (javax.management)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now