From 75a51525a32818a860f97fcb67750b3abf0e2846 Mon Sep 17 00:00:00 2001 From: Remigiusz Janeczek Date: Mon, 5 Jul 2021 12:25:15 +0200 Subject: [OOM-K8S-CERT-EXTERNAL-PROVIDER] Format golang code Issue-ID: OOM-2753 Signed-off-by: Remigiusz Janeczek Change-Id: I7b2f83dff5f7894b3064461b523bd94a77cac1f3 --- certServiceK8sExternalProvider/src/x509/x509_utils.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'certServiceK8sExternalProvider/src/x509') diff --git a/certServiceK8sExternalProvider/src/x509/x509_utils.go b/certServiceK8sExternalProvider/src/x509/x509_utils.go index e1e887f0..308a24eb 100644 --- a/certServiceK8sExternalProvider/src/x509/x509_utils.go +++ b/certServiceK8sExternalProvider/src/x509/x509_utils.go @@ -36,7 +36,7 @@ const ( func DecodeCSR(data []byte) (*x509.CertificateRequest, error) { block, err := decodePemBlock(data, PemCsrType) if err != nil { - return nil, fmt.Errorf("error decoding CSR PEM: %v", err) + return nil, fmt.Errorf("error decoding CSR PEM: %v", err) } csr, err := x509.ParseCertificateRequest(block.Bytes) if err != nil { @@ -51,11 +51,11 @@ func DecodeCSR(data []byte) (*x509.CertificateRequest, error) { func DecodePrivateKey(data []byte) (interface{}, error) { block, err := decodePemBlock(data, pemPrivateKeyType) if err != nil { - return nil, fmt.Errorf("error decoding Private Key PEM: %v", err) + return nil, fmt.Errorf("error decoding Private Key PEM: %v", err) } key, err := x509.ParsePKCS8PrivateKey(block.Bytes) if err != nil { - return nil, fmt.Errorf("error parsing Private Key: %v", err) + return nil, fmt.Errorf("error parsing Private Key: %v", err) } return key, nil } @@ -71,7 +71,6 @@ func decodePemBlock(data []byte, pemType string) (*pem.Block, error) { return block, nil } - func ParseCertificateArrayToBytes(certificateArray []string) ([]byte, error) { buffer := bytes.NewBuffer([]byte{}) for _, cert := range certificateArray { -- cgit 1.2.3-korg