From 65b4dda4200846488b76718363811a05b1b128c1 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Thu, 12 Dec 2019 13:16:17 -0800 Subject: [PATCH] Add wrappers to identity methods in the ca package. --- ca/client.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ca/client.go b/ca/client.go index 0bfe386f..a3bda21b 100644 --- a/ca/client.go +++ b/ca/client.go @@ -1123,6 +1123,16 @@ func CreateIdentityRequest(commonName string, sans ...string) (*api.CertificateR return createCertificateRequest(commonName, sans, identityKey) } +// LoadDefaultIdentity is a wrapper for identity.LoadDefaultIdentity. +func LoadDefaultIdentity() (*identity.Identity, error) { + return identity.LoadDefaultIdentity() +} + +// WriteDefaultIdentity is a wrapper for identity.WriteDefaultIdentity. +func WriteDefaultIdentity(certChain []api.Certificate, key crypto.PrivateKey) error { + return identity.WriteDefaultIdentity(certChain, key) +} + func createCertificateRequest(commonName string, sans []string, key crypto.PrivateKey) (*api.CertificateRequest, crypto.PrivateKey, error) { if len(sans) == 0 { sans = []string{commonName}