File tree 3 files changed +12
-5
lines changed
3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ mdoc = mdoci.new(
74
74
The method ` .new() ` gets the user attributes, devicekeyinfo and doctype.
75
75
76
76
````
77
+ import os
78
+
77
79
from pymdoccbor.mdoc.issuer import MdocCborIssuer
78
80
79
81
PKEY = {
@@ -95,13 +97,15 @@ PID_DATA = {
95
97
}
96
98
97
99
mdoci = MdocCborIssuer(
98
- private_key=PKEY
100
+ private_key=PKEY,
101
+ alg = "ES256"
99
102
)
100
103
101
104
mdoc = mdoci.new(
102
105
doctype="eu.europa.ec.eudiw.pid.1",
103
106
data=PID_DATA,
104
- devicekeyinfo=PKEY # TODO
107
+ devicekeyinfo=PKEY,
108
+ validity = {"issuance_date": "2025-01-17", "expiry_date": "2025-11-13" },
105
109
# cert_path="/path/"
106
110
)
107
111
@@ -161,7 +165,7 @@ API usage:
161
165
- ` msoi.disclosure_map ` , disclosure objects grouped by namespaces
162
166
- ` msoi.sign ` , signs the MSO and returns it
163
167
164
- ### Parse a binary Mdoc
168
+ ### [ Presentation ] Parse a binary MDocCBOR
165
169
166
170
````
167
171
from pymdoccbor.mdoc.verifier import MdocCbor
176
180
177
181
mdoc.documents
178
182
>> [pymdoccbor.mdoc.verifier.MobileDocument [valid]]
183
+
184
+ mdoc.disclosure_map
185
+ >> ... dictionary containing all the disclosed attributes ...
179
186
````
180
187
181
188
### Verify the Mobile Security Object
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ def new(
75
75
devicekeyinfo : Union [dict , CoseKey , str ] = None ,
76
76
cert_path : str = None ,
77
77
revocation : dict = None
78
- ):
78
+ ) -> dict :
79
79
"""
80
80
create a new mdoc with signed mso
81
81
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ def __init__(self) -> None:
105
105
self .documents : List [MobileDocument ] = []
106
106
self .documents_invalid : list = []
107
107
self .disclosure_map : dict = {}
108
-
108
+
109
109
def loads (self , data : str ) -> None :
110
110
"""
111
111
Load the data from a AF Binary string
You can’t perform that action at this time.
0 commit comments