Package io.grpc.alts.internal
Interface TsiFrameProtector
-
- All Known Implementing Classes:
AltsTsiFrameProtector
public interface TsiFrameProtectorThis object protects and unprotects netty buffers once the handshake is done.Implementations of this object must be thread compatible.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceTsiFrameProtector.Consumer<T>A mirror of java.util.function.Consumer without the Java 8 dependency.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddestroy()Must be called to release all associated resources (instance cannot be used afterwards).voidprotectFlush(java.util.List<io.netty.buffer.ByteBuf> unprotectedBufs, TsiFrameProtector.Consumer<io.netty.buffer.ByteBuf> ctxWrite, io.netty.buffer.ByteBufAllocator alloc)Protects the buffers by performing framing and encrypting/appending MACs.voidunprotect(io.netty.buffer.ByteBuf in, java.util.List<java.lang.Object> out, io.netty.buffer.ByteBufAllocator alloc)Unprotects the buffers by removing the framing and decrypting/checking MACs.
-
-
-
Method Detail
-
protectFlush
void protectFlush(java.util.List<io.netty.buffer.ByteBuf> unprotectedBufs, TsiFrameProtector.Consumer<io.netty.buffer.ByteBuf> ctxWrite, io.netty.buffer.ByteBufAllocator alloc) throws java.security.GeneralSecurityExceptionProtects the buffers by performing framing and encrypting/appending MACs.- Parameters:
unprotectedBufs- contain the payload that will be protectedctxWrite- is called with buffers containing protected frames and must release the given buffersalloc- is used to allocate new buffers for the protected frames- Throws:
java.security.GeneralSecurityException
-
unprotect
void unprotect(io.netty.buffer.ByteBuf in, java.util.List<java.lang.Object> out, io.netty.buffer.ByteBufAllocator alloc) throws java.security.GeneralSecurityExceptionUnprotects the buffers by removing the framing and decrypting/checking MACs.- Parameters:
in- contains (partial) protected framesout- is only used to append unprotected payload buffersalloc- is used to allocate new buffers for the unprotected frames- Throws:
java.security.GeneralSecurityException
-
destroy
void destroy()
Must be called to release all associated resources (instance cannot be used afterwards).
-
-