feat: pkg ca interface and config

This commit is contained in:
Urko 2023-02-15 11:09:42 +01:00
parent a971090fbc
commit a3845e91b9
1 changed files with 28 additions and 0 deletions

28
pkg/ca/ca.go Normal file
View File

@ -0,0 +1,28 @@
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
}