Remote CA certificate service for Swarmauri
Project description
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
Install the package with your preferred Python packaging tool:
pip install swarmauri_certs_remote_ca
poetry add swarmauri_certs_remote_ca
uv pip install swarmauri_certs_remote_ca
Configuration
RemoteCaCertService accepts the following arguments:
endpoint– Base URL of the remote CA sign endpoint.auth– Optional mapping of HTTP headers or anhttpx.Authinstance for authentication.timeout_s– HTTP timeout in seconds (default10).ca_chain– Optional sequence of cached trust anchors exposed during verification and parsing.
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("ascii")},
)
svc = RemoteCaCertService("https://ca.example/sign")
async with httpx.AsyncClient(transport=httpx.MockTransport(handler)) as client:
svc._client = client # Inject mock transport for the example.
certificate = await svc.sign_cert(csr, {"kind": "dummy"})
print(certificate)
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.
When used against a real service, provide any required authentication headers
through the auth argument and override request or response formats via the
opts parameter of sign_cert.
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_certs_remote_ca-0.3.0.dev32.tar.gz.
File metadata
- Download URL: swarmauri_certs_remote_ca-0.3.0.dev32.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f9f925b12b6719414e96de170193cad692db4a9e3a23c7dd131078128932d2c
|
|
| MD5 |
7a38d6fdabe30cb7da3db06553155728
|
|
| BLAKE2b-256 |
6202498bce9df0c44f677ceb507f512b37dbb826dd9af48ea120bd416012bae9
|
File details
Details for the file swarmauri_certs_remote_ca-0.3.0.dev32-py3-none-any.whl.
File metadata
- Download URL: swarmauri_certs_remote_ca-0.3.0.dev32-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e481fd618dc672a72f810ea5ddca425e957cf9cf9b901b476d5d0d210f3a2c9
|
|
| MD5 |
4fda6303b302c50782c0e4a7ce20487e
|
|
| BLAKE2b-256 |
311f058c858fef52f28f812f6b5394afead12357ce5b654ee9988fdb7b8f19b0
|