Skip to main content

swarmauri_certs_x509

Swarmauri SDK

swarmauri_certs_x509

X.509 certificate service for Swarmauri

pypi: swarmauri_certs_x509 Source version: 0.11.0 Python: >=3.10,<3.15 Layer: standards Lifecycle: active License: Apache-2.0 Notice: attribution

Monthly PyPI downloads: swarmauri_certs_x509 README hits: swarmauri_certs_x509

README standards: CI gate Tests: example source Certification: not certified Governance: repository policy Evidence: source and CI

Overview · Installation · Quick Start · Usage · API · Contributing · Governance · License


Overview

Summary

X.509 certificate service plugin for Swarmauri using the cryptography library.

Why This Package

swarmauri_certs_x509 isolates this responsibility: X.509 certificate service for Swarmauri. Its package source exposes X509CertService, allowing consumers to select this package without treating adjacent packages as part of its public contract.

When to Use

Choose swarmauri_certs_x509 when your integration needs x.509 certificate service for Swarmauri. Match the imports below to your application boundary and install its declared dependencies before using the example.

Features

  • Create standards-compliant CSRs
  • Issue self-signed leaf or CA certificates
  • Sign CSRs with an external CA key
  • Verify certificate chains with optional intermediates
  • Parse certificates to extract subject, issuer, validity, and extension metadata

Non-Goals

swarmauri_certs_x509 owns x.509 certificate service for Swarmauri. Its imports do not by themselves configure credentials, deploy a service, or certify the behavior of its consumers. Dependencies and neighboring packages retain their own documented responsibilities.


Getting Started

Prerequisites

Python >=3.10,<3.15 is required. The manifest declares runtime dependencies including swarmauri-core, swarmauri-base, swarmauri-keyprovider-local, swarmauri-keyprovider-inmemory, cryptography. Read the example’s inputs and service requirements before execution.

Installation

The package bundles both the local and in-memory key providers, so no additional extras are required for the example below. Optional PKCS#11 support can be enabled when you need to integrate with hardware modules.

uv

uv add swarmauri_certs_x509
uv pip install swarmauri_certs_x509
# or add to pyproject.toml and install dependencies
uv add swarmauri_certs_x509
uv sync
# enable PKCS#11
uv pip install 'swarmauri_certs_x509[pkcs11]'

pip

python -m pip install swarmauri_certs_x509
pip install swarmauri_certs_x509
# with PKCS#11 support
pip install 'swarmauri_certs_x509[pkcs11]'

Poetry

poetry add swarmauri_certs_x509
poetry add swarmauri_certs_x509
# enable PKCS#11
poetry add swarmauri_certs_x509 --extras pkcs11

Quick Start

Example

Source: docs/readme/quick_start.py.

import asyncio
from swarmauri_certs_x509 import X509CertService
from swarmauri_keyprovider_local import LocalKeyProvider
from swarmauri_core.key_providers.types import KeySpec, KeyAlg, KeyClass
from swarmauri_core.crypto.types import KeyUse, ExportPolicy

svc = X509CertService()
kp = LocalKeyProvider()

spec = KeySpec(
    klass=KeyClass.asymmetric,
    alg=KeyAlg.ED25519,
    uses=(KeyUse.SIGN,),
    export_policy=ExportPolicy.SECRET_WHEN_ALLOWED,
)

ca_key = asyncio.run(kp.create_key(spec))
ca_cert = asyncio.run(svc.create_self_signed(ca_key, {"CN": "Example CA"}))

leaf_key = asyncio.run(kp.create_key(spec))
csr = asyncio.run(svc.create_csr(leaf_key, {"CN": "example.org"}))
leaf_cert = asyncio.run(svc.sign_cert(csr, ca_key, ca_cert=ca_cert))
result = asyncio.run(svc.verify_cert(leaf_cert, trust_roots=[ca_cert]))
assert result["valid"]

Expected Result

The example demonstrates the documented swarmauri_certs_x509 source boundary or workflow. Complete its required configuration first. README CI checks the maintained source’s syntax and declarations; it does not claim that external services or the application workflow were exercised.


Usage

Common Workflows

Source: docs/readme/usage.py.

import asyncio
from swarmauri_certs_x509 import X509CertService
from swarmauri_keyprovider_local import LocalKeyProvider
from swarmauri_core.key_providers.types import KeySpec, KeyAlg, KeyClass
from swarmauri_core.crypto.types import KeyUse, ExportPolicy

svc = X509CertService()
kp = LocalKeyProvider()

spec = KeySpec(
    klass=KeyClass.asymmetric,
    alg=KeyAlg.ED25519,
    uses=(KeyUse.SIGN,),
    export_policy=ExportPolicy.SECRET_WHEN_ALLOWED,
)

ca_key = asyncio.run(kp.create_key(spec))
ca_cert = asyncio.run(svc.create_self_signed(ca_key, {"CN": "Example CA"}))

