cert

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCa added in v0.0.11

func CreateCa(keyPath string, certPath string) error

func CreateCert

func CreateCert(keyPath string, certPath string, parent *Cert) error

func CreateCertAndSubject added in v0.0.11

func CreateCertAndSubject(keyPath string, certPath string, subject *pkix.Name) error

func CreateCertGroup added in v0.0.11

func CreateCertGroup(subject *pkix.Name, caPath, certPath, keyPath string) error

func CreateKuicCert added in v0.0.13

func CreateKuicCert(serverPath string, clientPath string) (err error)

func CreateKuicServerCert added in v0.0.13

func CreateKuicServerCert(serverPath string) (err error)

func CreateOrReadCaPem added in v0.0.19

func CreateOrReadCaPem(savePath string) (caPem []byte, keyPem []byte, err error)

func CreateOrReadCert

func CreateOrReadCert(keyPath string, certPath string) error

func CreateOrReadCertPem added in v0.0.19

func CreateOrReadCertPem(serverName string, username string, caPem []byte, keyPem []byte, certPath string) (certPem []byte, keyPEM []byte, err error)

func CreateOrReadKuicClientCert added in v0.0.13

func CreateOrReadKuicClientCert(serverCaPem []byte, clientCertPath string, clientCaPath string) (clientCaPem []byte, clientCertPem []byte, clientKeyPEM []byte, err error)

func CreateOrReadKuicServerCertPem added in v0.0.13

func CreateOrReadKuicServerCertPem(serverPath string) (serverName string, serverCaPem []byte, serverCertPem []byte, serverKeyPEM []byte, err error)

func ReadCertificateForPem added in v0.0.11

func ReadCertificateForPem(certPath string) (*x509.Certificate, error)

func ReadKuicCert added in v0.0.13

func ReadKuicCert(certPath string) (ca *x509.Certificate, cert *tls.Certificate, certificate *x509.Certificate, err error)

func ReadRsaPrivateKeyForPem added in v0.0.11

func ReadRsaPrivateKeyForPem(keyPath string) (*rsa.PrivateKey, error)

Types

type Cert added in v0.0.11

type Cert struct {
	CSR     *x509.Certificate
	CertKey *rsa.PrivateKey
	CERT    []byte
}

type Certificate added in v0.0.13

type Certificate struct {
	Cert       *tls.Certificate
	CaPem      []byte
	ServerName string
	UserName   string
}

func ParseClientKuicCertBytes added in v0.1.5

func ParseClientKuicCertBytes(data []byte) (*Certificate, error)

func ParseClientKuicCertFile added in v0.1.5

func ParseClientKuicCertFile(certPath string) (string, *Certificate, error)

type Manager added in v0.0.13

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager added in v0.0.13

func NewManager(certPath string) *Manager

func (*Manager) CreateClientCert added in v0.0.13

func (m *Manager) CreateClientCert(username string) (*Certificate, error)

func (*Manager) CreateOrReadClientKuicCertFile added in v0.1.5

func (m *Manager) CreateOrReadClientKuicCertFile(username string) (string, *Certificate, error)

func (*Manager) GetCertPool added in v0.0.13

func (m *Manager) GetCertPool() *x509.CertPool

func (*Manager) GetServerCertificate added in v0.0.13

func (m *Manager) GetServerCertificate() *tls.Certificate

func (*Manager) GetServerName added in v0.0.15

func (m *Manager) GetServerName() string

func (*Manager) Init added in v0.0.13

func (m *Manager) Init() (err error)

Jump to

Keyboard shortcuts

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