From 3605b7b998e8be7be685b804b203a2efe3d427a1 Mon Sep 17 00:00:00 2001 From: Artem Yarmoluk Date: Mon, 19 Aug 2019 17:20:06 +0300 Subject: [PATCH] Support key encoding in private ACM --- pkg/issuer/privateACM/issue.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/issuer/privateACM/issue.go b/pkg/issuer/privateACM/issue.go index 5e03d66b744..f681a582dfa 100644 --- a/pkg/issuer/privateACM/issue.go +++ b/pkg/issuer/privateACM/issue.go @@ -57,7 +57,7 @@ func (a *PrivateACM) Issue(ctx context.Context, crt *v1alpha1.Certificate) (*iss klog.V(4).Infof("Storing new certificate private key for %s/%s", crt.Namespace, crt.Name) a.Recorder.Eventf(crt, corev1.EventTypeNormal, "Generated", "Generated new private key") - keyPem, err := pki.EncodePrivateKey(signeeKey) + keyPem, err := pki.EncodePrivateKey(signeeKey, crt.Spec.KeyEncoding) if err != nil { return nil, err } @@ -138,7 +138,7 @@ func (a *PrivateACM) Issue(ctx context.Context, crt *v1alpha1.Certificate) (*iss certificate := []byte(*certOutput.Certificate) // Encode output private key and CA cert ready for return - keyPem, err := pki.EncodePrivateKey(signeeKey) + keyPem, err := pki.EncodePrivateKey(signeeKey, crt.Spec.KeyEncoding) if err != nil { a.Recorder.Eventf(crt, corev1.EventTypeWarning, "ErrorPrivateKey", "Error encoding private key: %v", err) return nil, err