MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / to_binary

Method to_binary

opcua/common/connection.py:68–75  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

66 return size // pbs * self.security_policy.encrypted_block_size()
67
68 def to_binary(self):
69 security = struct_to_binary(self.SecurityHeader)
70 encrypted_part = struct_to_binary(self.SequenceHeader) + self.Body
71 encrypted_part += self.security_policy.padding(len(encrypted_part))
72 self.MessageHeader.body_size = len(security) + self.encrypted_size(len(encrypted_part))
73 header = header_to_binary(self.MessageHeader)
74 encrypted_part += self.security_policy.signature(header + security + encrypted_part)
75 return header + security + self.security_policy.encrypt(encrypted_part)
76
77 @staticmethod
78 def max_body_size(crypto, max_chunk_size):

Callers 1

message_to_binaryMethod · 0.45

Calls 6

encrypted_sizeMethod · 0.95
struct_to_binaryFunction · 0.90
header_to_binaryFunction · 0.90
paddingMethod · 0.45
signatureMethod · 0.45
encryptMethod · 0.45

Tested by

no test coverage detected