From 1dcfe60e13d112fa31a856f4eeb53bbe149030db Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 4 Jul 2022 09:29:18 +0200 Subject: [PATCH] improve Sign1Message.Sign1() docs Signed-off-by: qmuntal --- sign1.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sign1.go b/sign1.go index 5d4ba7c..a1e2771 100644 --- a/sign1.go +++ b/sign1.go @@ -110,6 +110,12 @@ func (m *Sign1Message) UnmarshalCBOR(data []byte) error { } // Sign signs a Sign1Message using the provided Signer. +// The signature is stored in m.Signature. +// +// Note that m.Signature is only valid as long as m.Headers.Protected and +// m.Payload remain unchanged after calling this method. +// It is possible to modify m.Headers.Unprotected after signing, +// i.e., add counter signatures or timestamps. // // Reference: https://datatracker.ietf.org/doc/html/rfc8152#section-4.4 func (m *Sign1Message) Sign(rand io.Reader, external []byte, signer Signer) error {