本文整理汇总了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);
}
}
示例2: getServerEncryptionOptions
import org.apache.cassandra.config.EncryptionOptions.ServerEncryptionOptions; //导入依赖的package包/类
public static ServerEncryptionOptions getServerEncryptionOptions()
{
return conf.server_encryption_options;
}