Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Countersign #101

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ As time and the spec progresses, it is expected that we will start looking at ad

* CWT - Contains the examples from draft-ace-cwt

* countersign - Contains examples related to the original, deprecated CounterSignature from RFC8152.

* countersign1 - Contains examples related to the original, deprecated CounterSignature0 from RFC8152.

* countersign-v2 - Contains examples related to CounterSignatureV2 and CounterSignature0V2 defined in draft-ietf-cose-countersign. These examples use the following proposed code points: CounterSignatureV2 (11) and CounterSignature0V2 (12). The examples will be updated if IANA assigns different values.

# Random number generation

Expand Down
64 changes: 64 additions & 0 deletions countersign-v2/encrypt-01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"title":"Encrypt-01 - Encrypt0 w/ one countersignature",
"input":{
"plaintext":"This is the content.",
"encrypted":{
"protected":{
"alg":"A128GCM"
},
"recipients":[
{
"key":{
"kty":"oct",
"kid":"our-secret",
"use":"enc",
"k":"hJtXIZ2uSN5kbQfbtTNWbg"
},
"unprotected":{
"alg":"direct",
"kid":"our-secret"
}
}
],
"countersign":{
"signers":[
{
"key":{
"kty":"OKP",
"kid":"11",
"crv":"Ed25519",
"x_hex":"d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a",
"d_hex":"9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60"
},
"unprotected":{
"kid":"11"
},
"protected":{
"alg":"EdDSA"
}
}
]
}
},
"rng_stream":[
"02D1F7E6F26C43D4868D87CE"
]
},
"intermediates":{
"AAD_hex":"8368456E63727970743043A1010140",
"CEK_hex":"849B57219DAE48DE646D07DBB533566E",
"recipients":[
{
}
],
"countersigners":[
{
"ToBeSign_hex":"8570436F756E7465725369676E617475726543A1010143A1012740582460973A94BB2898009EE52ECFD9AB1DD25867374B162E2C03568B41F57C3CC16F9166250A"
}
]
},
"output":{
"cbor_diag":"16([h'A10101', {5: h'02D1F7E6F26C43D4868D87CE', 11: [h'A10127', {4: h'3131'}, h'E10439154CC75C7A3A5391491F88651E0292FD0FE0E02CF740547EAF6677B4A4040B8ECA16DB592881262F77B14C1A086C02268B17171CA16BE4B8595F8C0A08']}, h'60973A94BB2898009EE52ECFD9AB1DD25867374B162E2C03568B41F57C3CC16F9166250A'])",
"cbor":"D08343A10101A2054C02D1F7E6F26C43D4868D87CE0B8343A10127A1044231315840E10439154CC75C7A3A5391491F88651E0292FD0FE0E02CF740547EAF6677B4A4040B8ECA16DB592881262F77B14C1A086C02268B17171CA16BE4B8595F8C0A08582460973A94BB2898009EE52ECFD9AB1DD25867374B162E2C03568B41F57C3CC16F9166250A"
}
}
49 changes: 49 additions & 0 deletions countersign-v2/encrypt-02.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"title":"Encrypt-02 - Encrypt0 w/ one abbreviated countersignature",
"input":{
"plaintext":"This is the content.",
"encrypted":{
"protected":{
"alg":"A128GCM"
},
"recipients":[
{
"key":{
"kty":"oct",
"kid":"our-secret",
"use":"enc",
"k":"hJtXIZ2uSN5kbQfbtTNWbg"
},
"unprotected":{
"alg":"direct",
"kid":"our-secret"
}
}
],
"countersign":{
"signers":[
{
"key":{
"kty":"OKP",
"kid":"11",
"crv":"Ed25519",
"x_hex":"d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a",
"d_hex":"9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60"
}
}
]
}
}
},
"intermediates":{
"countersigners":[
{
"ToBeSign_hex":"8471436F756E7465725369676E61747572653043A1010140582460973A94BB2898009EE52ECFD9AB1DD25867374B162E2C03568B41F57C3CC16F9166250A"
}
]
},
"output":{
"cbor_diag":"16([h'A10101', {5: h'02D1F7E6F26C43D4868D87CE', 12: h'EC5F5ABAE69A2FB6C373F31D95280533B775A9BE5B72E526558FF64C825B0A7E112BB2B691D1ADF912F9C1E46D3DAC5B22C4F70272AECB6090A8EAA086441B03'}, h'60973A94BB2898009EE52ECFD9AB1DD25867374B162E2C03568B41F57C3CC16F9166250A'])",
"cbor":"D08343A10101A2054C02D1F7E6F26C43D4868D87CE0C5840EC5F5ABAE69A2FB6C373F31D95280533B775A9BE5B72E526558FF64C825B0A7E112BB2B691D1ADF912F9C1E46D3DAC5B22C4F70272AECB6090A8EAA086441B03582460973A94BB2898009EE52ECFD9AB1DD25867374B162E2C03568B41F57C3CC16F9166250A"
}
}
60 changes: 60 additions & 0 deletions countersign-v2/enveloped-01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"title":"enveloped-01: Enveloped w/ one countersignature v2 ",
"input":{
"plaintext":"This is the content.",
"enveloped":{
"protected":{
"alg":"A128GCM"
},
"recipients":[
{
"protected":{
"alg":"ECDH-ES+HKDF-256"
},
"kid":"[email protected]"
}
],
"countersign":{
"signers":[
{
"key":{
"kty":"EC2",
"kid":"[email protected]",
"crv":"P-521",
"x_hex":"0072992cb3ac08ecf3e5c63dedec0d51a8c1f79ef2f82f94f3c737bf5de7986671eac625fe8257bbd0394644caaa3aaf8f27a4585fbbcad0f2457620085e5c8f42ad",
"y_hex":"01dca6947bce88bc5790485ac97427342bc35f887d86d65a089377e247e60baa55e4e8501e2ada5724ac51d6909008033ebc10ac999b9d7f5cc2519f3fe1ea1d9475",
"d_hex":"00085138ddabf5ca975f5860f91a08e91d6d5f9a76ad4018766a476680b55cd339e8ab6c72b5facdb2a2a50ac25bd086647dd3e2e6e99e84ca2c3609fdf177feb26d"
},
"unprotected":{
"kid":"[email protected]"
},
"protected":{
"alg":"ES512"
}
}
]
}
}
},
"intermediates":{
"recipients":[
{
"ephemeral":{
"kty":2,
"crv":1,
"x_hex":"98f50a4ff6c05861c8860d13a638ea56c3f5ad7590bbfbf054e1c7b4d91d6280",
"y_hex":true
}
}
],
"countersigners":[
{
"ToBeSign_hex":"8570436F756E7465725369676E617475726543A1010144A10138234058247ADBE2709CA818FB415F1E5DF66F4E1A51053BA6D65A1A0C52A357DA7A644B8070A151B0"
}
]
},
"output":{
"cbor_diag":"96([h'A10101', {5: h'C9CF4DF2FE6C632BF7886413', 11: [h'A1013823', {4: h'62696C626F2E62616767696E7340686F626269746F6E2E6578616D706C65'}, h'00929663C8789BB28177AE28467E66377DA12302D7F9594D2999AFA5DFA531294F8896F2B6CDF1740014F4C7F1A358E3A6CF57F4ED6FB02FCF8F7AA989F5DFD07F0700A3A7D8F3C604BA70FA9411BD10C2591B483E1D2C31DE003183E434D8FBA18F17A4C7E3DFA003AC1CF3D30D44D2533C4989D3AC38C38B71481CC3430C9D65E7DDFF']}, h'7ADBE2709CA818FB415F1E5DF66F4E1A51053BA6D65A1A0C52A357DA7A644B8070A151B0', [[h'A1013818', {-1: {1: 2, -1: 1, -2: h'98F50A4FF6C05861C8860D13A638EA56C3F5AD7590BBFBF054E1C7B4D91D6280', -3: true}, 4: h'6D65726961646F632E6272616E64796275636B406275636B6C616E642E6578616D706C65'}, h'']]])",
"cbor":"D8608443A10101A2054CC9CF4DF2FE6C632BF78864130B8344A1013823A104581E62696C626F2E62616767696E7340686F626269746F6E2E6578616D706C65588400929663C8789BB28177AE28467E66377DA12302D7F9594D2999AFA5DFA531294F8896F2B6CDF1740014F4C7F1A358E3A6CF57F4ED6FB02FCF8F7AA989F5DFD07F0700A3A7D8F3C604BA70FA9411BD10C2591B483E1D2C31DE003183E434D8FBA18F17A4C7E3DFA003AC1CF3D30D44D2533C4989D3AC38C38B71481CC3430C9D65E7DDFF58247ADBE2709CA818FB415F1E5DF66F4E1A51053BA6D65A1A0C52A357DA7A644B8070A151B0818344A1013818A220A40102200121582098F50A4FF6C05861C8860D13A638EA56C3F5AD7590BBFBF054E1C7B4D91D628022F50458246D65726961646F632E6272616E64796275636B406275636B6C616E642E6578616D706C6540"
}
}
54 changes: 54 additions & 0 deletions countersign-v2/enveloped-02.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"title":"enveloped-02: Enveloped w/ one abbreviated countersignature v2",
"input":{
"plaintext":"This is the content.",
"enveloped":{
"protected":{
"alg":"A128GCM"
},
"recipients":[
{
"protected":{
"alg":"ECDH-ES+HKDF-256"
},
"kid":"[email protected]"
}
],
"countersign":{
"signers":[
{
"key":{
"kty":"EC2",
"kid":"[email protected]",
"crv":"P-521",
"x_hex":"0072992cb3ac08ecf3e5c63dedec0d51a8c1f79ef2f82f94f3c737bf5de7986671eac625fe8257bbd0394644caaa3aaf8f27a4585fbbcad0f2457620085e5c8f42ad",
"y_hex":"01dca6947bce88bc5790485ac97427342bc35f887d86d65a089377e247e60baa55e4e8501e2ada5724ac51d6909008033ebc10ac999b9d7f5cc2519f3fe1ea1d9475",
"d_hex":"00085138ddabf5ca975f5860f91a08e91d6d5f9a76ad4018766a476680b55cd339e8ab6c72b5facdb2a2a50ac25bd086647dd3e2e6e99e84ca2c3609fdf177feb26d"
}
}
]
}
}
},
"intermediates":{
"recipients":[
{
"ephemeral":{
"kty":2,
"crv":1,
"x_hex":"98f50a4ff6c05861c8860d13a638ea56c3f5ad7590bbfbf054e1c7b4d91d6280",
"y_hex":true
}
}
],
"countersigners":[
{
"ToBeSign_hex":"8471436F756E7465725369676E61747572653043A101014058247ADBE2709CA818FB415F1E5DF66F4E1A51053BA6D65A1A0C52A357DA7A644B8070A151B0"
}
]
},
"output":{
"cbor_diag":"96([h'A10101', {5: h'C9CF4DF2FE6C632BF7886413', 12: h'0070989BACE0D8EB36E20E4B5482ED13905CAC1BF49A3911F3CABFECFE928923989349F5C334C194B4D16535B0A660A2B67E2ADB78EC4B7784F4EF8FC5B785CF6BEB000A5602C7B8FDD73019E895CA945C8071EDAB2D41C2AA01E1E05D724ABB9BA388473D3D07FCFCD1FD3193D04DB277D5C9336A3BE2E9F73A56A25C06AF9290A6EEDC'}, h'7ADBE2709CA818FB415F1E5DF66F4E1A51053BA6D65A1A0C52A357DA7A644B8070A151B0', [[h'A1013818', {-1: {1: 2, -1: 1, -2: h'98F50A4FF6C05861C8860D13A638EA56C3F5AD7590BBFBF054E1C7B4D91D6280', -3: true}, 4: h'6D65726961646F632E6272616E64796275636B406275636B6C616E642E6578616D706C65'}, h'']]])",
"cbor":"D8608443A10101A2054CC9CF4DF2FE6C632BF78864130C58840070989BACE0D8EB36E20E4B5482ED13905CAC1BF49A3911F3CABFECFE928923989349F5C334C194B4D16535B0A660A2B67E2ADB78EC4B7784F4EF8FC5B785CF6BEB000A5602C7B8FDD73019E895CA945C8071EDAB2D41C2AA01E1E05D724ABB9BA388473D3D07FCFCD1FD3193D04DB277D5C9336A3BE2E9F73A56A25C06AF9290A6EEDC58247ADBE2709CA818FB415F1E5DF66F4E1A51053BA6D65A1A0C52A357DA7A644B8070A151B0818344A1013818A263657068A40102200121582098F50A4FF6C05861C8860D13A638EA56C3F5AD7590BBFBF054E1C7B4D91D628022F50458246D65726961646F632E6272616E64796275636B406275636B6C616E642E6578616D706C6540"
}
}
62 changes: 62 additions & 0 deletions countersign-v2/mac-01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"title":"MAC-01: MAC message w/ one counter signature version 2",
"input":{
"plaintext":"This is the content.",
"mac":{
"alg":"HS256",
"protected":{
"alg":"HS256"
},
"recipients":[
{
"unprotected":{
"alg":"direct",
"kid":"our-secret"
},
"key":{
"kty":"oct",
"kid":"our-secret",
"use":"enc",
"k":"hJtXIZ2uSN5kbQfbtTNWbpdmhkV8FJG-Onbc6mxCcYg"
}
}
],
"countersign":{
"signers":[
{
"key":{
"kty":"OKP",
"kid":"11",
"crv":"Ed25519",
"x_hex":"d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a",
"d_hex":"9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60"
},
"unprotected":{
"kid":"11"
},
"protected":{
"alg":"EdDSA"
}
}
]
}
}
},
"intermediates":{
"ToMac_hex":"84634D414343A101054054546869732069732074686520636F6E74656E742E",
"CEK_hex":"849B57219DAE48DE646D07DBB533566E976686457C1491BE3A76DCEA6C427188",
"recipients":[
{
}
],
"countersigners":[
{
"ToBeSign_hex":"8672436f756e7465725369676e6174757265563243a1010543a101274054546869732069732074686520636f6e74656e742e8158202bdcc89f058216b8a208ddc6d8b54aa91f48bd63484986565105c9ad5a6682f6"
}
]
},
"output":{
"cbor_diag":"97([h'A10105', {11: [h'A10127', {4: h'3131'}, h'602566F4A311DC860740D2DF54D4864555E85BC036EA5A6CF7905B96E499C5F66B01C4997F6A20C37C37543ADEA1D705347D38A5B13594B29583DD741F455101']}, h'546869732069732074686520636F6E74656E742E', h'2BDCC89F058216B8A208DDC6D8B54AA91F48BD63484986565105C9AD5A6682F6', [[h'', {1: -6, 4: h'6F75722D736563726574'}, h'']]])",
"cbor":"D8618543A10105A10B8343A10127A1046231315840602566F4A311DC860740D2DF54D4864555E85BC036EA5A6CF7905B96E499C5F66B01C4997F6A20C37C37543ADEA1D705347D38A5B13594B29583DD741F45510154546869732069732074686520636F6E74656E742E58202BDCC89F058216B8A208DDC6D8B54AA91F48BD63484986565105C9AD5A6682F6818340A20125044A6F75722D73656372657440"
}
}
56 changes: 56 additions & 0 deletions countersign-v2/mac-02.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"title":"MAC-02: MAC message w/ one abbreviated counter signature version 2",
"input":{
"plaintext":"This is the content.",
"mac":{
"alg":"HS256",
"protected":{
"alg":"HS256"
},
"recipients":[
{
"unprotected":{
"alg":"direct",
"kid":"our-secret"
},
"key":{
"kty":"oct",
"kid":"our-secret",
"use":"enc",
"k":"hJtXIZ2uSN5kbQfbtTNWbpdmhkV8FJG-Onbc6mxCcYg"
}
}
],
"countersign":{
"signers":[
{
"key":{
"kty":"OKP",
"kid":"11",
"crv":"Ed25519",
"x_hex":"d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a",
"d_hex":"9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60"
}
}
]
}
}
},
"intermediates":{
"ToMac_hex":"84634D414343A101054054546869732069732074686520636F6E74656E742E",
"CEK_hex":"849B57219DAE48DE646D07DBB533566E976686457C1491BE3A76DCEA6C427188",
"recipients":[
{
}
],
"countersigners":[
{
"ToBeSign_hex":"8573436f756e7465725369676e617475726530563243a101054054546869732069732074686520636f6e74656e742e8158202bdcc89f058216b8a208ddc6d8b54aa91f48bd63484986565105c9ad5a6682f6"
}
]
},
"output":{
"cbor_diag":"97([h'A10105', {12: h'563C6B31A0DFFFAA04DE0CD18A829003F11AE24E13B3BD740E6B2AC7EFEFF44847DA1BC7E6C77A2BC80FD0E7216118BE4BCD6A96321FAC2248C03ABE4B30C60D'}, h'546869732069732074686520636F6E74656E742E', h'2BDCC89F058216B8A208DDC6D8B54AA91F48BD63484986565105C9AD5A6682F6', [[h'', {1: -6, 4: h'6F75722D736563726574'}, h'']]])",
"cbor":"D8618543A10105A10C5840563C6B31A0DFFFAA04DE0CD18A829003F11AE24E13B3BD740E6B2AC7EFEFF44847DA1BC7E6C77A2BC80FD0E7216118BE4BCD6A96321FAC2248C03ABE4B30C60D54546869732069732074686520636F6E74656E742E58202BDCC89F058216B8A208DDC6D8B54AA91F48BD63484986565105C9AD5A6682F6818340A20125044A6F75722D73656372657440"
}
}
Loading