Interface NettyEncryptor
- All Superinterfaces:
AutoCloseable, Encryptor
An
Encryptor that can also encrypt directly between Netty ByteBufs.
Both buffers must be direct. The frame is read from the readable bytes of frame, and the encrypted frame is
written at the writer index of encryptedFrame, which is advanced on success.
- See Also:
-
Method Summary
Methods inherited from interface Encryptor
assignSsrcToCodec, close, encrypt, encrypt, getMaxCiphertextByteSize, getProtocolVersion, setKeyRatchet, setPassthroughMode, setProtocolVersionChangedCallback
-
Method Details
-
encrypt
int encrypt(MediaType mediaType, int ssrc, io.netty.buffer.ByteBuf frame, io.netty.buffer.ByteBuf encryptedFrame) Encrypts a media frame into Netty ByteBuf.- Parameters:
mediaType- The type of media.ssrc- The SSRC of the stream.frame- The input ByteBuf containing the plaintext frame.encryptedFrame- The output ByteBuf to write the encrypted frame into. Outside passthrough mode it must have room forEncryptor.getMaxCiphertextByteSize(MediaType, int)bytes, or encryption fails.- Returns:
- The number of bytes written to
encryptedFrameon success, or a negative error code on failure.
-