go-cert-gen/pkg/ca/ca.go

29 lines
485 B
Go
Raw Normal View History

2023-02-15 11:09:42 +01:00
package ca
import (
"crypto/x509"
"math/big"
"time"
"gitlab.com/urkob/go-cert-gen/pkg/client"
)
type CaSubject struct {
Organization string
CommonName string
}
type CaConfig struct {
SerialNumber *big.Int
Subject CaSubject
KeyUsage x509.KeyUsage
ExtKeyUsage []x509.ExtKeyUsage
Duration time.Duration
}
type RootCACertificateIface interface {
WithClientCert(config *client.ClientCertConfig) (client.ClientCertIface, error)
Key() []byte
PEM() []byte
}