Versions in this module Expand all Collapse all v2 v2.3.3 Oct 19, 2023 Changes in this version + var P11Context *pkcs11Context + func ComputeSKI(hashType crypto.HashType, pub interface{}) ([]byte, error) + func CreateCACertificate(cfg *CACertificateConfig) error + func CreateCSR(cfg *CSRConfig) error + func CreateP11Key(handle interface{}, keyType crypto.KeyType, keyId, keyPwd string) ([]byte, crypto.PrivateKey, error) + func CreatePrivKey(keyType crypto.KeyType, keyPath, keyFile string, isTLS bool) (key crypto.PrivateKey, err error) + func GenerateCSRTemplate(privKey crypto.PrivateKey, ...) (*x509.CertificateRequest, error) + func GenerateCertTemplate(cfg *GenerateCertTemplateConfig) (*x509.Certificate, error) + func InitP11Handle(handle interface{}) + func IssueCertificate(cfg *IssueCertificateConfig) error + func ParseCertificate(certFilePath string) (*x509.Certificate, error) + func ParseCertificateRequest(csrFilePath string) (*x509.CertificateRequest, error) + func ParseCertificateToJson(certFilePath string) (string, error) + func ParseP11PrivKey(handle interface{}, keySpecJson []byte) (crypto.PrivateKey, error) + type CACertificateConfig struct + CertFileName string + CertPath string + CommonName string + Country string + ExpireYear int32 + HashType crypto.HashType + Locality string + Organization string + OrganizationalUnit string + PrivKey crypto.PrivateKey + Province string + Sans []string + type CSRConfig struct + CommonName string + Country string + CsrFileName string + CsrPath string + Locality string + Organization string + OrganizationalUnit string + PrivKey crypto.PrivateKey + Province string + type GenerateCertTemplateConfig struct + CommonName string + Country string + ExpireYear int32 + ExtKeyUsages []x509.ExtKeyUsage + IsCA bool + KeyUsages []x509.KeyUsage + Locality string + Organization string + OrganizationalUnit string + PrivKey crypto.PrivateKey + Province string + Sans []string + type IssueCertificateConfig struct + CertFileName string + CertPath string + CsrFilePath string + ExpireYear int32 + ExtKeyUsages []x509.ExtKeyUsage + HashType crypto.HashType + IsCA bool + IssuerCertFilePath string + IssuerPrivKeyFilePath string + IssuerPrivKeyPwd []byte + KeyUsages []x509.KeyUsage + Sans []string