crypto/x509
lib/crypto/x509.vklib/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.
parse-cert = fn [cert_der bytes] any
Parses one DER-encoded X.509 certificate into a structured validation record.
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.
verify-cert-issued-by = fn [child map, parent map] bool
Verifies that parent issued and cryptographically signed child.
match-hostname = fn [cert map, expected_host str] bool
Verifies SAN DNS/IP or fallback CN identity against expected_host.
load-pem-roots = fn [pem_text str] any
Parses a PEM trust bundle string containing one or more CERTIFICATE blocks.
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 [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.
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 }
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.
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 }