cert

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CertBlockType       = "CERTIFICATE"
	CertReqBlockType    = "CERTIFICATE REQUEST"
	ECKEYBlockType      = "EC PRIVATE KEY"
	RSAKeyBlockType     = "RSA PRIVATE KEY"
	PrivateKeyBlockType = "PRIVATE KEY"
)

Variables

This section is empty.

Functions

func FetchCert added in v0.2.0

func FetchCert(addr string) ([]byte, error)

func GetCertInfo

func GetCertInfo(certBytes []byte) ([]map[string]string, error)

func GetCertRequestInfo

func GetCertRequestInfo(bytes []byte) ([]map[string]string, error)

func NewCertKey added in v0.4.0

func NewCertKey(certInfo *CertInfo, rsaKeySize int) ([]byte, []byte, error)

func NewSignedCertKey

func NewSignedCertKey(caCert *x509.Certificate, caKey interface{}, certInfo *CertInfo, rsaKeySize int) ([]byte, []byte, error)

func ParseCert

func ParseCert(certBytes []byte) (*x509.Certificate, error)

func ParseCerts

func ParseCerts(certBytes []byte) ([]*x509.Certificate, error)

func ParseKey

func ParseKey(keyBytes []byte) (interface{}, error)

Types

type CertInfo

type CertInfo struct {
	SerialNumber *big.Int
	IsCA         bool
	Subject      *pkix.Name
	DNSNames     []string
	IPAddrs      []net.IP
	Duration     time.Duration
	KeyUsage     x509.KeyUsage
	ExtKeyUsage  []x509.ExtKeyUsage
}

func NewCertInfo

func NewCertInfo(duration time.Duration, sub, san, usage, extUsage string, isCA bool) (*CertInfo, error)

Jump to

Keyboard shortcuts

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