Java – define encryption suite for TLS in JCA

I want to use JCA to support the following cipher Suites in TLS:

> TLS_ PSK_ WITH_ 3DES_ EDE_ CBC_ SHA > TLS_ PSK_ WITH_ AES_ 128_ CBC_ SHA > TLS_ PSK_ WITH_ NULL_ SHA > TLS_ PSK_ WITH_ AES_ 128_ CBC_ SHA256 > TLS_ PSK_ WITH_ NULL_ SHA256

They can be in JDK7 instead of JDK6, not bouncy castle

If I want the support in JDK6, I can extend JCA to implement the support of these PSK extensions, using JSSE SPI, provider and callback methods I can redefine or add new password implementations at runtime, but I'm not sure JCA provides enough granularity to add new password suites to TLS

Solution

The clean way is to implement your own sslsocketfactory

If you want to try adding methods that I only see modifying inner classes through reflection

Relevant courses are:

com. sun. net. ssl. internal. ssl. CipherSuite

It has an overloaded private static method "add" to add the password implementation to the supported list It may be worth a try

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>