synta-python 0.3.3

Python extension module for the synta ASN.1 library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]


## [0.3.3] — 2026-08-01

### Added

- Composite ML-KEM (draft-ietf-lamps-pq-composite-kem-18) key generation and
  key encapsulation: `PrivateKey.generate_composite_kem(sub_arc)`,
  `PublicKey.composite_kem_encapsulate()`, and
  `PrivateKey.composite_kem_decapsulate(ciphertext)`.
- Expose composite ML-KEM OIDs in `synta.oids` at runtime.

## [0.3.2] — 2026-07-29

### Changed

- Adapt to codegen newtype wrappers for SEQUENCE OF / SET OF types.
- Replace manual `Decoder` boilerplate in extension decoders with generated
  `from_der()` methods.


## [0.3.1] — 2026-07-22

### Fixed

- Fix broken references in README files after mdbook reorganization

## [0.3.0] — 2026-07-16

### Added

- Add RelativeOid type to synta Python bindings

### Fixed

- Eliminate transmute in Python binding lifetime extension

## [0.2.6] — 2026-06-10

## [0.2.5] — 2026-06-09

### Added

- **`synta.mtc` builder and validator types** — the `synta.mtc` submodule now
  exposes a full issuance, building, and validation pipeline in addition to the
  existing parsed types:

  - `HashAlgorithm` — SHA-2/SHA-3 hash algorithm enum with `output_size()`,
    `name()`, and `oid()` methods.
  - `MtcSignature` / `MtcProof` — TLS wire-format cosignature record and
    MTCProof container; `MtcProof.decode()` / `encode()` handle the TLS
    framing (not DER).
  - `IssuanceLogBuilder` — in-memory Merkle log builder; accumulates
    `TBSCertificateLogEntry` records and produces inclusion proofs,
    subtree proofs, and DER-encoded checkpoints.
  - `MtcX509CertificateBuilder` — constructs spec-compliant X.509 MTC
    certificates (draft §5) with the MTC proof embedded as `signatureValue`.
  - `StandaloneCertificateBuilder` / `LandmarkCertificateBuilder` — builders
    for `StandaloneCertificate` and `LandmarkCertificate` DER structures.
  - `RevokedRanges` — sorted, merged collection of revoked leaf index ranges
    (draft §7.5); supports `add()`, `is_revoked()`, `contains_range()`,
    `ranges()`, `len()`, and `is_empty()`.
  - `ValidationPolicy` — controls allowed hash algorithms, cosignature quorum
    (min/max), duplicate-cosigner policy, timestamp validity, and expiration
    checking.
  - `TrustAnchor` — log trust anchor constructed from a DER-encoded `LogID`;
    supports `activate()` / `deactivate()` and per-anchor revocation ranges
    via `revoke_range()`.
  - `CertificateValidator` — relying-party validation pipeline combining trust
    anchor lookup, inclusion proof verification, subtree consistency checking,
    and policy enforcement; exposes `validate_standalone()` and
    `validate_landmark()`.
  - `extract_leaf_index(serial)` / `extract_log_number(serial)` — module-level
    functions to decode the lower 48 and upper 16 bits of an MTC serial number
    (draft §6.1).
  - `build_mtc_ca_extension(hash_alg, sig_alg_der, min_serial)` /
    `parse_mtc_ca_extension(cert_der)` — build and parse the
    `id-pe-mtcCertificationAuthority` X.509 extension (draft §5.5).

## [0.2.4] — 2026-05-27

### Changed

- **`synta.mtc.CosignerID` type redesign** (breaking) — `CosignerID` is now a
  wrapper around an OBJECT IDENTIFIER (`TrustAnchorID` per
  draft-ietf-plants-merkle-tree-certs-04 §4.1).  The previous properties
  `.issuer_der` and `.serial_number` are removed and replaced by a single `.oid`
  property (dotted-decimal string, e.g. `"1.3.6.1.4.1.44363.47.1"`).

- **`synta.mtc.ProofNode`** — the `is_left` property is removed.  `ProofNode`
  is now encoded as a plain OCTET STRING; the direction of each sibling is
  implicit in the leaf index at verification time (draft §4.3.2).  Only the
  `.hash` property is present.

### Added

- **`pqc` feature enabled by default in wheels**: the `pqc` feature is now
  included in the `openssl` feature set, so `--features openssl` (used by
  maturin and `pyproject.toml`) automatically enables composite ML-DSA support
  on capable builds (OpenSSL 3.3+).

## [0.2.3] — 2026-05-24

### Added

- Expose composite ML-DSA OIDs in synta.oids at runtime
- Add PrivateKey.generate_composite_ml_dsa(sub_arc)

