pdftools_sdk.signature_validation.validator
Module Attributes
Report the result of a constraint validation of |
Classes
The class to check the validity of signatures |
- pdftools_sdk.signature_validation.validator.ConstraintFunc
Report the result of a constraint validation of
pdftools_sdk.signature_validation.validator.Validator.validate()
.- Parameters:
message (str) – The validation message
indication (pdftools_sdk.signature_validation.indication.Indication) – The main indication
subIndication (pdftools_sdk.signature_validation.sub_indication.SubIndication) – The sub indication
signature (pdftools_sdk.pdf.signed_signature_field.SignedSignatureField) – The signature field
dataPart (Optional[str]) –
The data part is None for constraints of the main signature and a path for constraints related to elements of the signature.
Examples:
certificate:”Some Certificate”: When validating a certificate “Some Certificate” of the main signature.
time-stamp”:Some TSA Responder”/certificate:”Intermediate TSA Responder Certificate”: When validating a certificate “Intermediate TSA Responder Certificate” of the time-stamp embedded into the main signature.
alias of
Callable
[[str
,Indication
,SubIndication
,SignedSignatureField
,str
|None
],None
]
- class pdftools_sdk.signature_validation.validator.Validator[source]
Bases:
_NativeObject
The class to check the validity of signatures
- validate(document: Document, profile: Profile, selector: SignatureSelector) ValidationResults [source]
Validate the signatures of a PDF document
- Parameters:
document (pdftools_sdk.pdf.document.Document) – The document to check the signatures of
profile (pdftools_sdk.signature_validation.profiles.profile.Profile) – The validation profile
selector (pdftools_sdk.signature_validation.signature_selector.SignatureSelector) – The signatures to validate
- Returns:
The result of the validation
- Return type:
pdftools_sdk.signature_validation.validation_results.ValidationResults
- Raises:
pdftools_sdk.license_error.LicenseError – The license check has failed.
pdftools_sdk.processing_error.ProcessingError – The processing has failed.
- add_constraint_handler(handler: Callable[[str, Indication, SubIndication, SignedSignatureField, str | None], None]) None [source]
Add handler for the
ConstraintFunc()
event.- Parameters:
handler – Event handler. If a handler is added that is already registered, it is ignored.
- remove_constraint_handler(handler: Callable[[str, Indication, SubIndication, SignedSignatureField, str | None], None]) None [source]
Remove registered handler of the
ConstraintFunc()
event.- Parameters:
handler – Event handler that shall be removed. If a handler is not registered, it is ignored.