File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ mdoc = mdoci.new(
7474The method ` .new() ` gets the user attributes, devicekeyinfo and doctype.
7575
7676````
77+ import os
78+
7779from pymdoccbor.mdoc.issuer import MdocCborIssuer
7880
7981PKEY = {
@@ -95,13 +97,15 @@ PID_DATA = {
9597 }
9698
9799mdoci = MdocCborIssuer(
98- private_key=PKEY
100+ private_key=PKEY,
101+ alg = "ES256"
99102)
100103
101104mdoc = mdoci.new(
102105 doctype="eu.europa.ec.eudiw.pid.1",
103106 data=PID_DATA,
104- devicekeyinfo=PKEY # TODO
107+ devicekeyinfo=PKEY,
108+ validity = {"issuance_date": "2025-01-17", "expiry_date": "2025-11-13" },
105109 # cert_path="/path/"
106110)
107111
@@ -161,7 +165,7 @@ API usage:
161165- ` msoi.disclosure_map ` , disclosure objects grouped by namespaces
162166- ` msoi.sign ` , signs the MSO and returns it
163167
164- ### Parse a binary Mdoc
168+ ### [ Presentation ] Parse a binary MDocCBOR
165169
166170````
167171from pymdoccbor.mdoc.verifier import MdocCbor
176180
177181mdoc.documents
178182>> [pymdoccbor.mdoc.verifier.MobileDocument [valid]]
183+
184+ mdoc.disclosure_map
185+ >> ... dictionary containing all the disclosed attributes ...
179186````
180187
181188### Verify the Mobile Security Object
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ def new(
7575 devicekeyinfo : Union [dict , CoseKey , str ] = None ,
7676 cert_path : str = None ,
7777 revocation : dict = None
78- ):
78+ ) -> dict :
7979 """
8080 create a new mdoc with signed mso
8181
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ def __init__(self) -> None:
105105 self .documents : List [MobileDocument ] = []
106106 self .documents_invalid : list = []
107107 self .disclosure_map : dict = {}
108-
108+
109109 def loads (self , data : str ) -> None :
110110 """
111111 Load the data from a AF Binary string
You can’t perform that action at this time.
0 commit comments