API¶
AIS client¶
- class AIS.AIS(customer: str, key_static: str, cert_file: str, cert_key: str)[source]¶
Client object holding connection information to the AIS service.
- last_request_id: Optional[str]¶
Contains the id of the last request made to the AIS API.
PDF file¶
- class AIS.PDF(input_file: FileLike, *, out_stream: Optional[BinaryIO] = ..., sig_name: str = ..., sig_size: int = ...)[source]¶
- class AIS.PDF(*, inout_stream: BinaryIO, sig_name: str = ..., sig_size: int = ...)
A container for a PDF file to be signed and the signed version.
- cms_writer¶
CMS Writer used for embedding the signature
- property out_stream: BinaryIO¶
Output stream for the signed PDF.
- sig_io_setup¶
Signing I/O setup to be passed to pyHanko
- sig_size¶
Number of bytes reserved for the signature. It is the caller’s responsibility to ensure that this is large enough to store the entire signature.
Currently 64KiB (the default) appear to be enough. But the signature has been known to grow in size over the years.
- write_signature(signature: bytes) None [source]¶
Writes the signature into the pdf file.
digest needs to be called first.
- Raises
SignatureTooLarge
: If sig_size is
too small to store the entire signature.
Exceptions¶
- exception AIS.AuthenticationFailed[source]¶
Authentication with AIS failed.
This means that AIS returned http://ais.swisscom.ch/1.0/resultminor/AuthenticationFailed