示例#1
0
    def write(self, ostream):
        tstream = BytearrayStream()
        tstream.write(self.data.buffer)

        self.length = tstream.length()
        super(KeyMaterialStruct, self).write(ostream)
        ostream.write(tstream.buffer)
示例#2
0
    def write(self, ostream):
        tstream = BytearrayStream()
        tstream.write(self.data.buffer)

        self.length = tstream.length()
        super(KeyMaterialStruct, self).write(ostream)
        ostream.write(tstream.buffer)
示例#3
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        if self.private_key_uuid is not None:
            self.private_key_uuid.write(tstream, kmip_version=kmip_version)

        if self.offset is not None:
            self.offset.write(tstream, kmip_version=kmip_version)

        if self.common_template_attribute is not None:
            self.common_template_attribute.write(tstream,
                                                 kmip_version=kmip_version)

        if self.private_key_template_attribute is not None:
            self.private_key_template_attribute.write(
                tstream, kmip_version=kmip_version)

        if self.public_key_template_attribute is not None:
            self.public_key_template_attribute.write(tstream,
                                                     kmip_version=kmip_version)

        self.length = tstream.length()
        super(RekeyKeyPairRequestPayload,
              self).write(ostream, kmip_version=kmip_version)
        ostream.write(tstream.buffer)
示例#4
0
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the contents of the batch item to the stream
        if self.operation is not None:
            self.operation.write(tstream)
        if self.unique_batch_item_id is not None:
            self.unique_batch_item_id.write(tstream)

        self.result_status.write(tstream)

        if self.result_reason is not None:
            self.result_reason.write(tstream)
        if self.result_message is not None:
            self.result_message.write(tstream)
        if self.async_correlation_value is not None:
            self.async_correlation_value.write(tstream)
        if self.response_payload is not None:
            self.response_payload.write(tstream)
        if self.message_extension is not None:
            self.message_extension.write(tstream)

        # Write the length and value of the batch item
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#5
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        """
        Write the data encoding the RevokeRequestPayload object to a stream.
        Args:
            ostream (Stream): A data stream in which to encode object data,
                supporting a write method; usually a BytearrayStream object.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 1.0.
        """
        tstream = BytearrayStream()

        # Write the contents of the request payload
        if self.unique_identifier is not None:
            self.unique_identifier.write(tstream, kmip_version=kmip_version)

        self.revocation_reason.write(tstream, kmip_version=kmip_version)

        if self.compromise_occurrence_date is not None:
            self.compromise_occurrence_date.write(tstream,
                                                  kmip_version=kmip_version)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(RevokeRequestPayload, self).write(ostream,
                                                kmip_version=kmip_version)
        ostream.write(tstream.buffer)
