certs

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPEMBlock = errors.New("Invalid PEM block")

Functions

func GeneratePFXKeystore

func GeneratePFXKeystore(privateKey interface{}, certificate *x509.Certificate, caCertificates []*x509.Certificate, keystorePassword string) ([]byte, error)

func GeneratePFXTruststore

func GeneratePFXTruststore(caCertificates []*x509.Certificate, keystorePassword string) ([]byte, error)

func ParseCertificate

func ParseCertificate(pemBytes []byte) (*x509.Certificate, error)

func ParsePrivateKey

func ParsePrivateKey(pemBytes []byte) (*rsa.PrivateKey, error)

Types

type CertOpts

type CertOpts struct {
	KeySize   int
	DnsNames  []string
	Expire    time.Duration
	Org       string
	SerialNum *big.Int
}

CertOpts contains options for generating keypair

func MakeDefaultOptions

func MakeDefaultOptions() *CertOpts

type Keypair

type Keypair struct {
	Crt []byte
	Pk  []byte
}

func CreateCA

func CreateCA(options *CertOpts) (*Keypair, error)

CreateCA generates a new self-signed CA keypair

func CreateCertificate

func CreateCertificate(caKp Keypair, options *CertOpts) (*Keypair, error)

CreateCertificate generates a new keypair signed by self-signed CA

Jump to

Keyboard shortcuts

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