You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original implementation dynamically assigns functions that return
errors so we can swap them under test. Errors from these calls are
wrapped in sentinels so they can be identified at runtime. In practice,
however, these errors are never examined.
- Sentinel errors are removed. The "encoding/pem.Decode" function does
not return errors, so we still generate our own in two places.
- All "Parse" functions are removed and replaced by their "Unmarshal"
equivalents.
- Most "New" functions are removed. One remains to generate a fresh root
CA certificate and private key pair.
- IP addresses are removed.
Fields on the "Certificate" and "PrivateKey" types are not exported,
making them opaque to consumers except for the PEM marshaling methods.
This provides a few benefits:
- The algorithms for keys and signatures can change without affecting
callers.
- Certificates are parsed as they are generated and unmarshaled. Their
values are always either zero or fully parsed.
- The root CA is parsed once per reconcile loop rather than once per
leaf.
- Getter methods return copies so that certificate fields cannot change.
0 commit comments