cert

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportPemChain

func ExportPemChain(certs []*GenCertOutput, dir, name string) error

ExportPemChain exports a list of certificates to a chain file.

Types

type GenCertInput

type GenCertInput struct {
	// CommonName is the target's common name.
	CommonName string
	// Dir is the directory where to export the target.
	Dir string
	// DaysDuration is the target's duration in days.
	DaysDuration int
	// Type can be one of root,intermediate or leaf.
	Type string
	// IssuerCert is the issuer certificate that is signing the target certificate.
	IssuerCert *x509.Certificate
	// IssuerPrivateKey is the issuer private key.
	IssuerPrivateKey *rsa.PrivateKey
}

GenCertInput represent payload required to generate a certificate.

type GenCertOutput

type GenCertOutput struct {
	// Certificate represents x509 certificate.
	Certificate *x509.Certificate
	// PrivateKey is a generated private key.
	PrivateKey *rsa.PrivateKey
	// FileName is the certificate's file location on disk.
	FileName string
}

GenCertOutput represent the output after successful certificate generation.

func GenCert

func GenCert(input *GenCertInput) (*GenCertOutput, error)

GenCert generates a certificate file and a private key.

Jump to

Keyboard shortcuts

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