diff options
author | Pawel Baniewski <pawel.baniewski@nokia.com> | 2021-07-07 07:29:56 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-07-07 07:29:56 +0000 |
commit | 62d037f9368ae9300ff24292e142df0811479ad1 (patch) | |
tree | db160bd29cd280a1366731949ca1e00129f0f57a /certServiceK8sExternalProvider/src/x509/x509_utils.go | |
parent | 23de50858f982b986b2e6f3a13ccca4a3bd3980c (diff) | |
parent | 75a51525a32818a860f97fcb67750b3abf0e2846 (diff) |
Merge "[OOM-K8S-CERT-EXTERNAL-PROVIDER] Format golang code"
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 { |