leaf_key = asyncio.run(kp.create_key(spec))
csr = asyncio.run(svc.create_csr(leaf_key, {"CN": "example.org"}))
leaf_cert = asyncio.run(svc.sign_cert(csr, ca_key, ca_cert=ca_cert))
result = asyncio.run(svc.verify_cert(leaf_cert, trust_roots=[ca_cert]))
assert result["valid"]

The example below uses LocalKeyProvider to create a certificate authority (CA), issue a leaf certificate, and verify the chain.

CMS/S/MIME certificate profile

When preparing identities for CMS or S/MIME signing, include Email Protection extended key usage and an email subject alternative name so that relying parties can validate the certificate purpose.

import asyncio
from swarmauri_core.crypto.types import KeyUse, ExportPolicy
from swarmauri_core.key_providers.types import KeyAlg, KeyClass, KeySpec
from swarmauri_certs_x509 import X509CertService
from swarmauri_keyprovider_local import LocalKeyProvider


async def issue_smime_identity():
    provider = LocalKeyProvider()
    svc = X509CertService()

    ca_spec = KeySpec(
        klass=KeyClass.asymmetric,
        alg=KeyAlg.ECDSA_P256_SHA256,
        uses=(KeyUse.SIGN,),
        export_policy=ExportPolicy.SECRET_WHEN_ALLOWED,
    )
    ca_key = await provider.create_key(ca_spec)
    ca_cert = await svc.create_self_signed(
        ca_key,
        {"CN": "Demo CMS Root"},
        extensions={
            "basic_constraints": {"ca": True, "path_len": 0},
            "key_usage": {
                "digital_signature": True,
                "content_commitment": True,
                "key_cert_sign": True,
                "crl_sign": True,
            },
        },
    )

    leaf_spec = KeySpec(
        klass=KeyClass.asymmetric,
        alg=KeyAlg.ECDSA_P256_SHA256,
        uses=(KeyUse.SIGN,),
        export_policy=ExportPolicy.SECRET_WHEN_ALLOWED,
    )
    leaf_key = await provider.create_key(leaf_spec)
    csr = await svc.create_csr(
        leaf_key,
        {"CN": "cms-signer.example", "emailAddress": "signer@example.org"},
        san={"email": ["signer@example.org"]},
    )
    leaf_cert = await svc.sign_cert(
        csr,
        ca_key,
        ca_cert=ca_cert,
        extensions={
            "basic_constraints": {"ca": False},
            "key_usage": {
                "digital_signature": True,
                "content_commitment": True,
            },
            "extended_key_usage": {"oids": ["emailProtection"]},
        },
    )

    return {
        "ca_cert": ca_cert,
        "leaf_cert": leaf_cert,
        "leaf_key_pem": leaf_key.material,
    }


bundle = asyncio.run(issue_smime_identity())

The bundle dictionary pairs neatly with swarmauri_signing_cms.CMSSigner by supplying the leaf_key_pem together with the leaf_cert and ca_cert entries as the PKCS#7 signing material.

Configuration

Configure swarmauri_certs_x509 through the APIs in package source; its manifest describes installation requirements, not an implicit service configuration. No additional package-global configuration contract is inferred from dependencies.

Error Handling

The inspected swarmauri_certs_x509 source raises TypeError, ValueError. Handle these at the calling boundary and consult the implementation for the triggering conditions.

Best Practices

Use the explicit swarmauri_certs_x509 imports documented below and keep collaborator configuration with the caller. Run the package’s relevant tests after changing X509CertService; an import or successful installation alone does not establish its runtime guarantees.


Package Boundary

What It Owns

swarmauri_certs_x509 is located in standards and owns x.509 certificate service for Swarmauri. Source-declared APIs include X509CertService. The manifest records its direct dependency boundary.

Public API and Import Surfaces

Import namespace: swarmauri_certs_x509.

Source-declared exports or types: X509CertService.

Inspect package source for exact signatures; this inventory does not designate every internal module as stable.

Entry Points

  • peagen.plugins.certs → x509 → swarmauri_certs_x509:X509CertService
  • swarmauri.certs → X509CertService → swarmauri_certs_x509:X509CertService

Injected Dependencies

The direct installation dependencies of swarmauri_certs_x509 are swarmauri-core, swarmauri-base, swarmauri-keyprovider-local, swarmauri-keyprovider-inmemory, cryptography. These declarations do not imply automatic provider selection. Pass collaborators through the explicit constructors or call signatures in package source.

Protocol Consumers

No direct package-manifest dependency on swarmauri_certs_x509 was found in the audited three-repository inventory. External consumers may still use its documented imports or commands.

Extensions

For swarmauri_certs_x509, use the source-declared public interfaces (X509CertService) when composing or extending behavior. Its entry-point section below is authoritative for registered plugins; no additional extension loader is inferred from the package name.


