def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
local_buffer = utils.BytearrayStream()<EOL>if self._private_key_unique_identifier:<EOL><INDENT>self._private_key_unique_identifier.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise exceptions.InvalidField(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>if self._public_key_unique_identifier:<EOL><INDENT>self._public_key_unique_identifier.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>else:<EOL><INDENT>raise exceptions.InvalidField(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>if self._private_key_template_attribute:<EOL><INDENT>self._private_key_template_attribute.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self._public_key_template_attribute:<EOL><INDENT>self._public_key_template_attribute.write(<EOL>local_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>self.length = local_buffer.length()<EOL>super(CreateKeyPairResponsePayload, self).write(<EOL>output_buffer,<EOL>kmip_version=kmip_version<EOL>)<EOL>output_buffer.write(local_buffer.buffer)<EOL>
Write the data encoding the CreateKeyPair response payload to a buffer.

Args:
    output_buffer (stream): A data buffer in which to encode object
        data, supporting a write method.
    kmip_version (KMIPVersion): An enumeration defining the KMIP
        version with which the object will be encoded. Optional,
        defaults to KMIP 1.0.

Raises:
    InvalidField: Raised if the private key unique identifier or the
        public key unique identifier is not defined.