如何使用 Bouncy Castle 编辑 Java 中的密码套件列表

How can I edit the list of cipher suite in Java using Bouncy Castle(如何使用 Bouncy Castle 编辑 Java 中的密码套件列表)
本文介绍了如何使用 Bouncy Castle 编辑 Java 中的密码套件列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

以下代码列出了 Java SE 8 支持的密码套件:

The following code lists the supported cipher suites by Java SE 8:

import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Arrays;

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSocketFactory;
public class ListCiphers {

    public static void main(String[] args) throws UnknownHostException, IOException
    {
        SSLSocketFactory factory = HttpsURLConnection.getDefaultSSLSocketFactory(); 
        String[] cipherSuites = factory.getSupportedCipherSuites();
        System.out.println(Arrays.toString(cipherSuites));

    } //end main
}

我想制作配置了一些特定密码套件列表的 SSL 客户端.我想使用的密码套件是标准化的,但 Jva SE 8 不支持.例如,这个密码在 firefox 中列出:

I want to make SSL client which is configured with some specific list of cipher suites. The cipher suites I want to use are standardized but not supported by Jva SE 8. For example, this cipher is listed in firefox:

ECDHE_ECDSA_WITH_AES_256_SHA

请帮助我以任何方式允许我在我的 SSL 客户端中编辑密码套件列表.充气城堡对此有帮助吗?如何?请一步一步给我清楚.另外,如果您知道我想要什么可以通过使用其他语言(例如 python)来实现,也请帮助我.

Please, help me with any way that allows me to edit the list of cipher suite in my SSL client. Does Bouncy Castle help in this? How? Please, give me clear step by step. Also if you knwo what I want can be achieved by using another language such as python, also please help me.

推荐答案

如何使用 Bouncy Castle 编辑 Java 中的密码套件列表

How can I edit the list of cipher suite in Java using Bouncy Castle

请参阅要为 SSL 套接字启用哪些密码套件? 并使用 SSLSocketFactoryEx.它是 Java 的 SSLSocketFactory

See Which Cipher Suites to enable for SSL Socket? and use SSLSocketFactoryEx. Its a drop-in replacement for Java's SSLSocketFactory

如果你不想使用 SSLSocketFactoryEx,那么就撕掉代码来找到密码套件的交集.

If you don't want to use SSLSocketFactoryEx, then rip the code to find the intersection of cipher suites.

它控制协议和密码套件.没有意外的惊喜,例如从 SSLSocketFactory.getInstance("TLS"); 获取 SSLv3 套接字.

It controls both protocols and cipher suites. There are no unexpected surprises, like getting a SSLv3 socket back from SSLSocketFactory.getInstance("TLS");.

没有什么是可配置的,所以用户不能在脚上开枪.它也为 TLS 1.3 做好了准备

Nothing is configurable, so the user cannot shoot themselves in the foot. It's also ready for TLS 1.3

这篇关于如何使用 Bouncy Castle 编辑 Java 中的密码套件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)