Documentation ¶
Index ¶
- func GenerateCertificate(caKey *rsa.PrivateKey, caCert *x509.Certificate, bits int, ...) ([]byte, []byte, error)
- func ReadCertificate(path string) (*x509.Certificate, error)
- func ReadPKCS1PrivateKey(path string) (*rsa.PrivateKey, error)
- func ReadPKCS8PrivateKey(path string) (*rsa.PrivateKey, error)
- func WriteCertificate(path string, cert []byte) error
- func WritePKCS1PrivateKey(path string, privKey []byte) error
- func WritePKCS8PrivateKey(path string, privKey []byte) error
- type ApplicationInformation
- type CertificateConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCertificate ¶
func GenerateCertificate(caKey *rsa.PrivateKey, caCert *x509.Certificate, bits int, info *ApplicationInformation) ([]byte, []byte, error)
GenerateCertificate 生成证书(私钥,证书)
func ReadCertificate ¶
func ReadCertificate(path string) (*x509.Certificate, error)
ReadCertificate 读取证书
func ReadPKCS1PrivateKey ¶
func ReadPKCS1PrivateKey(path string) (*rsa.PrivateKey, error)
ReadPKCS1PrivateKey 读取 PKCS1 私钥
func ReadPKCS8PrivateKey ¶
func ReadPKCS8PrivateKey(path string) (*rsa.PrivateKey, error)
ReadPKCS8PrivateKey 读取 PKCS8 私钥
func WritePKCS1PrivateKey ¶
WritePKCS1PrivateKey 写出 PKCS! 私钥
func WritePKCS8PrivateKey ¶
WritePKCS8PrivateKey 写出 PKCS8 私钥
Types ¶
type ApplicationInformation ¶
type ApplicationInformation struct { CertificateConfig *CertificateConfig CommonName string CountryName string ProvinceName string LocalityName string OrganizationName string OrganizationUnitName string }
ApplicationInformation 申请信息
Click to show internal directories.
Click to hide internal directories.