## [0.2.2] — 2026-05-08

Version bump to stay in sync with the workspace. No functional changes in the
Python extension itself; `synta.mtc.InclusionProof` now exposes `subtree_start`
and `subtree_end` instead of the removed `log_entry_index` and `tree_size`
attributes — see the `synta-mtc` changelog for details.

## [0.2.1] — 2026-05-02

### Fixed

- CRL and OCSP serial number bytes are now decoded with `from_unsigned_bytes()`
  so that values with the high bit set round-trip correctly without sign
  extension.

## [0.2.0] — 2026-05-01

### Added

- **`synta.pkcs11`** — new submodule for PKCS#11 token management.
  `Pkcs11Token(uri)` exposes `find_key(uri)`, `list_keys()`,
  `delete_key(uri)`, and `generate_key_pair(key_type, param, label)`.
  The module-level `list_slots()` enumerates all available tokens.
  `SlotInfo` and `KeyInfo` carry token and key metadata respectively.
  PINs are redacted in error messages and `repr` output.

## [0.1.12] — 2026-04-30

This release completes the OCSP Python surface: parsed request types, a fluent
request builder, and a CRL Number extension helper round out the OCSP and CRL
tooling introduced in 0.1.11.

### Added

- **`OCSPRequest` / `CertID`** — parsed OCSP request types (RFC 6960).
  `OCSPRequest.from_der` / `from_pem` / `to_der` / `to_pem` decode and
  re-encode OCSP requests; the `request_list` property returns a list of
  `CertID` objects exposing `hash_algorithm_oid`, `issuer_name_hash`,
  `issuer_key_hash`, and `serial_number`.  `requestor_name` and
  `request_extensions` return the raw DER bytes of the optional fields.

- **`OCSPRequestBuilder` / `OCSPCertIDSpec`** — fluent builder for unsigned
  and signed OCSP requests.  `OCSPCertIDSpec` carries the per-certificate
  parameters (hash algorithm, issuer hashes, serial); chain `.add_request()`
  calls to bundle multiple certificates in one request.  `build_tbs()` produces
  a ready-to-submit unsigned `OCSPRequest`; `build_tbs_inner()` + `assemble()`
  support the external-signing path.  `requestor_name()` sets the optional
  `[0] EXPLICIT GeneralName` field.

- **`synta.ext.crl_number(n)`** — builds the DER extension value for the CRL
  Number extension (OID 2.5.29.20).  Pass the result as `value_der` to
  `CertificateListBuilder.add_extension()`.

- **`synta.oids.CRL_NUMBER`**`ObjectIdentifier` constant for OID 2.5.29.20
  (`id-ce-cRLNumber`), re-exported from the generated X.509 types.

- **`CertificateListBuilder.add_extension(oid, ...)`** — the `oid` parameter
  now accepts either a dotted-decimal OID string or a `synta.ObjectIdentifier`
  instance (e.g. `synta.oids.CRL_NUMBER`), eliminating manual string
  conversion for callers who already hold an OID constant.

### Changed

- **`CMS SignedDataBuilder`** internals rewritten to use the generated
  `ContentInfo` / `SignedData` ASN.1 structs instead of hand-rolled DER
  helpers.  The Python API is unchanged; the rewrite fixes edge-case encoding
  differences and reduces maintenance surface.

- PKCS#9 attribute OIDs in `SignedDataBuilder` are now referenced by named
  constants (`synta.oids.pkcs9.*`) instead of hardcoded hex strings.

## [0.1.11] — 2026-04-29

Version bump to stay in sync with the workspace.  No functional changes.


## [0.1.10] — 2026-04-27

### Added

- `synta.crypto.aes_gcm_encrypt` / `aes_gcm_decrypt` — AES-GCM (AEAD)
  authenticated encryption with 128/192/256-bit keys, a 12-byte nonce, and
  optional additional authenticated data (AAD).  Output is `ciphertext ‖
  16-byte tag`; decryption raises `ValueError` on authentication failure.

## [0.1.9] — 2026-04-18

This release adds three new Python APIs and usage examples, and rewrites the
CMS builder internals to use generated ASN.1 structs instead of hand-rolled
DER helpers.

### Added

- **`synta.cms.SignedDataBuilder`** — creates RFC 5652 CMS `SignedData`
  structures.  Supports attached and detached content, multiple signers,
  embedded certificates, and the standard signed attributes (`contentType`,
  `messageDigest`).
- **`PrivateKey.from_pkcs11_uri(uri)`** — loads a private key from a PKCS#11
  URI for HSM-backed signing.  Available under both the `openssl` and `nss`
  build features.