示例#6
0
    def write(self, ostream):
        """
        Write the data encoding the QueryResponsePayload object to a stream.

        Args:
            ostream (Stream): A data stream in which to encode object data,
                supporting a write method; usually a BytearrayStream object.
        """
        tstream = BytearrayStream()

        for operation in self.operations:
            operation.write(tstream)

        for object_type in self.object_types:
            object_type.write(tstream)

        if self.vendor_identification is not None:
            self.vendor_identification.write(tstream)

        if self.server_information is not None:
            self.server_information.write(tstream)

        for application_namespace in self.application_namespaces:
            application_namespace.write(tstream)

        for extension_information in self.extension_information:
            extension_information.write(tstream)

        self.length = tstream.length()
        super(QueryResponsePayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#7
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        # Write the contents of the batch item to the stream
        self.operation.write(tstream, kmip_version=kmip_version)

        if kmip_version >= enums.KMIPVersion.KMIP_2_0:
            if self._ephemeral:
                self._ephemeral.write(tstream, kmip_version=kmip_version)

        if self.unique_batch_item_id is not None:
            self.unique_batch_item_id.write(tstream, kmip_version=kmip_version)

        self.request_payload.write(tstream, kmip_version=kmip_version)

        if self.message_extension is not None:
            self.message_extension.write(tstream, kmip_version=kmip_version)

        # Write the length and value of the batch item
        self.length = tstream.length()
        super(RequestBatchItem, self).write(
            ostream,
            kmip_version=kmip_version
        )
        ostream.write(tstream.buffer)
示例#8
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        # Write the contents of a request header to the stream
        self.protocol_version.write(tstream, kmip_version=kmip_version)
        if self.maximum_response_size is not None:
            self.maximum_response_size.write(
                tstream,
                kmip_version=kmip_version
            )
        if self.asynchronous_indicator is not None:
            self.asynchronous_indicator.write(
                tstream,
                kmip_version=kmip_version
            )
        if self.authentication is not None:
            self.authentication.write(tstream, kmip_version=kmip_version)
        if self.batch_error_cont_option is not None:
            self.batch_error_cont_option.write(
                tstream,
                kmip_version=kmip_version
            )
        if self.batch_order_option is not None:
            self.batch_order_option.write(tstream, kmip_version=kmip_version)
        if self.time_stamp is not None:
            self.time_stamp.write(tstream, kmip_version=kmip_version)
        self.batch_count.write(tstream, kmip_version=kmip_version)

        # Write the length and value of the request header
        self.length = tstream.length()
        super(RequestHeader, self).write(
            ostream,
            kmip_version=kmip_version
        )
        ostream.write(tstream.buffer)
示例#9
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        # Write the contents of the batch item to the stream
        if self.operation is not None:
            self.operation.write(tstream, kmip_version=kmip_version)
        if self.unique_batch_item_id is not None:
            self.unique_batch_item_id.write(tstream, kmip_version=kmip_version)

        self.result_status.write(tstream, kmip_version=kmip_version)

        if self.result_reason is not None:
            self.result_reason.write(tstream, kmip_version=kmip_version)
        if self.result_message is not None:
            self.result_message.write(tstream, kmip_version=kmip_version)
        if self.async_correlation_value is not None:
            self.async_correlation_value.write(
                tstream,
                kmip_version=kmip_version
            )
        if self.response_payload is not None:
            self.response_payload.write(tstream, kmip_version=kmip_version)
        if self.message_extension is not None:
            self.message_extension.write(tstream, kmip_version=kmip_version)

        # Write the length and value of the batch item
        self.length = tstream.length()
        super(ResponseBatchItem, self).write(
            ostream,
            kmip_version=kmip_version
        )
        ostream.write(tstream.buffer)
示例#10
0
文件: query.py 项目: JHUAPL/PyKMIP
    def write(self, ostream):
        """
        Write the data encoding the QueryResponsePayload object to a stream.

        Args:
            ostream (Stream): A data stream in which to encode object data,
                supporting a write method; usually a BytearrayStream object.
        """
        tstream = BytearrayStream()

        for operation in self.operations:
            operation.write(tstream)

        for object_type in self.object_types:
            object_type.write(tstream)

        if self.vendor_identification is not None:
            self.vendor_identification.write(tstream)

        if self.server_information is not None:
            self.server_information.write(tstream)

        for application_namespace in self.application_namespaces:
            application_namespace.write(tstream)

        for extension_information in self.extension_information:
            extension_information.write(tstream)

        self.length = tstream.length()
        super(QueryResponsePayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#11
0
文件: keys.py 项目: poldridge/PyKMIP
    def write(self, ostream):
        tstream = BytearrayStream()

        self.key.write(tstream)

        # Write the length and value of the key wrapping data
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#12
0
    def write(self, ostream):
        tstream = BytearrayStream()

        for protocol_version in self.protocol_versions:
            protocol_version.write(tstream)

        self.length = tstream.length()
        super(DiscoverVersionsRequestPayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#13
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.key_block.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(KeyBlockKey, self).write(ostream)
        ostream.write(tstream.buffer)
示例#14
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.key.write(tstream)

        # Write the length and value of the key wrapping data
        self.length = tstream.length()
        super(TransparentSymmetricKey, self).write(ostream)
        ostream.write(tstream.buffer)
示例#15
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        self.key_block.write(tstream, kmip_version=kmip_version)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(KeyBlockKey, self).write(ostream, kmip_version=kmip_version)
        ostream.write(tstream.buffer)
示例#16
0
    def write(self, ostream):
        tstream = BytearrayStream()

        for protocol_version in self.protocol_versions:
            protocol_version.write(tstream)

        self.length = tstream.length()
        super(DiscoverVersionsRequestPayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#17
0
文件: secrets.py 项目: JHUAPL/PyKMIP
    def write(self, ostream):
        tstream = BytearrayStream()

        self.key_block.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(KeyBlockKey, self).write(ostream)
        ostream.write(tstream.buffer)
示例#18
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.unique_identifier.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(DestroyResponsePayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#19
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.unique_identifier.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#20
0
    def write(self, ostream):
        tstream = BytearrayStream()

        for attribute in self.attributes:
            attribute.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(Template, self).write(ostream)
        ostream.write(tstream.buffer)
示例#21
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        self.unique_identifier.write(tstream, kmip_version=kmip_version)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(DestroyResponsePayload, self).write(ostream,
                                                  kmip_version=kmip_version)
        ostream.write(tstream.buffer)
示例#22
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        self.opaque_data_type.write(tstream, kmip_version=kmip_version)
        self.opaque_data_value.write(tstream, kmip_version=kmip_version)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(OpaqueObject, self).write(ostream, kmip_version=kmip_version)
        ostream.write(tstream.buffer)
示例#23
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        for attribute in self.attributes:
            attribute.write(tstream, kmip_version=kmip_version)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(Template, self).write(ostream, kmip_version=kmip_version)
        ostream.write(tstream.buffer)
示例#24
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.secret_data_type.write(tstream)
        self.key_block.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(SecretData, self).write(ostream)
        ostream.write(tstream.buffer)
示例#25
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.opaque_data_type.write(tstream)
        self.opaque_data_value.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(OpaqueObject, self).write(ostream)
        ostream.write(tstream.buffer)
示例#26
0
    def write(self, ostream):
        tstream = BytearrayStream()

        for ui in self.unique_identifiers:
            ui.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(LocateResponsePayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#27
0
文件: secrets.py 项目: JHUAPL/PyKMIP
    def write(self, ostream):
        tstream = BytearrayStream()

        self.opaque_data_type.write(tstream)
        self.opaque_data_value.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(OpaqueObject, self).write(ostream)
        ostream.write(tstream.buffer)
示例#28
0
文件: destroy.py 项目: JHUAPL/PyKMIP
    def write(self, ostream):
        tstream = BytearrayStream()

        if self.unique_identifier is not None:
            self.unique_identifier.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(DestroyRequestPayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#29
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.application_namespace.write(tstream)
        self.application_data.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#30
0
文件: secrets.py 项目: JHUAPL/PyKMIP
    def write(self, ostream):
        tstream = BytearrayStream()

        for attribute in self.attributes:
            attribute.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(Template, self).write(ostream)
        ostream.write(tstream.buffer)
示例#31
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.credential_type.write(tstream)
        self.credential_value.write(tstream)

        # Write the length and value of the credential
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#32
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.credential_type.write(tstream)
        self.credential_value.write(tstream)

        # Write the length and value of the credential
        self.length = tstream.length()
        super(Credential, self).write(ostream)
        ostream.write(tstream.buffer)
示例#33
0
文件: secrets.py 项目: JHUAPL/PyKMIP
    def write(self, ostream):
        tstream = BytearrayStream()

        self.secret_data_type.write(tstream)
        self.key_block.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(SecretData, self).write(ostream)
        ostream.write(tstream.buffer)
示例#34
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        for protocol_version in self.protocol_versions:
            protocol_version.write(tstream, kmip_version=kmip_version)

        self.length = tstream.length()
        super(DiscoverVersionsRequestPayload,
              self).write(ostream, kmip_version=kmip_version)
        ostream.write(tstream.buffer)
示例#35
0
        def write(self, ostream):
            tstream = BytearrayStream()

            self.username.write(tstream)
            if self.password is not None:
                self.password.write(tstream)

            # Write the length and value of the credential
            self.length = tstream.length()
            super(self.__class__, self).write(ostream)
            ostream.write(tstream.buffer)
示例#36
0
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the object type and template attribute of the request payload
        self.object_type.write(tstream)
        self.template_attribute.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(CreateRequestPayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#37
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.key_material.write(tstream)

        for attribute in self.attributes:
            attribute.write(tstream)

        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#38
0
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the value and type of the name
        self.name_value.write(tstream)
        self.name_type.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#39
0
文件: get.py 项目: adityacb/PyKMIP
    def write(self, ostream):
        tstream = BytearrayStream()

        self.object_type.write(tstream)
        self.unique_identifier.write(tstream)
        self.secret.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(GetResponsePayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#40
0
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the details of the certificate
        self.certificate_type.write(tstream)
        self.certificate_value.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#41
0
        def write(self, ostream):
            tstream = BytearrayStream()

            self.username.write(tstream)
            if self.password is not None:
                self.password.write(tstream)

            # Write the length and value of the credential
            self.length = tstream.length()
            super(Credential.UsernamePasswordCredential, self).write(ostream)
            ostream.write(tstream.buffer)
示例#42
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.key_material.write(tstream)

        for attribute in self.attributes:
            attribute.write(tstream)

        self.length = tstream.length()
        super(KeyValue, self).write(ostream)
        ostream.write(tstream.buffer)
示例#43
0
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the value and type of the name
        self.name_value.write(tstream)
        self.name_type.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(Name, self).write(ostream)
        ostream.write(tstream.buffer)
示例#44
0
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the contents of a response header to the stream
        self.protocol_version.write(tstream)
        self.time_stamp.write(tstream)
        self.batch_count.write(tstream)

        # Write the length and value of the request header
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#45
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.attribute_name.write(tstream)
        if self.attribute_index is not None:
            self.attribute_index.write(tstream)
        self.attribute_value.write(tstream)

        # Write the length and value of the attribute
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#46
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.attribute_name.write(tstream)
        if self.attribute_index is not None:
            self.attribute_index.write(tstream)
        self.attribute_value.write(tstream)

        # Write the length and value of the attribute
        self.length = tstream.length()
        super(Attribute, self).write(ostream)
        ostream.write(tstream.buffer)
示例#47
0
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the request header and all batch items
        self.response_header.write(tstream)
        for batch_item in self.batch_items:
            batch_item.write(tstream)

        # Write the TTLV encoding of the request message
        self.length = tstream.length()
        super(ResponseMessage, self).write(ostream)
        ostream.write(tstream.buffer)
示例#48
0
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the request header and all batch items
        self.response_header.write(tstream)
        for batch_item in self.batch_items:
            batch_item.write(tstream)

        # Write the TTLV encoding of the request message
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#49
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.unique_identifier.write(tstream)

        if self.cryptographic_parameters is not None:
            self.cryptographic_parameters.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(KeyInformation, self).write(ostream)
        ostream.write(tstream.buffer)
示例#50
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.unique_identifier.write(tstream)

        if self.cryptographic_parameters is not None:
            self.cryptographic_parameters.write(tstream)

        # Write the length and value of the template attribute
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#51
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        # Write the contents of a response header to the stream
        self.protocol_version.write(tstream, kmip_version=kmip_version)
        self.time_stamp.write(tstream, kmip_version=kmip_version)
        self.batch_count.write(tstream, kmip_version=kmip_version)

        # Write the length and value of the request header
        self.length = tstream.length()
        super(ResponseHeader, self).write(ostream, kmip_version=kmip_version)
        ostream.write(tstream.buffer)
示例#52
0
    def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
        tstream = BytearrayStream()

        # Write the request header and all batch items
        self.response_header.write(tstream, kmip_version=kmip_version)
        for batch_item in self.batch_items:
            batch_item.write(tstream, kmip_version=kmip_version)

        # Write the TTLV encoding of the request message
        self.length = tstream.length()
        super(ResponseMessage, self).write(ostream, kmip_version=kmip_version)
        ostream.write(tstream.buffer)
示例#53
0
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the contents of the request payload
        self.unique_identifier.write(tstream)

        if self.template_attribute is not None:
            self.template_attribute.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#54
0
    def write(self, ostream):
        tstream = BytearrayStream()

        self.key_material.write(tstream)

        if self.attributes is not None:
            for attribute in self.attributes:
                attribute.write(tstream)

        # Write the length and value of the credential
        self.length = tstream.length()
        super(self.__class__, self).write(ostream)
        ostream.write(tstream.buffer)
示例#55
0
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the contents of the request payload
        self.unique_identifier.write(tstream)

        if self.template_attribute is not None:
            self.template_attribute.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(RegisterResponsePayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#56
0
    def write(self, ostream):
        tstream = BytearrayStream()
        if self.maximum_items is not None:
            self.maximum_items.write(tstream)
        if self.storage_status_mask is not None:
            self.storage_status_mask.write(tstream)
        if self.attributes is not None:
            for a in self.attributes:
                a.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(LocateRequestPayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#57
0
文件: register.py 项目: JHUAPL/PyKMIP
    def write(self, ostream):
        tstream = BytearrayStream()

        # Write the contents of the request payload
        self.object_type.write(tstream)
        self.template_attribute.write(tstream)

        if self.secret is not None:
            self.secret.write(tstream)

        # Write the length and value of the request payload
        self.length = tstream.length()
        super(RegisterRequestPayload, self).write(ostream)
        ostream.write(tstream.buffer)
示例#58
0
文件: misc.py 项目: poldridge/PyKMIP
    def write(self, ostream):
        """
        Write the data encoding the ServerInformation object to a stream.

        Args:
            ostream (Stream): A data stream in which to encode object data,
                supporting a write method; usually a BytearrayStream object.
        """
        tstream = BytearrayStream()
        tstream.write(self.data.buffer)

        self.length = tstream.length()
        super(ServerInformation, self).write(ostream)
        ostream.write(tstream.buffer)
示例#59
0
    def write(self, ostream):
        tstream = BytearrayStream()

        if self.common_template_attribute is not None:
            self.common_template_attribute.write(tstream)

        if self.private_key_template_attribute is not None:
            self.private_key_template_attribute.write(tstream)

        if self.public_key_template_attribute is not None:
            self.public_key_template_attribute.write(tstream)

        self.length = tstream.length()
        super(CreateKeyPairRequestPayload, self).write(ostream)
        ostream.write(tstream.buffer)