Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmarslender committed Jul 31, 2024
1 parent d2e1465 commit 3a44a31
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/tls/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
// Need to embed the default config into the library
_ "embed"
"encoding/pem"
"fmt"
Expand Down Expand Up @@ -162,6 +163,7 @@ func WriteCertAndKey(certDER []byte, certKey *rsa.PrivateKey, certKeyBase string
return certPemBytes, keyPemBytes, nil
}

// GenerateNewCA generates a new CA
func GenerateNewCA(certKeyBase string) ([]byte, []byte, error) {
// Generate a new RSA private key
privateKey, err := rsa.GenerateKey(rand.Reader, 2048)
Expand Down Expand Up @@ -199,6 +201,7 @@ func GenerateNewCA(certKeyBase string) ([]byte, []byte, error) {
return WriteCertAndKey(certDER, privateKey, certKeyBase)
}

// GenerateCASignedCert generates a new key/cert signed by the given CA
func GenerateCASignedCert(caCert *x509.Certificate, caKey *rsa.PrivateKey, certKeyBase string) ([]byte, []byte, error) {
// Generate new private key
certKey, err := rsa.GenerateKey(rand.Reader, 2048)
Expand Down

0 comments on commit 3a44a31

Please sign in to comment.