API

AIS client

class AIS.AIS(customer, key_static, cert_file, cert_key)[source]

Bases: object

Client object holding connection information to the AIS service.

post(payload)[source]

Do the post request for this payload and return the signature part of the json response.

Return type:dict
sign_batch(pdfs)[source]

Sign a batch of files.

sign_one_pdf(pdf)[source]

Sign the given pdf file.

PDF file

class AIS.PDF(in_filename, prepared=False)[source]

Bases: object

A container for a PDF file to be signed and the signed version.

in_filename = None

Filename of the PDF to be treated.

out_filename = None

Filename of the output, signed PDF.

prepare()[source]

Add an empty signature to self.out_filename.

classmethod prepare_batch(pdfs)[source]

Add an empty signature to each of pdfs with only one java call.

prepared = None

Is the PDF prepared with an empty signature?

write_signature(signature)[source]

Write the signature in the pdf file

Exceptions

exception AIS.AISError[source]

Bases: exceptions.Exception

Generic AIS Error.

exception AIS.AuthenticationFailed[source]

Bases: AIS.exceptions.AISError

Authentication with AIS failed.

This means that AIS returned http://ais.swisscom.ch/1.0/resultminor/AuthenticationFailed

exception AIS.UnknownAISError[source]

Bases: AIS.exceptions.AISError

Unknown AIS Error.

exception AIS.AISError[source]

Bases: exceptions.Exception

Generic AIS Error.

exception AIS.MissingPreparedSignature[source]

Bases: AIS.exceptions.AISError

The PDF file needs to be prepared with an empty signature.