Example usage for io.netty.handler.ssl OpenSsl availableJavaCipherSuites

List of usage examples for io.netty.handler.ssl OpenSsl availableJavaCipherSuites

Introduction

In this page you can find the example usage for io.netty.handler.ssl OpenSsl availableJavaCipherSuites.

Prototype

public static Set<String> availableJavaCipherSuites() 

Source Link

Document

Returns all the available cipher suites (Java-style).

Usage

From source file:co.elastic.tealess.cli.EnvironmentCommand.java

License:Apache License

public static Set<CipherSuite> getCipherSuites(SSLEngine engine) {
    Set<CipherSuite> suites = new TreeSet<>();

    List<String> javaAllCiphers = Arrays.asList(engine.getSupportedCipherSuites());
    List<String> javaEnabledCiphers = Arrays.asList(engine.getEnabledCipherSuites());
    List<String> tcnativeCiphers = new ArrayList<>(OpenSsl.availableJavaCipherSuites());

    Set<String> ciphers = new TreeSet<>();
    ciphers.addAll(javaAllCiphers);/* w  w  w .j a  va  2s  .c o m*/
    ciphers.addAll(tcnativeCiphers);

    ciphers.stream().sorted().forEach(suite -> {
        boolean enabled = javaEnabledCiphers.contains(suite);
        boolean java = javaAllCiphers.contains(suite);
        boolean tcnative = tcnativeCiphers.contains(suite);
        suites.add(new CipherSuite(suite, enabled, java, tcnative));
    });
    return suites;
}