keys

package
v0.4.24 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeCertPEM

func EncodeCertPEM(cert *x509.Certificate) []byte

EncodeCertPEM embed a certificate in a PEM block

Types

type CA

type CA interface {
	PrivateKey() SignerWithPEM
	Cert() *x509.Certificate
	NewSignedCert(cfg certutil.Config, publicKey crypto.PublicKey) (*x509.Certificate, error)
}

CA is a certificate authority usable to generated signed certificates

func NewSelfSignedCA

func NewSelfSignedCA(commonName string, organization []string) (CA, error)

NewSelfSignedCA creates a CA and return it with its private key

type SignerWithPEM

type SignerWithPEM interface {
	crypto.Signer
	PEM() []byte
}

SignerWithPEM is a signer implementation that has its PEM encoded representation attached

func NewRSASigner

func NewRSASigner() (SignerWithPEM, error)

NewRSASigner generates a private key suitable for a TLS cert (client or server)

Jump to

Keyboard shortcuts

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