depot

package
v0.0.0-...-d6b471c Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bod

func Bod(t time.Time) time.Time

func Extkeyusage

func Extkeyusage(ExtendedKeyUsage []string) []x509.ExtKeyUsage

func Keyusage

func Keyusage(KeyUsage []string) int

Types

type Depot

type Depot interface {
	CA(pass []byte, options ...string) ([]*x509.Certificate, *rsa.PrivateKey, error)
	Put(name string, crt *x509.Certificate, options ...string) error
	Serial(options ...string) (*big.Int, error)
	HasCN(cn string, allowTime int, cert *x509.Certificate, revokeOldCertificate bool, options ...string) (bool, error)
	FailureNotify(cert *x509.Certificate, m *scep.CSRReqMessage, message string)
	SuccessNotify(cert *x509.Certificate, m *scep.CSRReqMessage, message string)
}

Depot is a repository for managing certificates

type Option

type Option func(*Signer)

Option customizes Signer

func WithAllowRenewalDays

func WithAllowRenewalDays(r int) Option

WithAllowRenewalDays sets the allowable renewal time for existing certs

func WithAttributes

func WithAttributes(attribs map[string]string) Option

WithAttributes specifies the attributes to use.

func WithCAPass

func WithCAPass(pass string) Option

WithCAPass specifies the password to use with an encrypted CA key

func WithProfile

func WithProfile(profile string) Option

Profile is an optional argument to NewService which allows setting a profile for SCEP.

func WithValidityDays

func WithValidityDays(v int) Option

WithValidityDays sets the validity period new certs will use

type Signer

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

Signer signs x509 certificates and stores them in a Depot

func NewSigner

func NewSigner(depot Depot, opts ...Option) *Signer

NewSigner creates a new Signer

func (*Signer) SignCSR

func (s *Signer) SignCSR(m *scep.CSRReqMessage) (*x509.Certificate, error)

SignCSR signs a certificate using Signer's Depot CA

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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