Skip to content

Commit 7d6d491

Browse files
committed
readme: examples updates with last changes
1 parent 9e63789 commit 7d6d491

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ mdoc = mdoci.new(
7474
The method `.new()` gets the user attributes, devicekeyinfo and doctype.
7575

7676
````
77+
import os
78+
7779
from pymdoccbor.mdoc.issuer import MdocCborIssuer
7880
7981
PKEY = {
@@ -95,13 +97,15 @@ PID_DATA = {
9597
}
9698
9799
mdoci = MdocCborIssuer(
98-
private_key=PKEY
100+
private_key=PKEY,
101+
alg = "ES256"
99102
)
100103
101104
mdoc = 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
````
167171
from pymdoccbor.mdoc.verifier import MdocCbor
@@ -176,6 +180,9 @@ mdoc
176180
177181
mdoc.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

pymdoccbor/mdoc/issuer.py

+1-1
Original file line numberDiff line numberDiff 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

pymdoccbor/mdoc/verifier.py

+1-1
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)