pki

package
v0.0.0-...-2b82ec7 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const PEMBlockTypeCSR string = "CERTIFICATE REQUEST"
View Source
const PEMBlockTypeCertificate string = "CERTIFICATE"
View Source
const PEMBlockTypePK string = "PRIVATE KEY"
View Source
const PKAlgorithmECDSA string = "ECDSA"
View Source
const PKAlgorithmRSA string = "RSA"

Variables

This section is empty.

Functions

func LoadCSR

func LoadCSR(fileName string) (csr *x509.CertificateRequest, err error)

Types

type Authority

type Authority struct {
	// contains filtered or unexported fields
}

func CreateAuthority

func CreateAuthority(configFileName string) (*Authority, error)

func (*Authority) GetConfig

func (authority *Authority) GetConfig() common.Config

func (*Authority) GetDB

func (authority *Authority) GetDB() common.Database

func (*Authority) Shutdown

func (authority *Authority) Shutdown()

type CSR

type CSR struct {
	RawData            []byte
	CertificateRequest *x509.CertificateRequest
	Key                *Key
}

func CreateCSR

func CreateCSR(subjectName string, publicKeyAlgorithm string, publicKeyCurve string, keyLength int) (*CSR, error)

func (*CSR) Export

func (csr *CSR) Export(fileName string) error

type Certificate

type Certificate struct {
	RawData []byte
	Cert    *x509.Certificate
}

func (*Certificate) Export

func (cert *Certificate) Export(fileName string) error

type Key

type Key struct {
	Private crypto.Signer
	Public  crypto.PublicKey
}

func CreateKey

func CreateKey(publicKeyAlgorithm string, publicKeyCurve string, keyLength int) (*Key, error)

func LoadKey

func LoadKey(fileName string) (*Key, error)

func (*Key) Export

func (key *Key) Export(fileName string) error

type Signer

type Signer struct {
	Cert *x509.Certificate
	Key  *Key
}

func (*Signer) SignCertificate

func (signer *Signer) SignCertificate(csr *x509.Certificate, publicKey crypto.PublicKey) (cert Certificate, err error)

Jump to

Keyboard shortcuts

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