Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadTrustBundle ¶
LoadTrustBundle loads a PEM bundle of trusted roots into a CertPool.
func VerifyDetached ¶
VerifyDetached verifies the signature of a file using a provided leaf certificate and trust bundle. The signature is expected to be over the SHA-256 digest of the file content. Signature file may be raw bytes or base64-encoded; both are supported.
Certificate validity is judged against the system clock. On a device that may have no reliable clock, use VerifyDetachedAt with a time the caller can defend — see internal/clock.
func VerifyDetachedAt ¶ added in v0.7.0
func VerifyDetachedAt(filePath, sigPath, leafCertPath string, roots *x509.CertPool, now time.Time) error
VerifyDetachedAt is VerifyDetached with an explicit time for the certificate validity check. The zero time means "use the system clock", which is what x509 does with an unset CurrentTime.
This exists because a gateway with no RTC boots at 1970 and would reject every valid certificate as not yet valid. Passing the time in — rather than reading the clock here — also means the decision about what time to believe lives in one place instead of being made implicitly at each call site.
Types ¶
This section is empty.