SelfCA is a Go module for self-signed certificate generating.
Creating your own certificate authority and generating self-signed SSL certificates.
You can directly using the binary distributions of selfca, follow selfca release tool.
- Easy to use
- No openssl required
- Reuse of CA root certificate
go get -u github.com/likexian/selfca
import (
"github.com/likexian/selfca"
)
Visit the docs on GoDoc
// config for generating CA certificate
config := selfca.Certificate{
IsCA: true,
NotBefore: time.Now(),
NotAfter: time.Now().Add(time.Duration(365*24) * time.Hour),
}
// generating the certificate
certificate, key, err := selfca.GenerateCertificate(config)
if err != nil {
panic(err)
}
// writing the certificate
err = selfca.WriteCertificate("ca", certificate, key)
if err != nil {
panic(err)
}
Copyright 2014-2024 Li Kexian
Licensed under the Apache License 2.0
If this project is helpful, please share it with friends.
If you want to thank me, you can give me a cup of coffee.