Skip to main content

Remote CA certificate service for Swarmauri

Project description

Swamauri Logo

Swarmauri Remote CA Cert Service

A certificate enrollment bridge implementing the ICertService interface and forwarding CSRs to a remote Certificate Authority.

Features:

  • Posts CSRs to a remote endpoint and returns issued certificates.
  • Minimal parsing helpers for certificate snippets.
  • Designed around X.509 as defined in RFC 5280 and Enrollment over Secure Transport (EST) in RFC 7030.

Installation

pip install swarmauri_certs_remote_ca

Entry Point

The service registers under the swarmauri.certs entry point as RemoteCaCertService.

Usage

The service is asynchronous and expects an existing CSR (certificate signing request) in PEM or DER form. Configure the remote CA endpoint and submit the CSR to receive the issued certificate:

import asyncio
import base64
import json
import httpx
from swarmauri_certs_remote_ca import RemoteCaCertService

csr = b"example-csr"
cert_bytes = b"example-cert"


async def main() -> None:
    async def handler(request: httpx.Request) -> httpx.Response:
        data = json.loads(request.content)
        assert base64.b64decode(data["csr"]) == csr
        return httpx.Response(200, json={"cert": base64.b64encode(cert_bytes).decode()})

    transport = httpx.MockTransport(handler)
    svc = RemoteCaCertService("https://ca.example/sign")
    svc._client = httpx.AsyncClient(transport=transport)

    cert = await svc.sign_cert(csr, {"kind": "dummy"})
    print(cert)


asyncio.run(main())

The example above mocks a CA using httpx.MockTransport. In real scenarios RemoteCaCertService posts the CSR to the configured endpoint and returns the certificate bytes supplied by the remote CA.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_certs_remote_ca-0.3.0.dev4.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file swarmauri_certs_remote_ca-0.3.0.dev4.tar.gz.

File metadata

File hashes

Hashes for swarmauri_certs_remote_ca-0.3.0.dev4.tar.gz
Algorithm Hash digest
SHA256 fe659c1ea8dc109cc956bad9295d942cfa503cf9c02d03cadaa77d6a58ba770f
MD5 ce1512ff4d2bb3858388c1216ab1c4e3
BLAKE2b-256 2c7a2e03670346a9dedf69d7a394593488f2cb23cfe29f6ea64c833bcef01d71

See more details on using hashes here.

File details

Details for the file swarmauri_certs_remote_ca-0.3.0.dev4-py3-none-any.whl.

File metadata

File hashes

Hashes for swarmauri_certs_remote_ca-0.3.0.dev4-py3-none-any.whl
Algorithm Hash digest
SHA256 91a8b9bd9742192bf3f65235e42f3a202cf94107b60c8fb611186f3b0800672c
MD5 f0f4e1d6891ed020d0200752339f98e3
BLAKE2b-256 35c94762cf80cd76a1a7a19811228f469a569a7f96e8ad2d530ef92df5e58bd1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page