public class ChunkFactory extends ByteBufferFactory
Padding and the size of the message is pre-written to the chunk.
| Modifier and Type | Class and Description |
|---|---|
static class |
ChunkFactory.AcknowledgeChunkFactory |
static class |
ChunkFactory.AsymmMsgChunkFactory |
static class |
ChunkFactory.ErrorMessageChunkFactory |
static class |
ChunkFactory.HelloChunkFactory |
| Modifier and Type | Field and Description |
|---|---|
int |
cipherBlockSize |
int |
maxChunkSize |
int |
maxPlaintextSize |
int |
messageHeaderSize |
int |
securityHeader |
MessageSecurityMode |
securityMode |
int |
sequenceHeader |
int |
signatureSize |
BIG_ENDIAN_HEAP_BYTEBUFFER_FACTORY, DEFAULT_ENDIAN_HEAP_BYTEBUFFER_FACTORY, LITTLE_ENDIAN_HEAP_BYTEBUFFER_FACTORY| Constructor and Description |
|---|
ChunkFactory(int maxChunkSize,
int messageHeaderSize,
int securityHeaderSize,
int sequenceHeaderSize,
int signatureSize,
int cipherBlockSize,
MessageSecurityMode securityMode,
int keySize)
Constructor for ChunkFactory.
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
allocate(int bodySize)
Creates a
ByteBuffer with the given capacity. |
void |
encryptChunk(ByteBuffer chunk)
encryptChunk.
|
ByteBuffer |
expandToCompleteChunk(ByteBuffer plaintext)
Expand allocated bytebuffer to complete chunk.
|
ByteBuffer[] |
expandToCompleteChunk(ByteBuffer[] plaintexts)
expandToCompleteChunk.
|
protected int |
getMinimumPadding()
getMinimumPadding.
|
void |
signChunk(ByteBuffer chunk)
signChunk.
|
protected void |
writePadding(int paddingPosition,
int padding,
ByteBuffer result)
writePadding.
|
protected void |
writePaddingSize(int paddingPosition,
int paddingSize,
ByteBuffer result)
writePaddingSize.
|
public int maxChunkSize
public int maxPlaintextSize
public int messageHeaderSize
public int securityHeader
public int sequenceHeader
public int cipherBlockSize
public int signatureSize
public MessageSecurityMode securityMode
public ChunkFactory(int maxChunkSize,
int messageHeaderSize,
int securityHeaderSize,
int sequenceHeaderSize,
int signatureSize,
int cipherBlockSize,
MessageSecurityMode securityMode,
int keySize)
Constructor for ChunkFactory.
maxChunkSize - a int.messageHeaderSize - a int.securityHeaderSize - a int.sequenceHeaderSize - a int.signatureSize - a int.cipherBlockSize - a int.securityMode - a MessageSecurityMode object.keySize - a int.public ByteBuffer allocate(int bodySize)
ByteBuffer with the given capacity.
Allocate chunk for a message with a given body size.allocate in class ByteBufferFactorypublic void encryptChunk(ByteBuffer chunk)
encryptChunk.
chunk - a ByteBuffer object.public ByteBuffer expandToCompleteChunk(ByteBuffer plaintext)
plaintext - a ByteBuffer object.public ByteBuffer[] expandToCompleteChunk(ByteBuffer[] plaintexts)
expandToCompleteChunk.
plaintexts - an array of ByteBuffer objects.ByteBuffer objects.public void signChunk(ByteBuffer chunk)
signChunk.
chunk - a ByteBuffer object.protected int getMinimumPadding()
getMinimumPadding.
protected void writePadding(int paddingPosition,
int padding,
ByteBuffer result)
writePadding.
paddingPosition - a int.padding - the size of the whole padding; padding, padding fill, extra padding byteresult - a ByteBuffer object.protected void writePaddingSize(int paddingPosition,
int paddingSize,
ByteBuffer result)
writePaddingSize.
paddingPosition - a int.paddingSize - a int.result - a ByteBuffer object.Copyright © 2026. All rights reserved.