synta 0.3.1

ASN.1 parser, decoder, and encoder library with DER/BER support and C FFI
Documentation
# 39. `example_name_utils.py` — X.500 Name and DN Utility Functions

[<- Example index](index.md) . [`example_name_utils.py` on Codeberg](https://codeberg.org/abbra/synta/src/branch/main/examples/example_name_utils.py)

Bindings: `synta.format_dn`, `synta.format_dn_slash`,
`synta.parse_name_attrs`, `synta.find_extension_value`,
`synta.encode_general_names`, `synta.parse_general_names`,
`synta.signing_algorithm_der`, `synta.key_usage_bit`,
`synta.decode_public_key_info`, `synta.NameBuilder`,
`synta.CertificateBuilder`.

- **format_dn / format_dn_slash** -- build a Name with `NameBuilder` and
  display it in RFC 2253 comma-delimited and slash-delimited forms.
- **parse_name_attrs** -- iterate `(oid_str, value)` pairs from a DER-encoded
  Name.
- **find_extension_value** -- look up `BasicConstraints` and `KeyUsage`
  extension values by OID from a certificate's extension DER; returns `None`
  for absent extensions.
- **encode_general_names / parse_general_names** -- encode a list of
  `(tag, bytes)` tuples into a GeneralNames SEQUENCE and round-trip it.
- **signing_algorithm_der** -- map `(key_oid, hash_algorithm)` pairs to
  AlgorithmIdentifier DER; covers RSA, EC, Ed25519, and unknown key OIDs.
- **key_usage_bit** -- extract individual KeyUsage bits by index from a
  certificate's KeyUsage extension DER.
- **decode_public_key_info** -- decode SubjectPublicKeyInfo DER into a dict
  with algorithm OID, curve, and raw key bytes for EC P-256, P-384, and
  Ed25519 keys.