kmip/core/messages/payloads/create_key_pair.py
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the CreateKeyPair request payload and decode it
        into its constituent parts.

        Args:
            input_buffer (stream): A data buffer containing encoded object
                data, supporting a read method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.
        """
        super(CreateKeyPairRequestPayload, self).read(
            input_buffer,
            kmip_version=kmip_version
        )
        local_buffer = utils.BytearrayStream(input_buffer.read(self.length))

        if kmip_version < enums.KMIPVersion.KMIP_2_0:
            if self.is_tag_next(
                    enums.Tags.COMMON_TEMPLATE_ATTRIBUTE,
                    local_buffer
            ):
                self._common_template_attribute = objects.TemplateAttribute(
                    tag=enums.Tags.COMMON_TEMPLATE_ATTRIBUTE
                )
                self._common_template_attribute.read(
                    local_buffer,
                    kmip_version=kmip_version
                )
        else:
            if self.is_tag_next(enums.Tags.COMMON_ATTRIBUTES, local_buffer):
                attributes = objects.Attributes(
                    tag=enums.Tags.COMMON_ATTRIBUTES
                )
                attributes.read(local_buffer, kmip_version=kmip_version)
                self._common_template_attribute = \
                    objects.convert_attributes_to_template_attribute(
                        attributes
                    )

        if kmip_version < enums.KMIPVersion.KMIP_2_0:
            if self.is_tag_next(
                    enums.Tags.PRIVATE_KEY_TEMPLATE_ATTRIBUTE,
                    local_buffer
            ):
                self._private_key_template_attribute = \
                    objects.TemplateAttribute(
                        tag=enums.Tags.PRIVATE_KEY_TEMPLATE_ATTRIBUTE
                    )
                self._private_key_template_attribute.read(
                    local_buffer,
                    kmip_version=kmip_version
                )
        else:
            if self.is_tag_next(
                    enums.Tags.PRIVATE_KEY_ATTRIBUTES,
                    local_buffer
            ):
                attributes = objects.Attributes(
                    tag=enums.Tags.PRIVATE_KEY_ATTRIBUTES
                )
                attributes.read(local_buffer, kmip_version=kmip_version)
                self._private_key_template_attribute = \
                    objects.convert_attributes_to_template_attribute(
                        attributes
                    )

        if kmip_version < enums.KMIPVersion.KMIP_2_0:
            if self.is_tag_next(
                    enums.Tags.PUBLIC_KEY_TEMPLATE_ATTRIBUTE,
                    local_buffer
            ):
                self._public_key_template_attribute = \
                    objects.TemplateAttribute(
                        tag=enums.Tags.PUBLIC_KEY_TEMPLATE_ATTRIBUTE
                    )
                self._public_key_template_attribute.read(
                    local_buffer,
                    kmip_version=kmip_version
                )
        else:
            if self.is_tag_next(
                    enums.Tags.PUBLIC_KEY_ATTRIBUTES,
                    local_buffer
            ):
                attributes = objects.Attributes(
                    tag=enums.Tags.PUBLIC_KEY_ATTRIBUTES
                )
                attributes.read(local_buffer, kmip_version=kmip_version)
                self._public_key_template_attribute = \
                    objects.convert_attributes_to_template_attribute(
                        attributes
                    )

        self.is_oversized(local_buffer)
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
        super(CreateKeyPairRequestPayload, self).read(
            input_buffer,
            kmip_version=kmip_version
        )
        local_buffer = utils.BytearrayStream(input_buffer.read(self.length))

        if kmip_version < enums.KMIPVersion.KMIP_2_0:
            if self.is_tag_next(
                    enums.Tags.COMMON_TEMPLATE_ATTRIBUTE,
                    local_buffer
            ):
                self._common_template_attribute = objects.TemplateAttribute(
                    tag=enums.Tags.COMMON_TEMPLATE_ATTRIBUTE
                )
                self._common_template_attribute.read(
                    local_buffer,
                    kmip_version=kmip_version
                )
        else:
            if self.is_tag_next(enums.Tags.COMMON_ATTRIBUTES, local_buffer):
                attributes = objects.Attributes(
                    tag=enums.Tags.COMMON_ATTRIBUTES
                )
                attributes.read(local_buffer, kmip_version=kmip_version)
                self._common_template_attribute = \
                    objects.convert_attributes_to_template_attribute(
                        attributes
                    )

        if kmip_version < enums.KMIPVersion.KMIP_2_0:
            if self.is_tag_next(
                    enums.Tags.PRIVATE_KEY_TEMPLATE_ATTRIBUTE,
                    local_buffer
            ):
                self._private_key_template_attribute = \
                    objects.TemplateAttribute(
                        tag=enums.Tags.PRIVATE_KEY_TEMPLATE_ATTRIBUTE
                    )
                self._private_key_template_attribute.read(
                    local_buffer,
                    kmip_version=kmip_version
                )
        else:
            if self.is_tag_next(
                    enums.Tags.PRIVATE_KEY_ATTRIBUTES,
                    local_buffer
            ):
                attributes = objects.Attributes(
                    tag=enums.Tags.PRIVATE_KEY_ATTRIBUTES
                )
                attributes.read(local_buffer, kmip_version=kmip_version)
                self._private_key_template_attribute = \
                    objects.convert_attributes_to_template_attribute(
                        attributes
                    )

        if kmip_version < enums.KMIPVersion.KMIP_2_0:
            if self.is_tag_next(
                    enums.Tags.PUBLIC_KEY_TEMPLATE_ATTRIBUTE,
                    local_buffer
            ):
                self._public_key_template_attribute = \
                    objects.TemplateAttribute(
                        tag=enums.Tags.PUBLIC_KEY_TEMPLATE_ATTRIBUTE
                    )
                self._public_key_template_attribute.read(
                    local_buffer,
                    kmip_version=kmip_version
                )
        else:
            if self.is_tag_next(
                    enums.Tags.PUBLIC_KEY_ATTRIBUTES,
                    local_buffer
            ):
                attributes = objects.Attributes(
                    tag=enums.Tags.PUBLIC_KEY_ATTRIBUTES
                )
                attributes.read(local_buffer, kmip_version=kmip_version)
                self._public_key_template_attribute = \
                    objects.convert_attributes_to_template_attribute(
                        attributes
                    )

        self.is_oversized(local_buffer)
def read ( self , input_buffer , kmip_version = enums . KMIPVersion . KMIP_1_0 ) : super ( CreateKeyPairRequestPayload , self ) . read ( input_buffer , kmip_version = kmip_version ) local_buffer = utils . BytearrayStream ( input_buffer . read ( self . length ) ) if kmip_version < enums . KMIPVersion . KMIP_2_0 : if self . is_tag_next ( enums . Tags . COMMON_TEMPLATE_ATTRIBUTE , local_buffer ) : self . _common_template_attribute = objects . TemplateAttribute ( tag = enums . Tags . COMMON_TEMPLATE_ATTRIBUTE ) self . _common_template_attribute . read ( local_buffer , kmip_version = kmip_version ) else : if self . is_tag_next ( enums . Tags . COMMON_ATTRIBUTES , local_buffer ) : attributes = objects . Attributes ( tag = enums . Tags . COMMON_ATTRIBUTES ) attributes . read ( local_buffer , kmip_version = kmip_version ) self . _common_template_attribute = objects . convert_attributes_to_template_attribute ( attributes ) if kmip_version < enums . KMIPVersion . KMIP_2_0 : if self . is_tag_next ( enums . Tags . PRIVATE_KEY_TEMPLATE_ATTRIBUTE , local_buffer ) : self . _private_key_template_attribute = objects . TemplateAttribute ( tag = enums . Tags . PRIVATE_KEY_TEMPLATE_ATTRIBUTE ) self . _private_key_template_attribute . read ( local_buffer , kmip_version = kmip_version ) else : if self . is_tag_next ( enums . Tags . PRIVATE_KEY_ATTRIBUTES , local_buffer ) : attributes = objects . Attributes ( tag = enums . Tags . PRIVATE_KEY_ATTRIBUTES ) attributes . read ( local_buffer , kmip_version = kmip_version ) self . _private_key_template_attribute = objects . convert_attributes_to_template_attribute ( attributes ) if kmip_version < enums . KMIPVersion . KMIP_2_0 : if self . is_tag_next ( enums . Tags . PUBLIC_KEY_TEMPLATE_ATTRIBUTE , local_buffer ) : self . _public_key_template_attribute = objects . TemplateAttribute ( tag = enums . Tags . PUBLIC_KEY_TEMPLATE_ATTRIBUTE ) self . _public_key_template_attribute . read ( local_buffer , kmip_version = kmip_version ) else : if self . is_tag_next ( enums . Tags . PUBLIC_KEY_ATTRIBUTES , local_buffer ) : attributes = objects . Attributes ( tag = enums . Tags . PUBLIC_KEY_ATTRIBUTES ) attributes . read ( local_buffer , kmip_version = kmip_version ) self . _public_key_template_attribute = objects . convert_attributes_to_template_attribute ( attributes ) self . is_oversized ( local_buffer )
Read the data encoding the CreateKeyPair request payload and decode it
        into its constituent parts.

        Args:
            input_buffer (stream): A data buffer containing encoded object
                data, supporting a read method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.
Read the data encoding the CreateKeyPair request payload and decode it into its constituent parts .