internal

package
v0.0.0-...-b563d55 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package internal holds the logic for generating certificates. Based on https://golang.org/src/crypto/tls/generate_cert.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCertificateAndPrivateKeyPEM

func CreateCertificateAndPrivateKeyPEM(params *Params) ([]byte, []byte, error)

CreateCertificateAndPrivateKeyPEM returns randomly generated X.509 Public Certificate and Private Key pair in PEM format as byte arrays.

func CreateCertificateAndPrivateKeyPEMFiles

func CreateCertificateAndPrivateKeyPEMFiles(publicCertificateFilePath string, privateKeyFilePath string, params *Params) error

CreateCertificateAndPrivateKeyPEMFiles writes the generated X.509 Public Certificate and Private Key pair to the file system in PEM format.

func ParseName

func ParseName(subject string) (pkix.Name, error)

ParseName parses the RFC-2253 encoded Distinguished Names.

func ReadKeyPair

func ReadKeyPair(publicCertFileData []byte, privateKeyFileData []byte) (*x509.Certificate, interface{}, error)

ReadKeyPair takes PEM-encoded public certificate/private key pairs and returns the Go classes for them so they can be used for encryption or signing.

Types

type Params

type Params struct {
	CertificateAuthority bool
	ValidityDuration     time.Duration
	Hostnames            []string
	KeyType              string

	ParentPublicCertificatePEM []byte
	ParentPrivateKeyPEM        []byte

	Name pkix.Name
}

Params holds all the parameters required to construct a public certificate/private key pair.

Jump to

Keyboard shortcuts

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