我有将数据从客户端传输到服务器的项目,我在 java 中使用 ssl,我使用一个密钥来加密和解密我使用 keytool 创建密钥
服务器 Security.addProvider(new Provider());
//Specifying the Keystore details
System.setProperty("javax.net.ssl.keyStore","testkeystore.ks");
System.setProperty("javax.net.ssl.keyStorePassword","mypass");
// Enable debugging to view the handshake and communication which happens between the SSLClient and the SSLServer
// System.setProperty("javax.net.debug","all");
}
// Initialize the Server Socket
SSLServerSocketFactory sslServerSocketfactory = (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
sslServerSocket = (SSLServerSocket)sslServerSocketfactory.createServerSocket(intSSLport);
客户端 System.setProperty("javax.net.ssl.trustStore", "/home/lap/NetBeansProjects/Dionaea-001/testkeystore.ks");
{
// Registering the JSSE provider
Security.addProvider(new Provider());
}
try {
// Creating Client Sockets
SSLSocketFactory sslsocketfactory = (SSLSocketFactory)SSLSocketFactory.getDefault();
SSLSocket sslSocket = (SSLSocket)sslsocketfactory.createSocket(strServerName,intSSLport);
我的问题可以在 SSL 中使用一个密钥吗?我如何知道加密 AES 或 DES 的类型?