signer

package
v0.0.0-...-b92b52e Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package signer combines some utilities for management behind the keys involved in certificates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SigningCert

type SigningCert struct {
	CertBin    []byte
	Cert       *x509.Certificate
	PrivateKey *ecdsa.PrivateKey
}

A SigningCert is a certificate that can be used to sign other certificates. As such, it's private key is also needed.

func LoadSigningCert

func LoadSigningCert(base string) (*SigningCert, error)

LoadSigningCert loads a signing certificate from a pair of files base.crt, and base.key.

func NewSigningCert

func NewSigningCert() (*SigningCert, error)

NewSigningCert builds a fresh signing certificate to use as a root certificate.

func (*SigningCert) Export

func (s *SigningCert) Export(cafile, keyfile string) error

Export writes the certificate and the signing key to files in PEM format. May return an error if the files exist.

func (*SigningCert) SignTemplate

func (s *SigningCert) SignTemplate(template *x509.Certificate, pub interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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