Class AsymmetricEncryptionHandler
- java.lang.Object
-
- org.apache.plc4x.java.opcua.context.AsymmetricEncryptionHandler
-
public class AsymmetricEncryptionHandler 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 AsymmetricEncryptionHandler(Conversation conversation, SecurityPolicy securityPolicy, PrivateKey senderPrivateKey)
-
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)byte[]sign(byte[] contentsToSign)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
-
AsymmetricEncryptionHandler
public AsymmetricEncryptionHandler(Conversation conversation, SecurityPolicy securityPolicy, PrivateKey senderPrivateKey)
-
-
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
public byte[] sign(byte[] contentsToSign) 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)
-
-