public class SSLParser extends Object
Voovan Framework. WebSite: https://github.com/helyho/Voovan Licence: Apache v2 License
Constructor and Description |
---|
SSLParser(SSLEngine engine,
IoSession session)
构造函数
|
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
buildAppDataBuffer() |
ByteBuffer |
buildNetDataBuffer() |
boolean |
doHandShake()
进行 SSL 握手
|
ByteBufferChannel |
getSSlByteBufferChannel() |
SSLEngine |
getSSLEngine()
获取 SSLEngine
|
boolean |
isHandShakeDone()
判断握手是否完成
|
static boolean |
isHandShakeDone(IoSession session)
判断给定的会话握手是否完成
|
void |
release()
释放方法
|
int |
unWarpByteBufferChannel()
读取SSL消息到缓冲区
|
SSLEngineResult |
unwarpData(ByteBuffer netBuffer,
ByteBuffer appBuffer)
解包数据
|
void |
waitHandShakeDone()
等待握手完成
|
SSLEngineResult |
warpData(ByteBuffer buffer)
打包并发送数据
|
public ByteBufferChannel getSSlByteBufferChannel()
public boolean isHandShakeDone()
public SSLEngine getSSLEngine()
public ByteBuffer buildNetDataBuffer()
public ByteBuffer buildAppDataBuffer()
public SSLEngineResult warpData(ByteBuffer buffer) throws IOException
buffer
- 需要的数据缓冲区IOException
- IO 异常public SSLEngineResult unwarpData(ByteBuffer netBuffer, ByteBuffer appBuffer) throws SSLException
netBuffer
- 接受解包数据的缓冲区appBuffer
- 接受解包后数据的缓冲区SSLException
- SSL 异常public boolean doHandShake()
public int unWarpByteBufferChannel() throws IOException
IOException
- IO异常public void release()
public static boolean isHandShakeDone(IoSession session)
session
- IoSession 对象public void waitHandShakeDone()
Copyright © 2020 Voovan. All rights reserved.