Skip to content

Commit b8f3bfe

Browse files
Merge pull request #1 from niscy-eudiw/branch-preprod
preprod version
2 parents 4d5bdee + 39ab4fe commit b8f3bfe

21 files changed

+435
-787
lines changed

.github/workflows/python-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
python-version:
21+
- '3.9'
2122
- '3.10'
22-
- '3.11'
2323

2424
steps:
2525
- uses: actions/checkout@v2

README.md

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,52 @@ according to ISO 18013-5.
2828
## Setup
2929

3030
````
31-
pip install pymdoccbor
31+
pip install pymdlmdoc
3232
````
3333

3434
or
3535

3636
````
37-
pip install git+https://github.com/peppelinux/pyMDOC-CBOR.git
37+
pip install git+https://github.com/devisefutures/pyMDOC-CBOR.git@cert_arg
3838
````
3939

4040
## Usage
4141

42+
### Issue an MDOC CBOR signed with HSM key
43+
44+
````
45+
PID_DATA = {
46+
"eu.europa.ec.eudiw.pid.1": {
47+
"family_name": "Raffaello",
48+
"given_name": "Mascetti",
49+
"birth_date": "1922-03-13"
50+
}
51+
}
52+
53+
mdoci = MdocCborIssuer(
54+
alg = 'ES256',
55+
kid = "demo-kid",
56+
hsm=True,
57+
key_label="p256-1",
58+
user_pin="1234",
59+
lib_path="/etc/utimaco/libcs2_pkcs11.so",
60+
slot_id=3
61+
)
62+
63+
mdoc = mdoci.new(
64+
doctype="eu.europa.ec.eudiw.pid.1",
65+
data=PID_DATA,
66+
cert_path="app/keys/IACAmDLRoot01.der" # DS certificate
67+
)
68+
69+
````
70+
4271
### Issue an MDOC CBOR
4372

4473
`MdocCborIssuer` must be initialized with a private key.
4574
The method `.new()` gets the user attributes, devicekeyinfo and doctype.
4675

4776
````
48-
import os
49-
5077
from pymdoccbor.mdoc.issuer import MdocCborIssuer
5178
5279
PKEY = {
@@ -58,17 +85,12 @@ PKEY = {
5885
}
5986
6087
PID_DATA = {
61-
"eu.europa.ec.eudiw.pid.1": {
62-
"family_name": "Raffaello",
63-
"given_name": "Mascetti",
64-
"birth_date": "1922-03-13",
65-
"birth_place": "Rome",
66-
"birth_country": "IT"
67-
},
68-
"eu.europa.ec.eudiw.pid.it.1": {
69-
"tax_id_code": "TINIT-XXXXXXXXXXXXXXX"
88+
"eu.europa.ec.eudiw.pid.1": {
89+
"family_name": "Raffaello",
90+
"given_name": "Mascetti",
91+
"birth_date": "1922-03-13"
92+
}
7093
}
71-
}
7294
7395
mdoci = MdocCborIssuer(
7496
private_key=PKEY
@@ -78,16 +100,20 @@ mdoc = mdoci.new(
78100
doctype="eu.europa.ec.eudiw.pid.1",
79101
data=PID_DATA,
80102
devicekeyinfo=PKEY # TODO
103+
cert_path="/path/"
81104
)
82105
83106
mdoc
84107
>> returns a python dictionay
85108
109+
mdoc.dump()
110+
>> returns mdoc MSO bytes
111+
86112
mdoci.dump()
87113
>> returns mdoc bytes
88114
89115
mdoci.dumps()
90-
>> returns AF Binary string representation
116+
>> returns AF Binary mdoc string representation
91117
````
92118

93119
### Issue an MSO alone
@@ -213,8 +239,6 @@ Other examples at [cbor official documentation](https://github.com/agronholm/cbo
213239
#### CBOR Diagnostic representation
214240

215241
- [CBOR-DIAG-PY](https://github.com/chrysn/cbor-diag-py)
216-
- [Authlete's CBOR diagnostic tools](https://nextdev-api.authlete.net/api/cbor)
217-
- [Auth0 CBOR diagnostic tool](https://www.mdl.me/)
218242

219243
#### X.509 certificates and chains
220244

examples/it_data_model.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

pymdoccbor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.7.0"
1+
__version__ = "0.5.4"

pymdoccbor/mdoc/exceptions.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)