diff --git a/pkg/ca/ca.go b/pkg/ca/ca.go new file mode 100644 index 0000000..8c4b9a3 --- /dev/null +++ b/pkg/ca/ca.go @@ -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 +}