def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
super(DeviceCredential, self).read(<EOL>input_stream,<EOL>kmip_version=kmip_version<EOL>)<EOL>local_stream = BytearrayStream(input_stream.read(self.length))<EOL>if self.is_tag_next(enums.Tags.DEVICE_SERIAL_NUMBER, local_stream):<EOL><INDENT>self._device_serial_number = primitives.TextString(<EOL>tag=enums.Tags.DEVICE_SERIAL_NUMBER<EOL>)<EOL>self._device_serial_number.read(<EOL>local_stream,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self.is_tag_next(enums.Tags.PASSWORD, local_stream):<EOL><INDENT>self._password = primitives.TextString(<EOL>tag=enums.Tags.PASSWORD<EOL>)<EOL>self._password.read(local_stream, kmip_version=kmip_version)<EOL><DEDENT>if self.is_tag_next(enums.Tags.DEVICE_IDENTIFIER, local_stream):<EOL><INDENT>self._device_identifier = primitives.TextString(<EOL>tag=enums.Tags.DEVICE_IDENTIFIER<EOL>)<EOL>self._device_identifier.read(<EOL>local_stream,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self.is_tag_next(enums.Tags.NETWORK_IDENTIFIER, local_stream):<EOL><INDENT>self._network_identifier = primitives.TextString(<EOL>tag=enums.Tags.NETWORK_IDENTIFIER<EOL>)<EOL>self._network_identifier.read(<EOL>local_stream,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self.is_tag_next(enums.Tags.MACHINE_IDENTIFIER, local_stream):<EOL><INDENT>self._machine_identifier = primitives.TextString(<EOL>tag=enums.Tags.MACHINE_IDENTIFIER<EOL>)<EOL>self._machine_identifier.read(<EOL>local_stream,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>if self.is_tag_next(enums.Tags.MEDIA_IDENTIFIER, local_stream):<EOL><INDENT>self._media_identifier = primitives.TextString(<EOL>tag=enums.Tags.MEDIA_IDENTIFIER<EOL>)<EOL>self._media_identifier.read(<EOL>local_stream,<EOL>kmip_version=kmip_version<EOL>)<EOL><DEDENT>self.is_oversized(local_stream)<EOL>
Read the data encoding the DeviceCredential struct and decode it into
its constituent parts.

Args:
    input_stream (stream): A data stream containing encoded object
        data, supporting a read method; usually a BytearrayStream
        object.
    kmip_version (KMIPVersion): An enumeration defining the KMIP
        version with which the object will be decoded. Optional,
        defaults to KMIP 1.0.