Skip to content

feat: generate additional credential types and X.509 identities - #417

Merged
domenkozar merged 2 commits into
feat/openpgp-key-generationfrom
feat/credential-generators
Sep 3, 2026
Merged

feat: generate additional credential types and X.509 identities#417
domenkozar merged 2 commits into
feat/openpgp-key-generationfrom
feat/credential-generators

Conversation

@domenkozar

@domenkozar domenkozar commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

  • add passphrase, mnemonic, wireguard_private_key, jwk_private_key, age_identity, and x509_identity generators
  • add extract.source so JSON/INI fields and X.509 artifacts can be derived from another declared secret
  • expose the new types and X.509 usage options through configuration validation, native bindings, and the Rust spec API
  • document every addition as SecretSpec 0.21+

Mnemonics

  • type = "mnemonic" defaults to a checksum-valid 24-word English BIP-39 value
  • algorithm = "bip39" is an explicit subtype for future extensibility
  • valid word counts are strictly limited to 12, 15, 18, 21, or 24
  • SecretSpec returns the mnemonic itself and does not derive BIP-32 seeds, wallet keys, or the optional BIP-39 mnemonic passphrase

X.509 identities and extraction

  • type = "x509_identity" generates a self-signed P-256 X.509 v3 identity and stores its canonical binary PKCS#12 form through encoding = "base64"
  • generation requires explicit DNS/IP SANs, defaults to server_auth and 30 days, and caps validity at the current CA/Browser Forum 200-day subscriber-certificate maximum
  • certificates use ECDSA/SHA-256, a positive 128-bit random serial, critical CA-false basic constraints and digital-signature key usage, EKU, SAN, and SKI
  • PKCS#12 generation explicitly selects AES-256-CBC protection and HMAC-SHA-256 integrity with 100,000 iterations; its password is intentionally empty because the provider is the protection boundary and the PFX is an interoperable container
  • source extraction exports PKCS#8 PEM/DER keys, leaf PEM/DER certificates, leaf-plus-issuer or issuer-only PEM chains, and complete PFX files
  • imported/provider-backed PFX input is bounded and checked for a matching key, current certificate validity, coherent signatures, and one unambiguous chain before projection
  • binary DER/PFX projections require as_path = true

extract.source is the only new composition-like mechanism: the existing extract.format selects both the component and representation. Named sources reuse the derived-secret dependency graph for order independence, scope closure, unknown-reference checks, and mixed cycle detection.

Other security properties

  • generated passphrases use the BIP-39 2048-word list, default to seven words, and enforce a six-word minimum
  • mnemonic entropy comes directly from the OS; entropy, internal mnemonic state, and temporary serialization use zeroization support
  • WireGuard keys use the upstream X25519 clamping procedure
  • Ed25519 JWKs use the fully specified RFC 9864 Ed25519 algorithm identifier; P-256 and RSA signing JWKs are also supported
  • age identities are validated by the Rust age parser; hybrid ML-KEM-768+X25519 identities remain externally provisioned until supported by the Rust implementation

Verification

  • cargo test --all: passed, including integration, compile/UI, and doctests
  • focused X.509 generation/extraction/security tests: passed
  • generic JSON extract.source end-to-end test: passed
  • full documentation build: 89 pages, zero diagnostics
  • repository Clippy and rustfmt pre-commit hooks: passed
  • git diff --check: passed

Dependency

Stacked on #414, which adds the OpenPGP and SSH generation infrastructure this change extends.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
secretspec 723a52f Commit Preview URL

Branch Preview URL
Sep 03 2026, 02:04 PM

@domenkozar domenkozar changed the title feat: generate additional credential types feat: generate additional credential types and X.509 identities Sep 1, 2026
@domenkozar
domenkozar force-pushed the feat/openpgp-key-generation branch from 0e8da5d to 1b07016 Compare September 1, 2026 20:03
@domenkozar
domenkozar force-pushed the feat/credential-generators branch from 5daf787 to fb87177 Compare September 3, 2026 02:33
@domenkozar
domenkozar merged commit 7a8f26c into feat/openpgp-key-generation Sep 3, 2026
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant