Class SymmetricEncryptionHandler
- java.lang.Object
-
- org.apache.plc4x.java.opcua.context.SymmetricEncryptionHandler
-
public class SymmetricEncryptionHandler extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Conversationconversationprotected static intSECURE_MESSAGE_HEADER_SIZEprotected SecurityPolicysecurityPolicyprotected static intSEQUENCE_HEADER_SIZE
-
Constructor Summary
Constructors Constructor Description SymmetricEncryptionHandler(Conversation channel, SecurityPolicy policy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessagePDUdecodeMessage(Chunk chunk, MessagePDU message)protected intdecrypt(WriteBufferByteBased chunkBuffer, Chunk chunk, int messageLength)List<MessagePDU>encodeMessage(Chunk chunk, MessagePDU message, Supplier<Integer> sequenceSupplier)protected voidencrypt(WriteBufferByteBased buffer, int securityHeaderSize, int plainTextBlockSize, int cipherTextBlockSize, int blockCount)protected byte[]sign(byte[] data)protected voidverify(WriteBufferByteBased buffer, Chunk chunk, int messageLength)
-
-
-
Field Detail
-
SECURE_MESSAGE_HEADER_SIZE
protected static final int SECURE_MESSAGE_HEADER_SIZE
- See Also:
- Constant Field Values
-
SEQUENCE_HEADER_SIZE
protected static final int SEQUENCE_HEADER_SIZE
- See Also:
- Constant Field Values
-
conversation
protected final Conversation conversation
-
securityPolicy
protected final SecurityPolicy securityPolicy
-
-
Constructor Detail
-
SymmetricEncryptionHandler
public SymmetricEncryptionHandler(Conversation channel, SecurityPolicy policy)
-
-
Method Detail
-
verify
protected void verify(WriteBufferByteBased buffer, Chunk chunk, int messageLength) throws Exception
- Throws:
Exception
-
decrypt
protected int decrypt(WriteBufferByteBased chunkBuffer, Chunk chunk, int messageLength) throws Exception
- Throws:
Exception
-
encrypt
protected void encrypt(WriteBufferByteBased buffer, int securityHeaderSize, int plainTextBlockSize, int cipherTextBlockSize, int blockCount) throws Exception
- Throws:
Exception
-
sign
protected byte[] sign(byte[] data) throws GeneralSecurityException- Throws:
GeneralSecurityException
-
encodeMessage
public final List<MessagePDU> encodeMessage(Chunk chunk, MessagePDU message, Supplier<Integer> sequenceSupplier)
-
decodeMessage
public final MessagePDU decodeMessage(Chunk chunk, MessagePDU message)
-
-