Skip to content

Commit 9218838

Browse files
committed
fix: types
1 parent 6de1c6c commit 9218838

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

pymdoccbor/mso/issuer.py

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
import uuid
66
import logging
77

8-
logger = logging.getLogger("pymdoccbor")
9-
10-
from pycose.headers import Algorithm #, KID
11-
from pycose.keys import CoseKey, EC2Key
8+
from pycose.keys import CoseKey
9+
from pycose.headers import Algorithm
1210
from pycose.messages import Sign1Message
1311

1412
from typing import Union
@@ -22,7 +20,7 @@
2220
from cryptography.x509 import Certificate
2321

2422

25-
from cbor_diag import *
23+
logger = logging.getLogger("pymdoccbor")
2624

2725
class MsoIssuer(MsoX509FabricInteface):
2826
"""
@@ -33,17 +31,17 @@ def __init__(
3331
self,
3432
data: dict,
3533
validity: dict,
36-
cert_path: str = None,
37-
key_label: str = None,
38-
user_pin: str = None,
39-
lib_path: str = None,
40-
slot_id: int = None,
41-
kid: str = None,
42-
alg: str = None,
43-
hsm: bool = False,
44-
private_key: Union[dict, CoseKey] = None,
45-
digest_alg: str = settings.PYMDOC_HASHALG,
46-
revocation: dict = None
34+
cert_path: str | None = None,
35+
key_label: str | None = None,
36+
user_pin: str | None = None,
37+
lib_path: str | None = None,
38+
slot_id: int | None = None,
39+
kid: str | None = None,
40+
alg: str | None = None,
41+
hsm: bool | None = False,
42+
private_key: dict | CoseKey | None = None,
43+
digest_alg: str | None = settings.PYMDOC_HASHALG,
44+
revocation: dict | None = None
4745
) -> None:
4846
"""
4947
Initialize a new MsoIssuer
@@ -88,7 +86,7 @@ def __init__(
8886
self.hash_map: dict = {}
8987
self.cert_path = cert_path
9088
self.disclosure_map: dict = {}
91-
self.digest_alg: str = digest_alg
89+
self.digest_alg = digest_alg
9290
self.key_label = key_label
9391
self.user_pin = user_pin
9492
self.lib_path = lib_path
@@ -161,9 +159,9 @@ def format_datetime_repr(self, dt: datetime.datetime) -> str:
161159

162160
def sign(
163161
self,
164-
device_key: Union[dict, None] = None,
165-
valid_from: Union[None, datetime.datetime] = None,
166-
doctype: str = None,
162+
device_key: dict | None = None,
163+
valid_from: datetime.datetime | None = None,
164+
doctype: str | None = None,
167165
) -> Sign1Message:
168166
"""
169167
Sign a mso and returns it

0 commit comments

Comments
 (0)