Skip to content

Commit 258bd9b

Browse files
committed
write certificate and key to file
1 parent 9b159aa commit 258bd9b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎controlbox.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@ func (h *controlbox) run() {
7777
Bytes: certificate.Certificate[0],
7878
})
7979
fmt.Println(string(pemdata))
80+
os.WriteFile("cb.crt", pemdata, 0644)
8081

8182
b, err := x509.MarshalECPrivateKey(certificate.PrivateKey.(*ecdsa.PrivateKey))
8283
if err != nil {
8384
log.Fatal(err)
8485
}
8586
pemdata = pem.EncodeToMemory(&pem.Block{Type: "EC PRIVATE KEY", Bytes: b})
8687
fmt.Println(string(pemdata))
88+
os.WriteFile("cb.key", pemdata, 0644)
8789
}
8890

8991
port, err := strconv.Atoi(os.Args[1])

0 commit comments

Comments
 (0)