// generateBaseCert returns a base non-CA cert that can be made a workload or CA cert
// By adding subjects, key usage and additional proerties.
generateBaseCert returns a base non-CA cert that can be made a workload or CA cert
By adding subjects, key usage and additional proerties.
// generateBaseCert returns a base non - CA cert that can be made a workload or CA cert // By adding subjects key usage and additional proerties .
func generateBaseCert(ttl time.Duration, publicKey interface{}) (*x509.Certificate, error) {
	serNum, err := newSerialNumber()
	if err != nil {
		return nil, err
	}
	now := time.Now()
	notAfter := now.Add(ttl)
	return &x509.Certificate{
		SerialNumber: serNum,
		NotBefore:    now,
		NotAfter:     notAfter,
		PublicKey:    publicKey,
	}, nil
}
func generateBaseCert ( ttl time . Duration , publicKey interface { } ) ( * x509 . Certificate , error ) { serNum , err := newSerialNumber ( ) if err != nil { return nil , err } now := time . Now ( ) notAfter := now . Add ( ttl ) return & x509 . Certificate { SerialNumber : serNum , NotBefore : now , NotAfter : notAfter , PublicKey : publicKey , } , nil }
generateBaseCert returns a base non-CA cert that can be made a workload or CA cert
By adding subjects, key usage and additional proerties.
generateBaseCert returns a base non - CA cert that can be made a workload or CA cert By adding subjects key usage and additional proerties .