当前位置: 首页>>代码示例>>Java>>正文


Java ServerEncryptionOptions类代码示例

本文整理汇总了Java中org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions的典型用法代码示例。如果您正苦于以下问题:Java ServerEncryptionOptions类的具体用法?Java ServerEncryptionOptions怎么用?Java ServerEncryptionOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ServerEncryptionOptions类属于org.apache.cassandra.config.EncryptionOptions包,在下文中一共展示了ServerEncryptionOptions类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testServerSocketCiphers

import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions; //导入依赖的package包/类
@Test
public void testServerSocketCiphers() throws IOException
{
    ServerEncryptionOptions options = new EncryptionOptions.ServerEncryptionOptions();
    options.keystore = "test/conf/keystore.jks";
    options.keystore_password = "cassandra";
    options.truststore = options.keystore;
    options.truststore_password = options.keystore_password;
    options.cipher_suites = new String[] {
        "TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_256_CBC_SHA",
        "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
        "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"
    };

    // enabled ciphers must be a subset of configured ciphers with identical order
    try (SSLServerSocket socket = SSLFactory.getServerSocket(options, InetAddress.getLocalHost(), 55123))
    {
        String[] enabled = socket.getEnabledCipherSuites();
        String[] wanted = Iterables.toArray(Iterables.filter(Lists.newArrayList(options.cipher_suites),
                                                             Predicates.in(Lists.newArrayList(enabled))),
                                            String.class);
        assertArrayEquals(wanted, enabled);
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:25,代码来源:SSLFactoryTest.java

示例2: getServerEncryptionOptions

import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions; //导入依赖的package包/类
public static ServerEncryptionOptions getServerEncryptionOptions()
{
    return conf.server_encryption_options;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:DatabaseDescriptor.java


注:本文中的org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。