synta 0.1.11

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

## Adding synta to your project

Add the core crate to `Cargo.toml`:

```toml
[dependencies]
synta = "0.1"
```

### Available crates

| Crate | Description |
|-------|-------------|
| `synta` | Core ASN.1 encoder/decoder |
| `synta-codegen` | Code generator (CLI + library) |
| `synta-certificate` | X.509 PKI types (certificate, CRL, CSR, OCSP) |
| `synta-cbor` | CBOR (RFC 8949) encoder/decoder for all synta ASN.1 types |
| `synta-x509-verification` | RFC 5280 certificate path validation |

### Feature flags

**`synta` features:**

| Feature | Default | Description |
|---------|---------|-------------|
| `std` | yes | Standard library support; disable for `no_std` |
| `alloc` | no | Enable when using `no_std` with an allocator |
| `serde` | no | Serialize/Deserialize for all ASN.1 types |
| `derive` | yes | Derive macros for custom SEQUENCE/SET/CHOICE types (implies `std`) |
| `unchecked` | no | Skip DER validation bounds checks for trusted input |

**`synta-certificate` features:**

| Feature | Default | Description |
|---------|---------|-------------|
| `std` | yes | Standard library support |
| `alloc` | no | Allocation for `no_std` environments |
| `derive` | yes | Derive macros for Encode/Decode |
| `serde` | no | Serialize/Deserialize on generated types |
| `openssl` | yes | OpenSSL-backed PKCS#12, CMS encryption/decryption, certificate/CSR signing |
| `nss` | no | NSS-backed signature verification and key-identifier hashing; takes priority over `openssl`. Use `--no-default-features --features nss` to select NSS as the sole backend |
| `deprecated-pkcs12-algorithms` | no | Legacy 3DES/RC2 PKCS#12 encryption; requires `openssl` |

**`synta-cbor` features:**

| Feature | Default | Description |
|---------|---------|-------------|
| `std` | yes | Standard library support (required; `no_std` not yet supported) |
| `certificate` | no | Enable `unwrap_cms_cbor` CMS helper — requires `synta-certificate` |

**`synta-x509-verification` features:**

| Feature | Default | Description |
|---------|---------|-------------|
| `openssl` | yes | OpenSSL-backed signature verification; re-exports `OpensslSignatureVerifier` from `synta-certificate` |
| `nss` | no | NSS-backed signature verification; takes priority over `openssl`. Use `--no-default-features --features nss` to select NSS as the sole backend |

### Typical dependency sets

Parse-only X.509 (zero-copy, no crypto):

```toml
[dependencies]
synta-certificate = "0.1"
synta = "0.1"
```

Full PKI (certificate building + OpenSSL signing, default):

```toml
[dependencies]
synta-certificate = "0.1"
synta = "0.1"
```

Full PKI with NSS-backed verification instead of OpenSSL:

```toml
[dependencies]
synta-certificate = { version = "0.1", default-features = false, features = ["std", "derive", "nss"] }
synta = "0.1"
```

Certificate chain verification (OpenSSL, default):

```toml
[dependencies]
synta-x509-verification = "0.1"
synta-certificate        = "0.1"
synta                    = "0.1"
```

CBOR encoding of ASN.1 types:

```toml
[dependencies]
synta      = "0.1"
synta-cbor = "0.1"
```

Code generation in `build.rs`:

```toml
[dependencies]
synta = "0.1"

[build-dependencies]
synta-codegen = "0.1"
```

no_std environment:

```toml
[dependencies]
synta = { version = "0.1", default-features = false, features = ["alloc"] }
```

## Installing the synta-codegen CLI

```bash
cargo install synta-codegen
```

After installation the `synta-codegen` binary is available.  Verify:

```bash
synta-codegen --help
```

## Minimum supported Rust version

Synta is written against the Rust 2021 edition.  Use a recent stable toolchain
(`rustup update stable`) to ensure compatibility.