Documentation ¶
Overview ¶
Package certtool used for generate certificate for test/examples By default, use CreateTemplate, GeneratePrivateKey, and SignCertificate, the certificates created in same process have same root ca
Index ¶
- func CreateTemplate(cn string, isca bool, dns []string) (*x509.Certificate, error)
- func GeneratePrivateKey(curve string) (priv interface{}, err error)
- func Initialize() error
- func PemEncode(describe string, data []byte) (string, error)
- func PemEncodeKey(priv interface{}) (string, error)
- func PublicKey(priv interface{}) interface{}
- type CertificateInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTemplate ¶
CreateTemplate creates a basic template for certificate
func GeneratePrivateKey ¶
GeneratePrivateKey generate a private key for certificate Parameter curve support "P224","P256","P384", "P521", "RSA". If curve is "RSA", it will generate a 2048 bits RSA key
func PemEncodeKey ¶
PemEncodeKey encode private key to pem string
Types ¶
type CertificateInfo ¶
CertificateInfo contains x509 certificate information.
func CreateCertificateInfo ¶
func CreateCertificateInfo(template, parent *x509.Certificate, templatePriv, parentPriv interface{}) (*CertificateInfo, error)
CreateCertificateInfo makes a CertificateInfo
func SignCertificate ¶
func SignCertificate(template *x509.Certificate, priv interface{}) (*CertificateInfo, error)
SignCertificate create a Certificate based on template, signed by RootCA
Click to show internal directories.
Click to hide internal directories.