Factory
๐ค AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
provide.foundation.crypto.certificates.factory
¶
Classes¶
Functions¶
create_ca
¶
create_ca(
common_name: str,
organization: str = "Default CA Organization",
validity_days: int = DEFAULT_CERTIFICATE_VALIDITY_DAYS
* 2,
key_type: str = DEFAULT_CERTIFICATE_KEY_TYPE,
) -> Certificate
Create a CA certificate (convenience function).
Source code in provide/foundation/crypto/certificates/factory.py
create_ca_certificate
¶
create_ca_certificate(
common_name: str,
organization_name: str,
validity_days: int,
key_type: str = DEFAULT_CERTIFICATE_KEY_TYPE,
key_size: int = DEFAULT_RSA_KEY_SIZE,
ecdsa_curve: str = DEFAULT_CERTIFICATE_CURVE,
) -> Certificate
Creates a new self-signed CA certificate.
Source code in provide/foundation/crypto/certificates/factory.py
create_self_signed
¶
create_self_signed(
common_name: str = "localhost",
alt_names: list[str] | None = None,
organization: str = "Default Organization",
validity_days: int = DEFAULT_CERTIFICATE_VALIDITY_DAYS,
key_type: str = DEFAULT_CERTIFICATE_KEY_TYPE,
) -> Certificate
Create a self-signed certificate (convenience function).
Source code in provide/foundation/crypto/certificates/factory.py
create_self_signed_client_cert
¶
create_self_signed_client_cert(
common_name: str,
organization_name: str,
validity_days: int,
alt_names: list[str] | None = None,
key_type: str = DEFAULT_CERTIFICATE_KEY_TYPE,
key_size: int = DEFAULT_RSA_KEY_SIZE,
ecdsa_curve: str = DEFAULT_CERTIFICATE_CURVE,
) -> Certificate
Creates a new self-signed end-entity certificate suitable for a client.
Source code in provide/foundation/crypto/certificates/factory.py
create_self_signed_server_cert
¶
create_self_signed_server_cert(
common_name: str,
organization_name: str,
validity_days: int,
alt_names: list[str] | None = None,
key_type: str = DEFAULT_CERTIFICATE_KEY_TYPE,
key_size: int = DEFAULT_RSA_KEY_SIZE,
ecdsa_curve: str = DEFAULT_CERTIFICATE_CURVE,
) -> Certificate
Creates a new self-signed end-entity certificate suitable for a server.
Source code in provide/foundation/crypto/certificates/factory.py
create_signed_certificate
¶
create_signed_certificate(
ca_certificate: Certificate,
common_name: str,
organization_name: str,
validity_days: int,
alt_names: list[str] | None = None,
key_type: str = DEFAULT_CERTIFICATE_KEY_TYPE,
key_size: int = DEFAULT_RSA_KEY_SIZE,
ecdsa_curve: str = DEFAULT_CERTIFICATE_CURVE,
is_client_cert: bool = False,
) -> Certificate
Creates a new certificate signed by the provided CA certificate.