cddl 0.8.8 → 0.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/cddl.gemspec +2 -1
- data/lib/cddl.rb +22 -6
- data/test/test-cddl.rb +51 -0
- data/test-data/7807.cddl +14 -0
- data/test-data/abignum.cddl +1 -0
- data/test-data/bpv7.cddl +136 -0
- data/test-data/bpv7a.cddl +181 -0
- data/test-data/bpv7b.cddl +167 -0
- data/test-data/coral.cddl +10 -0
- data/test-data/coral1.cddl +5 -0
- data/test-data/coral2.cddl +7 -0
- data/test-data/coral3.cddl +7 -0
- data/test-data/foo.cddl +1 -0
- data/test-data/jim-cut-2.cddl +11 -0
- data/test-data/jim-cut.cddl +12 -0
- data/test-data/jsoniodef.cddl +719 -0
- data/test-data/mdl-ble.cddl +9 -0
- data/test-data/mdl-deve.cddl +54 -0
- data/test-data/mdl-dp.cddl +11 -0
- data/test-data/mdl-mso.cddl +20 -0
- data/test-data/mdl-request.cddl +26 -0
- data/test-data/mdl-response.cddl +66 -0
- data/test-data/mdl.cddl +11 -0
- data/test-data/mon-val.cddl +1 -0
- data/test-data/multipart-ct.cddl +2 -0
- data/test-data/named-group.cddl +7 -0
- metadata +26 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
BLEIdentification = {
|
|
2
|
+
? 0 : bool,
|
|
3
|
+
? 1 : bool,
|
|
4
|
+
? 10 : bstr,
|
|
5
|
+
; Indicates support for Peripheral server mode
|
|
6
|
+
; Indicates support for Central client mode
|
|
7
|
+
; Optional UUID for peripheral server mode
|
|
8
|
+
? 11 : bstr ; Optional MAC address for peripheral server mode
|
|
9
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
deviceEngagement = [
|
|
2
|
+
uint,
|
|
3
|
+
security,
|
|
4
|
+
transferMethods,
|
|
5
|
+
options,
|
|
6
|
+
? proprietary
|
|
7
|
+
]
|
|
8
|
+
security = [
|
|
9
|
+
bstr,
|
|
10
|
+
uint, uint
|
|
11
|
+
]
|
|
12
|
+
transferMethods = [
|
|
13
|
+
* transferMethod
|
|
14
|
+
]
|
|
15
|
+
options = {
|
|
16
|
+
?"WebAPI" : WebAPI,
|
|
17
|
+
?"OIDC" : OIDC,
|
|
18
|
+
?"compact" : bool
|
|
19
|
+
}
|
|
20
|
+
proprietary = {
|
|
21
|
+
* tstr => any
|
|
22
|
+
}
|
|
23
|
+
transferMethod = [
|
|
24
|
+
uint,
|
|
25
|
+
uint, * any
|
|
26
|
+
]
|
|
27
|
+
OIDC = [
|
|
28
|
+
uint,
|
|
29
|
+
tstr,
|
|
30
|
+
tstr
|
|
31
|
+
]
|
|
32
|
+
WebAPI = [
|
|
33
|
+
uint,
|
|
34
|
+
tstr, tstr
|
|
35
|
+
]
|
|
36
|
+
; Version of device engagement structure, currently 1
|
|
37
|
+
; Security structure
|
|
38
|
+
; Transfer methods
|
|
39
|
+
; Optional elements
|
|
40
|
+
; Proprietary elements
|
|
41
|
+
; mDL public ephemeral key, mDL.EPub
|
|
42
|
+
; curve identifier, see Table 23
|
|
43
|
+
; cipher suite identifier, see Table 22
|
|
44
|
+
; details for transfer methods
|
|
45
|
+
; any number of elements
|
|
46
|
+
; type
|
|
47
|
+
; version
|
|
48
|
+
; specific option(s) to the type
|
|
49
|
+
; version
|
|
50
|
+
; url
|
|
51
|
+
; token
|
|
52
|
+
; version
|
|
53
|
+
; url
|
|
54
|
+
; token
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MobileSecurityObject = {
|
|
2
|
+
"DigestAlgorithm" : tstr,
|
|
3
|
+
"ValueDigests" : ValueDigests,
|
|
4
|
+
"DeviceKey" : COSE_Key,
|
|
5
|
+
"DocType" : tstr
|
|
6
|
+
}
|
|
7
|
+
ValueDigests = {
|
|
8
|
+
"NameSpaces" : NameSpaces
|
|
9
|
+
}
|
|
10
|
+
NameSpaces = {
|
|
11
|
+
+ NameSpace => DigestIDs
|
|
12
|
+
}
|
|
13
|
+
DigestIDs = {
|
|
14
|
+
+ DigestID => Digest
|
|
15
|
+
}
|
|
16
|
+
NameSpace = tstr
|
|
17
|
+
DigestID = uint
|
|
18
|
+
Digest = bstr
|
|
19
|
+
|
|
20
|
+
COSE_Key = "COSE_Key"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Request = {
|
|
2
|
+
"Version" : tstr,
|
|
3
|
+
"DocRequests" : [+ DocRequest]
|
|
4
|
+
}
|
|
5
|
+
DocRequest = {
|
|
6
|
+
"ItemsRequest" : ItemsRequest,
|
|
7
|
+
? "ReaderAuth" : COSE_Sign1
|
|
8
|
+
}
|
|
9
|
+
ItemsRequest = {
|
|
10
|
+
? "DocType" : DocType,
|
|
11
|
+
"NameSpaces" : NameSpaces,
|
|
12
|
+
? "RequestInfo" : {* tstr => any}
|
|
13
|
+
}
|
|
14
|
+
NameSpaces = {
|
|
15
|
+
+ NameSpace => DataItemNames
|
|
16
|
+
}
|
|
17
|
+
DocType = tstr
|
|
18
|
+
NameSpace = tstr
|
|
19
|
+
DataItemNames = [ + tstr ]
|
|
20
|
+
; Additional info the reader wants to provide
|
|
21
|
+
; Requested data elements for each NameSpace
|
|
22
|
+
; See 7.3.2
|
|
23
|
+
; See 7.3.3
|
|
24
|
+
; See Table 2
|
|
25
|
+
|
|
26
|
+
COSE_Sign1 = "COSE_Sign1"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Response = {
|
|
2
|
+
"Version" : tstr,
|
|
3
|
+
? "Documents" : Documents,
|
|
4
|
+
? "Error" : int
|
|
5
|
+
}
|
|
6
|
+
Documents = {
|
|
7
|
+
+ DocType => ResponseData
|
|
8
|
+
}
|
|
9
|
+
; Version of the structure, currently 1.0
|
|
10
|
+
; Returned documents, may be absent if Error is present
|
|
11
|
+
; Error codes according to Table 8
|
|
12
|
+
ResponseData = {
|
|
13
|
+
"IssuerSigned" : IssuerSigned, ; Responded data elements signed by the issuer
|
|
14
|
+
"DeviceSigned" : DeviceSigned, ; Responded data elements signed by the mDL
|
|
15
|
+
"Errors" : Errors
|
|
16
|
+
}
|
|
17
|
+
IssuerSigned = {
|
|
18
|
+
"NameSpaces" : IssuerNameSpaces,
|
|
19
|
+
"IssuerAuth" : COSE_Sign1 ; The payload is the MobileSecurityObject, see 9.2.1.4
|
|
20
|
+
}
|
|
21
|
+
IssuerNameSpaces = {
|
|
22
|
+
+ NameSpace => [ + IssuerSignedItem ]
|
|
23
|
+
}
|
|
24
|
+
IssuerSignedItem = [
|
|
25
|
+
uint,
|
|
26
|
+
bstr,
|
|
27
|
+
tstr,
|
|
28
|
+
any
|
|
29
|
+
]
|
|
30
|
+
DeviceSigned = {
|
|
31
|
+
"NameSpaces" : DeviceNameSpaces, ; Currently only online token and URL are defined as DeviceSignedItems
|
|
32
|
+
"DeviceAuth" : DeviceAuth
|
|
33
|
+
}
|
|
34
|
+
DeviceNameSpaces = {
|
|
35
|
+
* NameSpace => DeviceSignedItems
|
|
36
|
+
}
|
|
37
|
+
DeviceSignedItems = {
|
|
38
|
+
+ DataItemName => DataItemValue
|
|
39
|
+
}
|
|
40
|
+
DeviceAuth = {
|
|
41
|
+
"Signature" : COSE_Sign1, //
|
|
42
|
+
; Use a nil value for the payload, the detached content is the DeviceAuthentication structure, see 9.2.2.4
|
|
43
|
+
"MAC" : COSE_Mac0
|
|
44
|
+
}
|
|
45
|
+
Errors = {
|
|
46
|
+
* NameSpace => [ + ErrorItem ]
|
|
47
|
+
}
|
|
48
|
+
ErrorItem = {
|
|
49
|
+
DataItemName => ErrorCode
|
|
50
|
+
}
|
|
51
|
+
DocType = tstr
|
|
52
|
+
NameSpace = tstr
|
|
53
|
+
DataItemName = tstr
|
|
54
|
+
DataItemValue = any
|
|
55
|
+
ErrorCode = int
|
|
56
|
+
; See table 9
|
|
57
|
+
; See 7.3.2
|
|
58
|
+
; See 7.3.3
|
|
59
|
+
; See Table 2
|
|
60
|
+
; See Table 2
|
|
61
|
+
; Error codes according to Table 9
|
|
62
|
+
; Structures used for DeviceAuth signature or MAC generation, see 9.2.2.4
|
|
63
|
+
; Structures used for MobileSecurityObject, see 9.2.1.4
|
|
64
|
+
|
|
65
|
+
COSE_Sign1 = "COSE_Sign1"
|
|
66
|
+
COSE_Mac0 = "COSE_Mac0"
|
data/test-data/mdl.cddl
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
decimal-monetary-value = text .regexp "-?[0-9]+(\\.[0-9]+)?"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cddl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Carsten Bormann
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-11-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cbor-diag
|
|
@@ -97,17 +97,27 @@ files:
|
|
|
97
97
|
- test-data/7071-concise-cut.cddl
|
|
98
98
|
- test-data/7071-concise.cddl
|
|
99
99
|
- test-data/7071-verbose.cddl
|
|
100
|
+
- test-data/7807.cddl
|
|
100
101
|
- test-data/a.cddl
|
|
102
|
+
- test-data/abignum.cddl
|
|
101
103
|
- test-data/ambig.cddl
|
|
102
104
|
- test-data/b.cddl
|
|
103
105
|
- test-data/badaddr.cddl
|
|
104
106
|
- test-data/basic_syntax_example.cddl
|
|
107
|
+
- test-data/bpv7.cddl
|
|
108
|
+
- test-data/bpv7a.cddl
|
|
109
|
+
- test-data/bpv7b.cddl
|
|
105
110
|
- test-data/cdni-ct.cddl
|
|
111
|
+
- test-data/coral.cddl
|
|
112
|
+
- test-data/coral1.cddl
|
|
113
|
+
- test-data/coral2.cddl
|
|
114
|
+
- test-data/coral3.cddl
|
|
106
115
|
- test-data/cose.cddl
|
|
107
116
|
- test-data/dcaf.cddl
|
|
108
117
|
- test-data/dcaf1.cddl
|
|
109
118
|
- test-data/dotsize.cddl
|
|
110
119
|
- test-data/extractor-demo.cddl
|
|
120
|
+
- test-data/foo.cddl
|
|
111
121
|
- test-data/grasp-01-extract.cddl
|
|
112
122
|
- test-data/grasp-01-test.cddl
|
|
113
123
|
- test-data/grasp-01.cddl
|
|
@@ -119,10 +129,23 @@ files:
|
|
|
119
129
|
- test-data/ifmap-metadata-2.2v9_fh-cabo.cddl
|
|
120
130
|
- test-data/ifmap2.cddl
|
|
121
131
|
- test-data/jcr-ex.cddl
|
|
132
|
+
- test-data/jim-cut-2.cddl
|
|
133
|
+
- test-data/jim-cut.cddl
|
|
134
|
+
- test-data/jsoniodef.cddl
|
|
122
135
|
- test-data/kevin5.cddl
|
|
123
136
|
- test-data/map-group.cddl
|
|
124
137
|
- test-data/mapkey.cddl
|
|
138
|
+
- test-data/mdl-ble.cddl
|
|
139
|
+
- test-data/mdl-deve.cddl
|
|
140
|
+
- test-data/mdl-dp.cddl
|
|
141
|
+
- test-data/mdl-mso.cddl
|
|
142
|
+
- test-data/mdl-request.cddl
|
|
143
|
+
- test-data/mdl-response.cddl
|
|
144
|
+
- test-data/mdl.cddl
|
|
125
145
|
- test-data/minimal.cddl
|
|
146
|
+
- test-data/mon-val.cddl
|
|
147
|
+
- test-data/multipart-ct.cddl
|
|
148
|
+
- test-data/named-group.cddl
|
|
126
149
|
- test-data/patch1.cddl
|
|
127
150
|
- test-data/reused_named_group.cddl
|
|
128
151
|
- test-data/structure.cddl
|
|
@@ -154,8 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
154
177
|
- !ruby/object:Gem::Version
|
|
155
178
|
version: '0'
|
|
156
179
|
requirements: []
|
|
157
|
-
|
|
158
|
-
rubygems_version: 2.7.6
|
|
180
|
+
rubygems_version: 3.0.6
|
|
159
181
|
signing_key:
|
|
160
182
|
specification_version: 4
|
|
161
183
|
summary: CDDL generator and validator.
|