Skip to main content

Module ca

Module ca 

Source
Expand description

Dev CA generation, loading, and re-signing.

Ported from internal/pki/ca.go. Uses rcgen to build certificates and x509-parser to read them back (see PORT_NOTES.md for why this pair was chosen). See PORT_NOTES.md for other adaptations from the Go original.

Structs§

Ca
Ported from pki.CA.
CertInfo
A minimal stand-in for the fields of *x509.Certificate these tests inspect. Not a real X.509 parser or encoder — that’s Phase 4 work.
KeyInfo
A minimal stand-in for the fields of *ecdsa.PrivateKey these tests inspect, plus the PKCS#8 DER of the private key so self_sign can actually sign with it.

Enums§

EcCurve
The elliptic curve of the CA key. Only P-256 is ever generated; this narrows to that curve so TestLoadOrGenerate_Generate’s elliptic.P256() comparison has a Rust equivalent.
PkiError
Errors ported from the sentinel errors.New values and fmt.Errorf wraps in ca.go.

Constants§

COMMON_NAME
The subject common name of every profile’s dev CA.
KEY_USAGE_CERT_SIGN
KEY_USAGE_CRL_SIGN
KEY_USAGE_DIGITAL_SIGNATURE

Functions§

cert_path
Ported from CertPath.
constraints_equal
Ported from ConstraintsEqual.
ensure_current
Ported from EnsureCurrent.
load_or_generate
Ported from LoadOrGenerate.