keycerts

package
v0.0.0-...-39f2eaa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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 WriteCertificate

func WriteCertificate(path string, cert []byte) error

WriteCertificate 写出证书

func WritePKCS1PrivateKey

func WritePKCS1PrivateKey(path string, privKey []byte) error

WritePKCS1PrivateKey 写出 PKCS! 私钥

func WritePKCS8PrivateKey

func WritePKCS8PrivateKey(path string, privKey []byte) error

WritePKCS8PrivateKey 写出 PKCS8 私钥

Types

type ApplicationInformation

type ApplicationInformation struct {
	CertificateConfig    *CertificateConfig
	CommonName           string
	CountryName          string
	ProvinceName         string
	LocalityName         string
	OrganizationName     string
	OrganizationUnitName string
}

ApplicationInformation 申请信息

type CertificateConfig

type CertificateConfig struct {
	IsCA           bool
	IP             []net.IP
	DNS            []string
	ExpirationTime time.Duration
}

CertificateConfig 证书配置

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL