veko doc
Self-Contained API Reference • Gradual Types • Capabilities • Wasm Sandbox

crypto/x509

lib/crypto/x509.vk

lib/crypto/x509.vk Pure-Veko ASN.1 X.509 v3 certificate parser, hostname matcher, PEM trust store, and SPKI pin verifier. Zero OS crypto DLL dependencies across ORO VM, Wasm 3, and --native.

signature
parse-cert = fn [cert_der bytes] any

Parses one DER-encoded X.509 certificate into a structured validation record.

signature
verify-sig-with-cert = fn [signer map, sig_oid str, msg bytes, signature bytes] bool

Verifies an arbitrary message+signature against a parsed certificate's public key.

signature
verify-cert-issued-by = fn [child map, parent map] bool

Verifies that parent issued and cryptographically signed child.

signature
match-hostname = fn [cert map, expected_host str] bool

Verifies SAN DNS/IP or fallback CN identity against expected_host.

signature
load-pem-roots = fn [pem_text str] any

Parses a PEM trust bundle string containing one or more CERTIFICATE blocks.

signature
builtin-roots-pem = fn [] str

Returns the built-in public CA PEM bundle (ISRG Root X1/X2/YE, DigiCert Global Root G2, GTS Root R1, Amazon Root CA 1, USERTrust/Sectigo).

verify-chain fn caps: .clocks
signature
verify-chain = fn [chain_ders block, expected_host str, opts map] any

Verifies an X.509 certificate chain (leaf-first DER list) against hostname + validity window + PEM roots and/or SPKI SHA-256 pins.

signature
mint-ed25519-cert = fn [cfg map] any

Mints a valid X.509 v3 DER certificate signed with Ed25519 (1.3.101.112). cfg: { issuer_cn, subject_cn, is_ca, san_dns, san_ips, subject_seed, signer_seed, serial }

signature
encode-p256-pkcs8-der = fn [priv32 bytes] any

Encodes a 32-byte ECDSA P-256 private scalar as a standard PKCS#8 PrivateKeyInfo DER blob.

signature
mint-p256-cert = fn [cfg map] any

Mints a valid X.509 v3 DER certificate signed with ECDSA P-256 + SHA-256 (1.2.840.10045.4.3.2). cfg: { issuer_cn, subject_cn, is_ca, san_dns, san_ips, subject_priv, signer_priv, serial }