11from __future__ import annotations
22
3- from typing import Any , Dict , List , Optional , Tuple , TypeVar
3+ from typing import Any , Dict , List , Optional , Tuple
44
55from cbor2 import CBORTag , loads
66
1010from .enums import COSETypes
1111from .signer import Signer
1212
13- Self = TypeVar ("Self" , bound = "COSEMessage" )
14-
1513
1614class COSEMessage (CBORProcessor ):
1715 """
@@ -188,7 +186,7 @@ def dumps(self) -> bytes:
188186 tag = COSE_TYPE_TO_TAG .get (self ._type , - 1 )
189187 return self ._dumps (CBORTag (tag , self ._msg )) if tag > 0 else self ._dumps (self ._msg )
190188
191- def countersign (self : Self , signer : Signer , aad : bytes = b"" , abbreviated : bool = False , tagged : bool = False ) -> Self :
189+ def countersign (self , signer : Signer , aad : bytes = b"" , abbreviated : bool = False , tagged : bool = False ) -> COSEMessage :
192190 """
193191 Countersigns to the COSE message with the signer specified.
194192
@@ -304,7 +302,7 @@ def _get_kid(self, sig: list) -> Optional[bytes]:
304302 kid = sig [1 ].get (4 , None )
305303 return kid if kid else self ._loads (sig [0 ]).get (4 , None )
306304
307- def detach_payload (self : Self ) -> Tuple [COSEMessage , bytes ]:
305+ def detach_payload (self ) -> Tuple [COSEMessage , bytes ]:
308306 """
309307 Detach a payload from the COSE message
310308
@@ -320,7 +318,7 @@ def detach_payload(self: Self) -> Tuple[COSEMessage, bytes]:
320318
321319 return COSEMessage (self ._type , [self ._msg [0 ], self ._msg [1 ], None , * self ._msg [3 :]]), self ._payload
322320
323- def attach_payload (self : Self , payload : bytes ) -> COSEMessage :
321+ def attach_payload (self , payload : bytes ) -> COSEMessage :
324322 """
325323 Attach a detached content to the COSE message
326324
0 commit comments