Operations and Readiness

Operational Requirements

Operate swarmauri_certs_x509 according to its actual entry points and collaborators. The dependency and Python requirements in the manifest are prerequisites; deployment topology, credentials, and readiness remain the responsibility of the consuming application unless explicitly documented above.

Health and Observability

This README does not establish a standalone health endpoint for swarmauri_certs_x509. Observe the concrete caller’s results, exceptions, and existing test reports. An application that embeds this package must define its own health and telemetry contract.

Security and Resource Limits

Apply the input, credential, and resource constraints implemented in package source. The swarmauri_certs_x509 README gate is a documentation check, not a security review or a substitute for the implementation’s limits and caller authorization.

Compatibility

This source version of swarmauri_certs_x509 declares Python >=3.10,<3.15. Consult its dependency constraints before upgrading. Source-version and registry-version badges have separate meanings; this migration makes no additional platform or interoperability certification claim.


Verification

Tests

Run python -m pytest tests/unit/test_readme_sources.py from the swarmauri_certs_x509 package directory for the maintained example source checks (Python compilation and non-Python file presence). Existing package tests include:

The repository README gate also checks the required heading tree, metadata, managed fragments, and referenced files.

Certification Status

No external certification is asserted for swarmauri_certs_x509 by this documentation migration. README conformance, example syntax, runtime tests, and protocol or security certification are distinct evidence scopes.

Evidence

The README standards CI records mechanical documentation results for its tested commit. The package source and example sources support the package-boundary description; external runtime behavior requires its own test evidence.


FAQ

Why

Why select this package? swarmauri_certs_x509 provides x.509 certificate service for Swarmauri; use its own API boundary rather than assuming neighboring packages are bundled or configured automatically.

How

How do I start? Install or synchronize the environment under Getting Started, follow the maintained example for swarmauri_certs_x509, and consult package source for the exact types and signatures involved.

When

When should I validate an upgrade? Recheck swarmauri_certs_x509 whenever its source version, declared collaborators, configuration, or caller changes. Run relevant behavioral tests in addition to the README gate before promotion.


More Documentation

The repository contribution guide, package source, and manifest provide the supporting context for swarmauri_certs_x509. The README policy defines the common document structure.


Contributing

How to Contribute

If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.

Development Setup

Work from the pkgs/40-standards/swarmauri_certs_x509 checkout. Synchronize its declared development environment with uv, then run the relevant package tests and python -m pytest tests/unit/test_readme_sources.py. The repository’s dedicated README job installs readme-standards==0.1.3 without resolving unrelated runtime packages.

Notes for Maintainers

RFC References

  • RFC 2986 ? PKCS #10 Certification Request Syntax
  • RFC 5280 ? Internet X.509 Public Key Infrastructure Certificate and CRL Profile

Governance

Ownership and Decision Making

Changes to swarmauri_certs_x509 follow the maintainer review process of swarmauri/swarmauri-sdk and its contribution guide. Author attribution remains in the manifest; this README does not assign new publishing or administrative authority.

Standards and Policies

swarmauri_certs_x509 follows the versioned package-guide-v1 outline. All fixed headings, hierarchy, order, separators, and package-specific branding are checked by CI; reviewers assess the accuracy and usefulness of authored claims.

Lifecycle and Migration

The swarmauri_certs_x509 source version is 0.11.0.


License and Attribution

License

Licensed under Apache-2.0. See LICENSE.

Notices

See NOTICE for attribution.

Metadata

Release files for swarmauri_certs_x509 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swarmauri_certs_x509 0.11.0
File Size Uploaded Provenance Actions
swarmauri_certs_x509-0.11.0.tar.gz 22.6 kB Without provenance Details for swarmauri_certs_x509-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_certs_x509 0.11.0
File Interpreter ABI Platform Actions
swarmauri_certs_x509-0.11.0-py3-none-any.whl Python 3 none any Details for swarmauri_certs_x509-0.11.0-py3-none-any.whl

Total release size: 40.5 kB

Release files / swarmauri_certs_x509-0.11.0.tar.gz

Download URL swarmauri_certs_x509-0.11.0.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f2da95a2e00513c05a2872d9570bfca22c741d0126ee93b9defa678ff50e0906
BLAKE2b-256 checksum
How to use checksums
69047b304539526ab8ce51cbbda1d9116f217369ba5baaccb71ee2700c5c1b1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / swarmauri_certs_x509-0.11.0-py3-none-any.whl

Download URL swarmauri_certs_x509-0.11.0-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c2d86b7176e13fd436b44ca9401ee02a112ae6db86395f290e942143abea644
BLAKE2b-256 checksum
How to use checksums
1805db4ed06224f862c871accd94fd412a70f6f7ce1b184ad96b3336083847fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for swarmauri_certs_x509 0.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page