smartinspectpython.sicryptostreamwriter
Module: sicryptostreamwriter.py
Revision History
Date | Version | Description |
---|---|---|
2023/05/30 | 3.0.0.0 | Initial Version. |
Cryptographic stream writer class used to encrypt data and write to a destination stream.
This class utilizes PyCryptodome cryptography support. More info can be found here: https://pycryptodome.readthedocs.io/en/latest/index.html
Initializes a new instance of the class.
Arguments:
- stream (BufferedWriter): Destination stream (BufferedWriter object) that encrypted data will be written to.
- cipher (object): AES Cipher object used to encrypt the data.
- padMethod (str): Method used for padding bytes to be encoded; possible values are 'pkcs7' (default), 'iso7816' or 'x923'.
Raises:
- SIArgumentNullException: Thrown if the cipher or stream argument is null.
Overridden. Calls the same method on the destination stream specified at initialization.
Overridden. Calls the same method on the destination stream specified at initialization.
Overridden. Calls the same method on the destination stream specified at initialization.
Overridden. Write encrypted data to the destination stream specified at initialization.
Arguments:
- data (object): Data to write.
The data to write is encrypted using a block size of the Cipher specified at initialization, and written to the underlying stream. If there is not enough data to fill a block, then it is written to a temporary buffer to be processed on the next write or close.