示例#1
0
文件: pkix.go 项目: jmcarbo/etcd-ca
func PutCertificateHost(d Depot, name string, crt *pkix.Certificate) error {
	b, err := crt.Export()
	if err != nil {
		return err
	}
	return d.Put(HostCrtTag(name), b)
}
示例#2
0
文件: pkix.go 项目: jmcarbo/etcd-ca
func PutCertificateAuthority(d Depot, crt *pkix.Certificate) error {
	b, err := crt.Export()
	if err != nil {
		return err
	}
	return d.Put(AuthCrtTag(), b)
}
示例#3
0
文件: status.go 项目: jmcarbo/etcd-ca
func printSignedStatusLine(crt *pkix.Certificate, name string) {
	duration := crt.GetExpirationDuration()
	hours := duration.Hours()
	days := hours / 24
	if days < 60 {
		fmt.Printf("%s: WARN (%.2f days until expiration)\n", name, days)
	} else {
		fmt.Printf("%s: OK (%.2f days until expiration)\n", name, days)
	}
}