SigningUtils
Overview
SigningUtils is a class in Aspose.PDF FOSS for Python.
Utility class for generating certificates and PKCS#7 signatures.
This class provides 5 methods for working with SigningUtils objects in Python programs.
Available methods include: create_self_signed_ca, create_self_signed_cert, issue_certificate, sign_data_cades, sign_data_pkcs7.
All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package.
Methods
| Signature | Description |
|---|---|
create_self_signed_cert() → tuple[x509.Certificate, rsa.RSAPrivateKey] | Generate a self-signed X.509 certificate and a matching RSA private key. |
create_self_signed_ca(common_name: str, days: int) → tuple[x509.Certificate, rsa.RSAPrivateKey] | Generate a self-signed CA certificate and key (for building chains). |
issue_certificate(subject_cn: str, issuer_cert: x509.Certificate, issuer_key: rsa.RSAPrivateKey, ca: bool, days: int, not_before: datetime | None, not_after: datetime | None, eku: Sequence[x509.ObjectIdentifier] | None) → tuple[x509.Certificate, rsa.RSAPrivateKey] | Issue a certificate signed by issuer_cert / issuer_key. |
sign_data_pkcs7(data: bytes, cert: x509.Certificate, key: rsa.RSAPrivateKey, extra_certs: Sequence[x509.Certificate] | None, tsa: tuple | None, timestamp_url: str | None, timestamp_timeout: float) → bytes | Create a detached PKCS#7 signature for data. |
sign_data_cades(data: bytes, cert: x509.Certificate, key: rsa.RSAPrivateKey, extra_certs: Sequence[x509.Certificate] | None, hash_algo: str, tsa: tuple | None, timestamp_url: str | None, timestamp_timeout: float) → bytes | Create a detached CAdES-BES signature for data (PAdES baseline). |