io.netty.handler.ssl.OpenSsl.isCipherSuiteAvailable()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中io.netty.handler.ssl.OpenSsl.isCipherSuiteAvailable()方法的一些代码示例,展示了OpenSsl.isCipherSuiteAvailable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OpenSsl.isCipherSuiteAvailable()方法的具体详情如下:
包路径:io.netty.handler.ssl.OpenSsl
类名称:OpenSsl
方法名:isCipherSuiteAvailable

OpenSsl.isCipherSuiteAvailable介绍

[英]Returns true if and only if the specified cipher suite is available in OpenSSL. Both Java-style cipher suite and OpenSSL-style cipher suite are accepted.
[中]当且仅当指定的密码套件在OpenSSL中可用时,返回true。Java风格的密码套件和OpenSSL风格的密码套件都被接受。

代码示例

代码示例来源:origin: redisson/redisson

if (!OpenSsl.isCipherSuiteAvailable(converted)) {
  throw new IllegalArgumentException("unsupported cipher suite: " + c + '(' + converted + ')');

代码示例来源:origin: wildfly/wildfly

if (!OpenSsl.isCipherSuiteAvailable(converted)) {
  throw new IllegalArgumentException("unsupported cipher suite: " + c + '(' + converted + ')');

代码示例来源:origin: io.netty/netty-handler

if (!OpenSsl.isCipherSuiteAvailable(converted)) {
  throw new IllegalArgumentException("unsupported cipher suite: " + c + '(' + converted + ')');

代码示例来源:origin: logstash-plugins/logstash-input-beats

public SslSimpleBuilder setCipherSuites(String[] ciphersSuite) throws IllegalArgumentException {
  for(String cipher : ciphersSuite) {
    if(!OpenSsl.isCipherSuiteAvailable(cipher)) {
      throw new IllegalArgumentException("Cipher `" + cipher + "` is not available");
    } else {
      logger.debug("Cipher is supported: " + cipher);
    }
  }
  ciphers = ciphersSuite;
  return this;
}

代码示例来源:origin: apache/activemq-artemis

if (!OpenSsl.isCipherSuiteAvailable(converted)) {
  throw new IllegalArgumentException("unsupported cipher suite: " + c + '(' + converted + ')');

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

if (!OpenSsl.isCipherSuiteAvailable(converted)) {
  throw new IllegalArgumentException("unsupported cipher suite: " + c + '(' + converted + ')');

代码示例来源:origin: org.jboss.eap/wildfly-client-all

if (!OpenSsl.isCipherSuiteAvailable(converted)) {
  throw new IllegalArgumentException("unsupported cipher suite: " + c + '(' + converted + ')');

代码示例来源:origin: floragunncom/search-guard-ssl

final Set<String> openSSLSecureHttpCiphers = new HashSet<>();
for (final String secure : secureHttpSSLCiphers) {
  if (OpenSsl.isCipherSuiteAvailable(secure)) {
    openSSLSecureHttpCiphers.add(secure);
final Set<String> openSSLSecureTransportCiphers = new HashSet<>();
for (final String secure : secureTransportSSLCiphers) {
  if (OpenSsl.isCipherSuiteAvailable(secure)) {
    openSSLSecureTransportCiphers.add(secure);

代码示例来源:origin: floragunncom/search-guard-ssl

@Test
public void testAvailCiphersOpenSSL() throws Exception {
  Assume.assumeTrue(OpenSsl.isAvailable());
  // Set<String> openSSLAvailCiphers = new
  // HashSet<>(OpenSsl.availableCipherSuites());
  // System.out.println("OpenSSL available ciphers: "+openSSLAvailCiphers);
  // ECDHE-RSA-AES256-SHA, ECDH-ECDSA-AES256-SHA, DH-DSS-DES-CBC-SHA,
  // ADH-AES256-SHA256, ADH-CAMELLIA128-SHA
  final Set<String> openSSLSecureCiphers = new HashSet<>();
  for (final String secure : SSLConfigConstants.getSecureSSLCiphers(Settings.EMPTY, false)) {
    if (OpenSsl.isCipherSuiteAvailable(secure)) {
      openSSLSecureCiphers.add(secure);
    }
  }
  System.out.println("OpenSSL secure ciphers: " + openSSLSecureCiphers);
  Assert.assertTrue(openSSLSecureCiphers.size() > 0);
}

相关文章