From b37d38651e057ff08f1c0570e2ce212c2e98dcca Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Mon, 20 Mar 2023 16:24:16 +0000 Subject: [PATCH] add signature setter to Sign1Message --- pycose/messages/sign1message.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pycose/messages/sign1message.py b/pycose/messages/sign1message.py index c083c64..d46448a 100644 --- a/pycose/messages/sign1message.py +++ b/pycose/messages/sign1message.py @@ -42,6 +42,13 @@ def __init__(self, @property def signature(self): return self._signature + + @signature.setter + def signature(self, value): + if not isinstance(value, bytes): + raise TypeError("Signature must be of type 'bytes'") + + self._signature = value def _create_sig_structure(self, detached_payload: Optional[bytes] = None): """