pki

package
v0.0.0-...-143a0bd Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRsaKey

func GenerateRsaKey() (*rsa.PrivateKey, error)

Types

type CA

type CA struct {
	CertificateWithKey
}

func MustNewCA

func MustNewCA() *CA

func NewCA

func NewCA() (*CA, error)

func (*CA) MustNewCertificate

func (c *CA) MustNewCertificate(subject string) *CertificateWithKey

func (*CA) NewCertificate

func (c *CA) NewCertificate(subject string) (*CertificateWithKey, error)

type CertificateWithKey

type CertificateWithKey struct {
	Key               *rsa.PrivateKey
	Certificate       *x509.Certificate
	SignedCertificate []byte
	Request           *x509.CertificateRequest
	SignedRequest     []byte
}

func (*CertificateWithKey) CertificateToFile

func (c *CertificateWithKey) CertificateToFile(filename string, perm os.FileMode) error

func (*CertificateWithKey) CertificateToPem

func (c *CertificateWithKey) CertificateToPem() []byte

func (*CertificateWithKey) KeyToFile

func (c *CertificateWithKey) KeyToFile(filename string, perm os.FileMode) error

func (*CertificateWithKey) KeyToPem

func (c *CertificateWithKey) KeyToPem() []byte

func (*CertificateWithKey) RequestToFile

func (c *CertificateWithKey) RequestToFile(filename string, perm os.FileMode) error

func (*CertificateWithKey) RequestToPem

func (c *CertificateWithKey) RequestToPem() []byte

Jump to

Keyboard shortcuts

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