Package io.grpc.alts.internal
Class NettyTsiHandshaker
java.lang.Object
io.grpc.alts.internal.NettyTsiHandshaker
A wrapper for a
TsiHandshaker that accepts netty ByteBufs.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidclose()(package private) TsiFrameProtectorcreateFrameProtector(int maxFrameSize, io.netty.buffer.ByteBufAllocator alloc) Creates a frame protector from a completed handshake.(package private) TsiFrameProtectorcreateFrameProtector(io.netty.buffer.ByteBufAllocator alloc) Creates a frame protector from a completed handshake.(package private) TsiPeerReturns the peer extracted from a completed handshake.(package private) ObjectReturns the peer extracted from a completed handshake.(package private) voidgetBytesToSendToPeer(io.netty.buffer.ByteBuf out) Gets data that is ready to be sent to the to the remote peer.(package private) booleanReturns true if and only if the handshake is still in progress.(package private) booleanprocessBytesFromPeer(io.netty.buffer.ByteBuf data) Process handshake data received from the remote peer.
-
Field Details
-
unwrapper
-
internalHandshaker
-
-
Constructor Details
-
NettyTsiHandshaker
-
-
Method Details
-
getBytesToSendToPeer
Gets data that is ready to be sent to the to the remote peer. This should be called in a loop until no bytes are written to the output buffer.- Parameters:
out- the buffer to receive the bytes.- Throws:
GeneralSecurityException
-
processBytesFromPeer
Process handshake data received from the remote peer.- Returns:
true, if the handshake has all the data it needs to process andfalse, if the method must be called again to complete processing.- Throws:
GeneralSecurityException
-
isInProgress
boolean isInProgress()Returns true if and only if the handshake is still in progress.- Returns:
- true, if the handshake is still in progress, false otherwise.
-
extractPeer
Returns the peer extracted from a completed handshake.- Returns:
- the extracted peer.
- Throws:
GeneralSecurityException
-
extractPeerObject
Returns the peer extracted from a completed handshake.- Returns:
- the extracted peer.
- Throws:
GeneralSecurityException
-
createFrameProtector
Creates a frame protector from a completed handshake. No other methods may be called after the frame protector is created.- Parameters:
maxFrameSize- the requested max frame size, the callee is free to ignore.- Returns:
- a new
TsiFrameProtector.
-
createFrameProtector
Creates a frame protector from a completed handshake. No other methods may be called after the frame protector is created.- Returns:
- a new
TsiFrameProtector.
-
close
void close()
-