Example #1
0
func PutEncryptedPrivateKeyHost(d Depot, name string, key *pkix.Key, passphrase []byte) error {
	b, err := key.ExportEncryptedPrivate(passphrase)
	if err != nil {
		return err
	}
	return d.Put(HostPrivKeyTag(name), b)
}
Example #2
0
func PutPrivateKeyHost(d Depot, name string, key *pkix.Key) error {
	b, err := key.ExportPrivate()
	if err != nil {
		return err
	}
	return d.Put(HostPrivKeyTag(name), b)
}
Example #3
0
func PutEncryptedPrivateKeyAuthority(d Depot, key *pkix.Key, passphrase []byte) error {
	b, err := key.ExportEncryptedPrivate(passphrase)
	if err != nil {
		return err
	}
	return d.Put(AuthPrivKeyTag(), b)
}
Example #4
0
func PutPrivateKeyAuthority(d Depot, key *pkix.Key) error {
	b, err := key.ExportPrivate()
	if err != nil {
		return err
	}
	return d.Put(AuthPrivKeyTag(), b)
}