- **`create_pkcs12(cipher=, mac_algorithm=)`** — the PKCS#12 export helper now
  accepts `cipher` (`'aes128'` / `'aes256'`) and `mac_algorithm`
  (`'sha256'` / `'sha384'` / `'sha512'`) keyword arguments for configurable
  encryption and integrity protection.
- Usage examples: CMS SignedData signing (`examples/cms_signed_data.py`) and
  DN formatting / name utilities (`examples/dn_formatting.py`).
- Type stubs (`.pyi`) for `SignedDataBuilder` and supporting types.

### Changed

- CMS `SignedDataBuilder` implementation rewritten to use the generated
  `cms_rfc5652_types` structs (`Attribute`, `EncapsulatedContentInfo`,
  `SignerInfo`, `IssuerAndSerialNumber`).  All hand-rolled DER helpers
  (`oid_tlv`, `set_of_one`, `encode_attribute`, `build_iasn_der`) removed.

## [0.1.8] — 2026-04-16

### Added

- Propagate nss/openssl feature flags across workspace crates

### Changed

- Use DefaultCrypto for PKCS12 and read_pki_blocks
- Use DefaultCrypto; remove openssl feature gates
- Openssl takes priority over nss at module level

### Fixed

- Fix misattributed OCSP doc block and add constructor docs
- Gate OpenSSL-only CMS and key ops under openssl feature

## [0.1.7] — 2026-04-15


## [0.1.6] — 2026-04-11


## [0.1.5] — 2026-04-11

### Security

- Add Python wrapper for RFC 2634 Extended Security Services builders

### Added

- Register new RFC builder pyclasses and add __init__.pyi stubs
- Add Python wrapper for RFC 7773 ACE-88 authentication context builder
- Add Python wrapper for RFC 9399 Logotype extension builder
- Add Python wrapper for RFC 8018 PKCS#5 v2.1 parameter builders
- Add Python wrapper for RFC 3161 Time-Stamp Protocol builders
- Add hkdf_extract, hkdf_expand, and HmacDigest to synta.crypto
- Add IPAddress.value returning ipaddress.IPv4Address/IPv6Address
- Expose subject_public_key_info_der on CertificationRequest
- Add OwnedStore to eliminate per-call CA cert re-parsing
- Expose to_der/from_der on primitive and string types
- Add AcmeAuthorization Python binding for RFC 8737
- Propagate nss feature to synta-ffi, synta-python, synta-x509-verification
- Add PublicKey.verify_certificate_signature and Certificate.signature_algorithm_der
- Split _synta.so — synta-python-mtc
- Split synta.krb5 into standalone synta-python-krb5 extension module
- Add AlgorithmIdentifier class to synta and synta.pkixalgs
- Add IssuerAltName, IssuingDistPoint, CertPolicies extension builders
- Expose CRLDistributionPointsBuilder and SAN.other_name() to Python
- Add Krb5PrincipalName.to_othername_der() for PKINIT SAN building
- Expose NameConstraintsBuilder and NAME_CONSTRAINTS OID to Python
- Add ML-DSA and ML-KEM support to PrivateKey and PublicKey
- Add verify_issued_by() to AttributeCertificate
- Add verify_signature() to OCSPResponse
- Add verify_issued_by() to CertificateList
- Add verify_self_signature() to CertificationRequest
- Add generate_ed25519(), generate_ed448(), and sign() to PrivateKey
- Add Python bindings for PKCS#9 attributes
- Add Python bindings for PKCS#8 (OneAsymmetricKey)
- Synta-certificate: add OCSPResponseBuilder for RFC 6960 OCSP responses
- Synta-certificate: add CertificateListBuilder for RFC 5280 §5 CRLs
- Synta-certificate: add SinglePubInfo pubLocation support to CertReqMsgBuilder
- Synta-certificate: add AttributeCertificateBuilder
- Add from_pem/to_pem to PyAttributeCertificate
- Add registered_id to SubjectAlternativeNameBuilder
- Add Python bindings for CertReqMsgBuilder and CertReqMessagesBuilder
- Add CMPMessageBuilder to synta.cmp
- Add synta.kem submodule
- Add Krb5PrincipalName.name getter, UPN support and typed GeneralName integration
- Expose PolicyQualifier, PolicyInformation and certificate_policies()
- Add Microsoft PKI (AD CS) submodule and stubs
- Add typed GeneralName Python classes and updated stubs
- Add Kerberos FAST and shared krb5 helper modules
- Add Merkle Tree Certificate Python bindings and stubs
- Add SPNEGO Python bindings and stubs
- Add synta-mtc dependency

