(commonName string, rootCrt *x509.Certificate, rootKey crypto.Signer, lifetime time.Duration)
| 36 | } |
| 37 | |
| 38 | func generateIntermediate(commonName string, rootCrt *x509.Certificate, rootKey crypto.Signer, lifetime time.Duration) (*x509.Certificate, crypto.Signer, error) { |
| 39 | template, signer, err := newCert(commonName, x509util.DefaultIntermediateTemplate, lifetime) |
| 40 | if err != nil { |
| 41 | return nil, nil, err |
| 42 | } |
| 43 | intermediate, err := x509util.CreateCertificate(template, rootCrt, signer.Public(), rootKey) |
| 44 | if err != nil { |
| 45 | return nil, nil, err |
| 46 | } |
| 47 | return intermediate, signer, nil |
| 48 | } |
| 49 | |
| 50 | func newCert(commonName, templateName string, lifetime time.Duration) (cert *x509.Certificate, signer crypto.Signer, err error) { |
| 51 | signer, err = keyutil.GenerateDefaultSigner() |
no test coverage detected