def new_encrypting_stream(self, ciphertext_destination: BinaryIO,
                           associated_data: bytes) -> BinaryIO:
   raw = _encrypting_stream.RawEncryptingStream(self._cc_streaming_aead,
                                                ciphertext_destination,
                                                associated_data)
   return typing.cast(BinaryIO, io.BufferedWriter(raw))
Example #2
0
 def new_raw_encrypting_stream(self, ciphertext_destination: BinaryIO,
                               associated_data: bytes) -> io.RawIOBase:
     return _encrypting_stream.RawEncryptingStream(self._cc_streaming_aead,
                                                   ciphertext_destination,
                                                   associated_data)
def get_raw_encrypting_stream(ciphertext_destination: BinaryIO,
                              aad: bytes) -> BinaryIO:
    raw = _encrypting_stream.RawEncryptingStream(None, ciphertext_destination,
                                                 aad)
    return cast(BinaryIO, io.BufferedWriter(raw))