keystore

package
v0.14.5-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlgRSA   = "RSA"
	AlgECDSA = "ECDSA"
)

Variables

View Source
var ErrNoCertificatePresent = errors.New("no certificate present")
View Source
var ErrNoSuchKey = errors.New("no such key")

Functions

func FindChain

func FindChain(key crypto.PublicKey, pool []*x509.Certificate) []*x509.Certificate

func ValidateChain

func ValidateChain(chain []*x509.Certificate) error

Types

type Entry

type Entry struct {
	KeyID      string
	Alg        string
	KeySize    int
	PrivateKey crypto.Signer
	CertChain  []*x509.Certificate
}

func (*Entry) JOSEAlgorithm

func (e *Entry) JOSEAlgorithm() jose.SignatureAlgorithm

func (*Entry) JWK

func (e *Entry) JWK() jose.JSONWebKey

func (*Entry) TLSCertificate

func (e *Entry) TLSCertificate() (tls.Certificate, error)

type KeyStore

type KeyStore interface {
	GetKey(id string) (*Entry, error)
	Entries() []*Entry
}

func NewKeyStoreFromKey

func NewKeyStoreFromKey(privateKey crypto.Signer) (KeyStore, error)

func NewKeyStoreFromPEMBytes

func NewKeyStoreFromPEMBytes(pemBytes []byte, password string) (KeyStore, error)

func NewKeyStoreFromPEMFile

func NewKeyStoreFromPEMFile(pemFilePath, password string) (KeyStore, error)

Jump to

Keyboard shortcuts

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