Skip to content

Commit

Permalink
created constant for rasEncryptionBit
Browse files Browse the repository at this point in the history
  • Loading branch information
pacificcode committed Aug 7, 2024
1 parent 215ad4a commit 756c8ee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cicd-integration/generate_pki.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import (
"time"
)

const leafCommonName = "example.com"
const (
leafCommonName = "example.com"
rsaEncrypt = 2048
)

func generateRootWithPrivateKey() ([]byte, []byte, error) {
privateKey, publicKey := generateRSAKeyPair(2048)
privateKey, publicKey := generateRSAKeyPair(rsaEncrypt)
ca := &x509.Certificate{
DNSNames: []string{"thycotic.com"},
SerialNumber: big.NewInt(int64(mrand.Int31n(big.MaxExp))),
Expand Down Expand Up @@ -52,7 +55,7 @@ func generateRootWithPrivateKey() ([]byte, []byte, error) {
}

func generateCSR() ([]byte, error) {
keyBytes, _ := rsa.GenerateKey(rand.Reader, 2048)
keyBytes, _ := rsa.GenerateKey(rand.Reader, rsaEncrypt)

subj := pkix.Name{
CommonName: leafCommonName,
Expand Down

0 comments on commit 756c8ee

Please sign in to comment.