Documentation ¶
Index ¶
- Variables
- func GenCA(caKey ed25519.PrivateKey) []byte
- func GenCSR(privKey any, hostname string) []byte
- func GenKey() []byte
- func PemSum(pemBytes []byte) string
- func ReadCSR(certPEMBytes []byte) *x509.CertificateRequest
- func ReadCrt(certPEMBytes []byte) *x509.Certificate
- func ReadKey(keyPEMBytes []byte) ed25519.PrivateKey
- func SignCrt(caCert *x509.Certificate, caPriv ed25519.PrivateKey, ...) []byte
- func VerifyCrt(caCert *x509.Certificate, cert *x509.Certificate) error
Constants ¶
This section is empty.
Variables ¶
var CaExpirey time.Time = time.Now().AddDate(10, 0, 0)
var CertExpirey time.Time = time.Now().AddDate(3, 0, 0)
Functions ¶
func GenCA ¶
func GenCA(caKey ed25519.PrivateKey) []byte
Take a privat key object and a hostname and return a PEM encoded CA with the commonname of the hostname
func GenCSR ¶
Take a private key, a hostname, and a path, create a CSR with the CN and the DNSNames as the hostname and return a PEM encoded CSR
func ReadCSR ¶
func ReadCSR(certPEMBytes []byte) *x509.CertificateRequest
Take a PEM encoded DER encoded csr and return the *x509.CertificateRequest object
func ReadCrt ¶
func ReadCrt(certPEMBytes []byte) *x509.Certificate
Take a PEM encoded DER encoded cert and return the *x509.Certificate object
func ReadKey ¶
func ReadKey(keyPEMBytes []byte) ed25519.PrivateKey
Take a PEM encoded SEC1,ASN1 DER private key and return the *ed25519.PrivateKey object
func SignCrt ¶
func SignCrt(caCert *x509.Certificate, caPriv ed25519.PrivateKey, csr *x509.CertificateRequest) []byte
Take a CA cert object, private key of the CA, a CSR, and a path to write the cert Generate a cert from the CSA and sign with the CA supplied
func VerifyCrt ¶
func VerifyCrt(caCert *x509.Certificate, cert *x509.Certificate) error
Verify if a cert was signed by the CA
Types ¶
This section is empty.