Skip to content

Class swarmauri_core.certs.ICertService.ICertService

swarmauri_core.certs.ICertService.ICertService

Bases: ABC

X.509 / CSR service surface following RFC 5280 and RFC 2986.

supports abstractmethod

supports()

Report advertised capabilities.

Source code in swarmauri_core/certs/ICertService.py
 97
 98
 99
100
@abstractmethod
def supports(self) -> Mapping[str, Iterable[str]]:
    """Report advertised capabilities."""
    ...

create_csr abstractmethod async

create_csr(
    key,
    subject,
    *,
    san=None,
    extensions=None,
    sig_alg=None,
    challenge_password=None,
    output_der=False,
    opts=None,
)

Build and sign a PKCS#10 CSR (RFC 2986) using 'key'.

Source code in swarmauri_core/certs/ICertService.py
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@abstractmethod
async def create_csr(
    self,
    key: KeyRef,
    subject: SubjectSpec,
    *,
    san: Optional[AltNameSpec] = None,
    extensions: Optional[CertExtensionSpec] = None,
    sig_alg: Optional[str] = None,
    challenge_password: Optional[str] = None,
    output_der: bool = False,
    opts: Optional[Dict[str, Any]] = None,
) -> CsrBytes:
    """Build and sign a PKCS#10 CSR (RFC 2986) using 'key'."""
    ...

create_self_signed abstractmethod async

create_self_signed(
    key,
    subject,
    *,
    serial=None,
    not_before=None,
    not_after=None,
    extensions=None,
    sig_alg=None,
    output_der=False,
    opts=None,
)

Create a self-signed certificate using 'key' as both subject and issuer.

Source code in swarmauri_core/certs/ICertService.py
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
@abstractmethod
async def create_self_signed(
    self,
    key: KeyRef,
    subject: SubjectSpec,
    *,
    serial: Optional[int] = None,
    not_before: Optional[int] = None,
    not_after: Optional[int] = None,
    extensions: Optional[CertExtensionSpec] = None,
    sig_alg: Optional[str] = None,
    output_der: bool = False,
    opts: Optional[Dict[str, Any]] = None,
) -> CertBytes:
    """Create a self-signed certificate using 'key' as both subject and issuer."""
    ...

sign_cert abstractmethod async

sign_cert(
    csr,
    ca_key,
    *,
    issuer=None,
    ca_cert=None,
    serial=None,
    not_before=None,
    not_after=None,
    extensions=None,
    sig_alg=None,
    output_der=False,
    opts=None,
)

Issue an end-entity or intermediate certificate from a CSR.

Source code in swarmauri_core/certs/ICertService.py
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
@abstractmethod
async def sign_cert(
    self,
    csr: CsrBytes,
    ca_key: KeyRef,
    *,
    issuer: Optional[SubjectSpec] = None,
    ca_cert: Optional[CertBytes] = None,
    serial: Optional[int] = None,
    not_before: Optional[int] = None,
    not_after: Optional[int] = None,
    extensions: Optional[CertExtensionSpec] = None,
    sig_alg: Optional[str] = None,
    output_der: bool = False,
    opts: Optional[Dict[str, Any]] = None,
) -> CertBytes:
    """Issue an end-entity or intermediate certificate from a CSR."""
    ...

verify_cert abstractmethod async

verify_cert(
    cert,
    *,
    trust_roots=None,
    intermediates=None,
    check_time=None,
    check_revocation=False,
    opts=None,
)

Verify an X.509 certificate and optionally its chain.

Source code in swarmauri_core/certs/ICertService.py
166
167
168
169
170
171
172
173
174
175
176
177
178
@abstractmethod
async def verify_cert(
    self,
    cert: CertBytes,
    *,
    trust_roots: Optional[Sequence[CertBytes]] = None,
    intermediates: Optional[Sequence[CertBytes]] = None,
    check_time: Optional[int] = None,
    check_revocation: bool = False,
    opts: Optional[Dict[str, Any]] = None,
) -> Dict[str, Any]:
    """Verify an X.509 certificate and optionally its chain."""
    ...

parse_cert abstractmethod async

parse_cert(cert, *, include_extensions=True, opts=None)

Parse an X.509 certificate into a JSON-serializable mapping.

Source code in swarmauri_core/certs/ICertService.py
184
185
186
187
188
189
190
191
192
193
@abstractmethod
async def parse_cert(
    self,
    cert: CertBytes,
    *,
    include_extensions: bool = True,
    opts: Optional[Dict[str, Any]] = None,
) -> Dict[str, Any]:
    """Parse an X.509 certificate into a JSON-serializable mapping."""
    ...