cddl 0.8.8 → 0.8.15
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/bin/cddl +10 -2
- data/cddl.gemspec +2 -1
- data/data/cddl.abnf +1 -0
- data/lib/cddl.rb +132 -17
- 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/feat1.cddl +4 -0
- data/test-data/feature-detail.cddl +5 -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
- data/test-data/sequence.cddl +1 -0
- data/test-data/test-gen.cddl +3 -0
- metadata +33 -7
|
@@ -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]+)?"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a = [tstr, tstr, tstr]
|
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.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Carsten Bormann
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-11-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cbor-diag
|
|
@@ -97,17 +97,29 @@ 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/feat1.cddl
|
|
121
|
+
- test-data/feature-detail.cddl
|
|
122
|
+
- test-data/foo.cddl
|
|
111
123
|
- test-data/grasp-01-extract.cddl
|
|
112
124
|
- test-data/grasp-01-test.cddl
|
|
113
125
|
- test-data/grasp-01.cddl
|
|
@@ -119,13 +131,28 @@ files:
|
|
|
119
131
|
- test-data/ifmap-metadata-2.2v9_fh-cabo.cddl
|
|
120
132
|
- test-data/ifmap2.cddl
|
|
121
133
|
- test-data/jcr-ex.cddl
|
|
134
|
+
- test-data/jim-cut-2.cddl
|
|
135
|
+
- test-data/jim-cut.cddl
|
|
136
|
+
- test-data/jsoniodef.cddl
|
|
122
137
|
- test-data/kevin5.cddl
|
|
123
138
|
- test-data/map-group.cddl
|
|
124
139
|
- test-data/mapkey.cddl
|
|
140
|
+
- test-data/mdl-ble.cddl
|
|
141
|
+
- test-data/mdl-deve.cddl
|
|
142
|
+
- test-data/mdl-dp.cddl
|
|
143
|
+
- test-data/mdl-mso.cddl
|
|
144
|
+
- test-data/mdl-request.cddl
|
|
145
|
+
- test-data/mdl-response.cddl
|
|
146
|
+
- test-data/mdl.cddl
|
|
125
147
|
- test-data/minimal.cddl
|
|
148
|
+
- test-data/mon-val.cddl
|
|
149
|
+
- test-data/multipart-ct.cddl
|
|
150
|
+
- test-data/named-group.cddl
|
|
126
151
|
- test-data/patch1.cddl
|
|
127
152
|
- test-data/reused_named_group.cddl
|
|
153
|
+
- test-data/sequence.cddl
|
|
128
154
|
- test-data/structure.cddl
|
|
155
|
+
- test-data/test-gen.cddl
|
|
129
156
|
- test-data/toerless0.cddl
|
|
130
157
|
- test-data/toerless1.cddl
|
|
131
158
|
- test-data/two_anonymous_groups.cddl
|
|
@@ -139,7 +166,7 @@ homepage: http://github.com/cabo/cddl
|
|
|
139
166
|
licenses:
|
|
140
167
|
- MIT
|
|
141
168
|
metadata: {}
|
|
142
|
-
post_install_message:
|
|
169
|
+
post_install_message:
|
|
143
170
|
rdoc_options: []
|
|
144
171
|
require_paths:
|
|
145
172
|
- lib
|
|
@@ -154,9 +181,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
154
181
|
- !ruby/object:Gem::Version
|
|
155
182
|
version: '0'
|
|
156
183
|
requirements: []
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
signing_key:
|
|
184
|
+
rubygems_version: 3.1.2
|
|
185
|
+
signing_key:
|
|
160
186
|
specification_version: 4
|
|
161
187
|
summary: CDDL generator and validator.
|
|
162
188
|
test_files: []
|