### Changed

- Extract synta-python-common shared rlib
- Fix fragile double-borrow-mut and deduplicate config

### Fixed

- Resolve all broken intra-doc links and invalid code blocks
- Use single borrow_mut guard in all PyO3 builder setters
- Fix doc comment, single-guard setters, add security category binding
- Correct CertificationRequest.subject_alt_names() docstring
- AttributeCertificate.to_pem() must return bytes, not str
- Use IMPLICIT tagging for GeneralName otherName and ediPartyName
- Make Decoder encoding argument optional, defaulting to DER
- Fix subject_public_key_info_raw_der → subject_public_key_info_der in doc comments
- Fix 8 bugs found in deep review

### Removed

- Remove unused DER helper functions from general_name.rs

## [0.1.4] — 2026-04-05

### Added

- Synta-certificate, synta-python: add missing DN attribute OIDs (Gap D)
- Synta-certificate, synta-python: add PublicKey construction from raw components
- Synta-certificate, synta-python: add CertificateList version/crl_number/extensions API
- Add CertificationRequest extension access API

## [0.1.3] — 2026-04-05

### Added

- Add CHANGELOG.md for v0.1.3
- Add CHANGELOG.md for v0.1.2
- Split cms.rs into a module directory
- Expose SAN/AIA/EKU extension builders in synta.ext
- Synta-certificate, synta-python: add RFC 9925 unsigned certificate OIDs
- Synta-certificate, synta-python: add CMS EnvelopedData decryption
- Add synta.ext submodule for extension DER builders
- Synta-certificate,synta-python: add CMS EnvelopedData builder
- Add create_pkcs12 pyfunction
- Add PrivateKey.to_pkcs8_encrypted / from_pkcs8_encrypted
- Synta-certificate,synta-python: add CsrBuilder for PKCS#10 CSR construction
- Synta-certificate,synta-python: add KeyEncryptor/KeyDecryptor traits; unify RSA crypto
- Synta-certificate: add CertificateBuilder; synta-python: delegate to it
- Add CertificateBuilder with zero-copy DER splicing
- Add tbs_certificate_der, verify_issued_by, OTP, key gen, verify_signature
- Add crypto submodule and X.509 encoding helpers for FreeIPA
- Add PublicKey and PrivateKey classes for FreeIPA migration (Phase 4)
- Add FreeIPA-needed Certificate getters and digest function
- Expose OcspStore and ocsp= kwarg in synta.x509
- Expose CrlStore for CRL-based revocation checking
- Add synta.x509 certificate chain verification submodule
- Reorganize certificate/types into subdirectories; add pkixalgs/ac/crmf/cmp submodules

### Fixed

- Fix //! module doc in crypto.rs

### Removed

- Remove direct OpenSSL dependency; use synta-certificate crypto traits
- Expose NameBuilder and remove backend type leakage

## [0.1.2] — 2026-04-05

### Added

- Add CHANGELOG.md for v0.1.2
- Split cms.rs into a module directory
- Expose SAN/AIA/EKU extension builders in synta.ext
- Synta-certificate, synta-python: add RFC 9925 unsigned certificate OIDs
- Synta-certificate, synta-python: add CMS EnvelopedData decryption
- Add synta.ext submodule for extension DER builders
- Synta-certificate,synta-python: add CMS EnvelopedData builder
- Add create_pkcs12 pyfunction
- Add PrivateKey.to_pkcs8_encrypted / from_pkcs8_encrypted
- Synta-certificate,synta-python: add CsrBuilder for PKCS#10 CSR construction
- Synta-certificate,synta-python: add KeyEncryptor/KeyDecryptor traits; unify RSA crypto
- Synta-certificate: add CertificateBuilder; synta-python: delegate to it
- Add CertificateBuilder with zero-copy DER splicing
- Add tbs_certificate_der, verify_issued_by, OTP, key gen, verify_signature
- Add crypto submodule and X.509 encoding helpers for FreeIPA
- Add PublicKey and PrivateKey classes for FreeIPA migration (Phase 4)
- Add FreeIPA-needed Certificate getters and digest function
- Expose OcspStore and ocsp= kwarg in synta.x509
- Expose CrlStore for CRL-based revocation checking
- Add synta.x509 certificate chain verification submodule
- Reorganize certificate/types into subdirectories; add pkixalgs/ac/crmf/cmp submodules

### Fixed

- Fix //! module doc in crypto.rs

### Removed

- Remove direct OpenSSL dependency; use synta-certificate crypto traits
- Expose NameBuilder and remove backend type leakage