(path string)
| 60 | } |
| 61 | |
| 62 | func (ca *CA) WriteCACertificate(path string) error { |
| 63 | derBytes, err := x509.CreateCertificate(rand.Reader, ca.cert, ca.cert, ca.key.Public(), ca.key) |
| 64 | if err != nil { |
| 65 | return err |
| 66 | } |
| 67 | |
| 68 | return writeExclusivePEMFile(path, "CERTIFICATE", 0644, derBytes) |
| 69 | } |
| 70 | |
| 71 | func (ca *CA) WriteCertificate(template *x509.Certificate, certPath string, keyPath string) error { |
| 72 | key, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader) |