synta 0.2.0

ASN.1 parser, decoder, and encoder library with DER/BER support and C FFI
Documentation
# Synta Rust API

Synta is a high-performance Rust ASN.1 library providing DER/BER encoding and
decoding, code generation from ASN.1 schemas, and a complete X.509 PKI type
library.  This book documents the Rust API for the `synta`, `synta-codegen`,
`synta-certificate`, and `synta-x509-verification` crates.

## What the library provides

- **Core ASN.1 codec**`Decoder` and `Encoder` for all ASN.1 primitive types
  (INTEGER, BOOLEAN, OCTET STRING, BIT STRING, OBJECT IDENTIFIER, NULL, REAL),
  all string types (UTF8String, PrintableString, IA5String, and more), and all
  constructed types (SEQUENCE, SET, CHOICE, explicit/implicit tags).

- **DER and BER support** — strict DER decoding with optional BER relaxation;
  configurable depth and size limits for untrusted input.

- **Code generation**`synta-codegen` transforms ASN.1 schemas into
  type-safe Rust structs with full encode/decode support, constraint validation,
  and derive macro integration.

- **X.509 PKI** — zero-copy certificate, CRL, CSR, and OCSP types; PEM
  encode/decode; algorithm identification; extension helpers;
  `CertificateBuilder`, `CsrBuilder`, and `Pkcs12Builder` for PKI object
  construction; PKCS#7/CMS and PKCS#12 bundle handling.

- **Certificate chain verification** — RFC 5280 path validation with
  configurable extension policy, algorithm allowlists, name constraint
  handling, and CRL/OCSP revocation checking.

- **no_std support** — works in embedded and constrained environments using
  the `alloc` feature without the standard library.

## How to navigate this book

- **[Getting Started]getting-started/installation.md** — add synta to
  `Cargo.toml` and parse your first certificate in minutes.
- **[Tutorial]tutorial/decoding.md** — step-by-step walkthroughs for
  decoding, encoding, and a full PKI workflow.
- **[Code Generation]codegen/overview.md** — transform ASN.1 schemas into
  Rust types using `synta-codegen` or its library API.
- **[ASN.1 Reference]asn1/primitives.md** — full coverage of supported
  ASN.1 types and known limitations.
- **[PKI]pki/certificate.md**`synta-certificate` API: certificates,
  CSRs, CRLs, OCSP, keys, extensions, and chain verification.
- **[Best Practices]best-practices.md** — schema design, project layout,
  performance, testing, and security guidance.
- **[API Reference]api-reference.md**`synta-codegen` library and CLI
  reference; see **[API reference for Rust crates]../../api-reference.md**
  for the full generated API documentation of all crates.
- **[Migration]migration/from-openssl.md** — porting guides from OpenSSL
  and libtasn1.
- **[Troubleshooting]troubleshooting.md** — common errors and their fixes.
- **[Example Programs]examples/index.md** — 12 annotated example programs
  covering decoding, encoding, PKI, code generation, and name constraints.

For the C FFI API see the [Synta C Bindings](../../c/src/getting-started/installation.md) book.