我有这个ConnectionConfiguration
ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration(host, port);
connectionConfiguration.setCompressionEnabled(false);
connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
connectionConfiguration.setSASLAuthenticationEnabled(true);
connectionConfiguration.setDebuggerEnabled(true);
connectionConfiguration.setTruststorePath(TRUST_STORE_PATH);
connectionConfiguration.setTruststorePassword("changeit");
然后我连接
connection = new XMPPConnection(connectionConfiguration);
然后发送消息
Message msg = new Message(to, Message.Type.chat);
msg.setBody(text);
connection.sendPacket(msg);
我应该更改哪些内容来加密邮件?我需要这样的东西:
key = connection.generateEncryptionKeys()
和
msg.encrypt(key)
我正在使用Smack库。