'Constructor.
Args:
readers_public_key: The public key of the destined reader of this
stream. The stream will be encrypted with the readers public key.
writers_private_key: The private_key of the writer of this stream. Data
will be signed using this private key.
fd: A file like object we read from.
chunk_size: This will be the size of the parts.'

def __init__(self, readers_public_key, writers_private_key, fd, chunk_size=(1024 * 1024)):

    self.fd = fd
    self.readers_public_key = readers_public_key
    self.writers_private_key = writers_private_key
    self.chunk_size = chunk_size
    self.cipher_properties = flows.CipherProperties.GetInializedKeys()
    self.cipher = crypto.AES128CBCCipher(self.cipher_properties.key, self.cipher_properties.metadata_iv)
    self.hmac = crypto.HMAC(self.cipher_properties.hmac_key.RawBytes())
    serialized_cipher = self.cipher_properties.SerializeToString()
    signature = SignaturePart(encrypted_cipher=readers_public_key.Encrypt(serialized_cipher), signature=writers_private_key.Sign(serialized_cipher))
    self.encrypted_buffer = BufferedReader()
    self.encrypted_buffer.write(self._GetPart(signature.SerializeToString(), PART_TYPE_ENCRYPTED_CIPHER))
    self.eof = False
