From 6308c66ab7087d3414128010ab749ea03c01a70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Wed, 9 Jul 2025 12:55:44 +0200 Subject: [PATCH] update varsig documentation --- varsig.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/varsig.go b/varsig.go index 5c54c50..a252dda 100644 --- a/varsig.go +++ b/varsig.go @@ -27,13 +27,21 @@ import ( // Varsig represents types that describe how a signature was generated // and thus how to interpret the signature and verify the signed data. type Varsig interface { - // accessors for fields that are common to all varsig + // Version returns the varsig's version field. Version() Version + + // Discriminator returns the algorithm used to produce the corresponding signature. Discriminator() Discriminator + + // PayloadEncoding returns the codec that was used to encode the signed data. PayloadEncoding() PayloadEncoding + + // Signature returns the cryptographic signature of the signed data. + // This value is never present in a varsig >= v1 and must either be a valid + // signature with the correct length or empty in varsig < v1. Signature() []byte - // Operations that are common to all varsig + // Encode returns the encoded byte format of the varsig. Encode() []byte } @@ -115,7 +123,6 @@ func (v varsig) decodePayEncAndSig(r BytesReader) (PayloadEncoding, []byte, erro if err == nil { return 0, nil, ErrUnexpectedSignaturePresent } - } return payEnc, signature, nil