diff options
author | Remigiusz Janeczek <remigiusz.janeczek@nokia.com> | 2021-07-05 12:25:15 +0200 |
---|---|---|
committer | Remigiusz Janeczek <remigiusz.janeczek@nokia.com> | 2021-07-06 13:38:43 +0200 |
commit | 75a51525a32818a860f97fcb67750b3abf0e2846 (patch) | |
tree | eda575e8e5a60ad6e5742976c3d47f7926405f84 /certServiceK8sExternalProvider/src/x509/x509_utils.go | |
parent | 430b63820a2e1807e45ca9fba21d81be8b9fd5ee (diff) |
[OOM-K8S-CERT-EXTERNAL-PROVIDER] Format golang code
Issue-ID: OOM-2753
Signed-off-by: Remigiusz Janeczek <remigiusz.janeczek@nokia.com>
Change-Id: I7b2f83dff5f7894b3064461b523bd94a77cac1f3
Diffstat (limited to 'certServiceK8sExternalProvider/src/x509/x509_utils.go')
-rw-r--r-- | certServiceK8sExternalProvider/src/x509/x509_utils.go | 7 |
1 files changed, 3 insertions, 4 deletions
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 { |