easypki

package
v0.0.0-...-b3d2b93 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package easypki provides helpers to manage a Public Key Infrastructure.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCannotSelfSignNonCA = errors.New("cannot self sign non CA request")
	ErrMaxPathLenReached   = errors.New("max path len reached")
)

Signing errors.

Functions

This section is empty.

Types

type EasyPKI

type EasyPKI struct {
	Store store.Store
}

EasyPKI wraps helpers to handle a Public Key Infrastructure.

func (*EasyPKI) CRL

func (e *EasyPKI) CRL(caName string, expire time.Time) ([]byte, error)

CRL builds a CRL for a given CA based on the revoked certs.

func (*EasyPKI) GetBundle

func (e *EasyPKI) GetBundle(caName, name string) (*certificate.Bundle, error)

GetBundle fetches and returns a certificate bundle from the store.

func (*EasyPKI) GetCA

func (e *EasyPKI) GetCA(name string) (*certificate.Bundle, error)

GetCA fetches and returns the named Certificate Authrority bundle from the store.

func (*EasyPKI) Revoke

func (e *EasyPKI) Revoke(caName string, cert *x509.Certificate) error

Revoke revokes the given certificate from the store.

func (*EasyPKI) Sign

func (e *EasyPKI) Sign(signer *certificate.Bundle, req *Request) error

Sign signs a generated certificate bundle based on the given request with the given signer.

type Request

type Request struct {
	Name                string
	IsClientCertificate bool
	PrivateKeySize      int
	Template            *x509.Certificate
}

Request is a struct for providing configuration to GenerateCertificate when actioning a certification generation request.

Jump to

Keyboard shortcuts

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