From b126739de9fca109bbbb6bfe7af18243b03a3476 Mon Sep 17 00:00:00 2001 From: Nick Miyake Date: Thu, 24 Feb 2022 17:56:49 -0800 Subject: [PATCH] Export the EnvelopeVerifier type Restore dsse.EnvelopVerifier as an external type as it was in versions 0.1.0 and 0.2.0. Fixes #11 --- dsse/sign.go | 2 +- dsse/verify.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dsse/sign.go b/dsse/sign.go index b930d49..4c6ef61 100644 --- a/dsse/sign.go +++ b/dsse/sign.go @@ -80,7 +80,7 @@ type SignVerifier interface { // EnvelopeSigner creates signed Envelopes. type EnvelopeSigner struct { providers []SignVerifier - ev *envelopeVerifier + ev *EnvelopeVerifier } /* diff --git a/dsse/verify.go b/dsse/verify.go index c600106..16ba82c 100644 --- a/dsse/verify.go +++ b/dsse/verify.go @@ -20,7 +20,7 @@ type Verifier interface { Public() crypto.PublicKey } -type envelopeVerifier struct { +type EnvelopeVerifier struct { providers []Verifier threshold int } @@ -31,7 +31,7 @@ type AcceptedKey struct { Sig Signature } -func (ev *envelopeVerifier) Verify(e *Envelope) ([]AcceptedKey, error) { +func (ev *EnvelopeVerifier) Verify(e *Envelope) ([]AcceptedKey, error) { if len(e.Signatures) == 0 { return nil, ErrNoSignature } @@ -110,17 +110,17 @@ func (ev *envelopeVerifier) Verify(e *Envelope) ([]AcceptedKey, error) { return acceptedKeys, nil } -func NewEnvelopeVerifier(v ...Verifier) (*envelopeVerifier, error) { +func NewEnvelopeVerifier(v ...Verifier) (*EnvelopeVerifier, error) { return NewMultiEnvelopeVerifier(1, v...) } -func NewMultiEnvelopeVerifier(threshold int, p ...Verifier) (*envelopeVerifier, error) { +func NewMultiEnvelopeVerifier(threshold int, p ...Verifier) (*EnvelopeVerifier, error) { if threshold <= 0 || threshold > len(p) { return nil, errors.New("Invalid threshold") } - ev := envelopeVerifier{ + ev := EnvelopeVerifier{ providers: p, threshold: threshold, }