diff --git a/README.md b/README.md index 13b1e2f..d939d8c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/countersign-v2/encrypt-01.json b/countersign-v2/encrypt-01.json new file mode 100644 index 0000000..7cab00c --- /dev/null +++ b/countersign-v2/encrypt-01.json @@ -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" + } +} diff --git a/countersign-v2/encrypt-02.json b/countersign-v2/encrypt-02.json new file mode 100644 index 0000000..b2b222f --- /dev/null +++ b/countersign-v2/encrypt-02.json @@ -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" + } +} diff --git a/countersign-v2/enveloped-01.json b/countersign-v2/enveloped-01.json new file mode 100644 index 0000000..e646f16 --- /dev/null +++ b/countersign-v2/enveloped-01.json @@ -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":"meriadoc.brandybuck@buckland.example" + } + ], + "countersign":{ + "signers":[ + { + "key":{ + "kty":"EC2", + "kid":"bilbo.baggins@hobbiton.example", + "crv":"P-521", + "x_hex":"0072992cb3ac08ecf3e5c63dedec0d51a8c1f79ef2f82f94f3c737bf5de7986671eac625fe8257bbd0394644caaa3aaf8f27a4585fbbcad0f2457620085e5c8f42ad", + "y_hex":"01dca6947bce88bc5790485ac97427342bc35f887d86d65a089377e247e60baa55e4e8501e2ada5724ac51d6909008033ebc10ac999b9d7f5cc2519f3fe1ea1d9475", + "d_hex":"00085138ddabf5ca975f5860f91a08e91d6d5f9a76ad4018766a476680b55cd339e8ab6c72b5facdb2a2a50ac25bd086647dd3e2e6e99e84ca2c3609fdf177feb26d" + }, + "unprotected":{ + "kid":"bilbo.baggins@hobbiton.example" + }, + "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" + } +} diff --git a/countersign-v2/enveloped-02.json b/countersign-v2/enveloped-02.json new file mode 100644 index 0000000..ee7b43b --- /dev/null +++ b/countersign-v2/enveloped-02.json @@ -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":"meriadoc.brandybuck@buckland.example" + } + ], + "countersign":{ + "signers":[ + { + "key":{ + "kty":"EC2", + "kid":"bilbo.baggins@hobbiton.example", + "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" + } +} diff --git a/countersign-v2/mac-01.json b/countersign-v2/mac-01.json new file mode 100644 index 0000000..924cd17 --- /dev/null +++ b/countersign-v2/mac-01.json @@ -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" + } +} diff --git a/countersign-v2/mac-02.json b/countersign-v2/mac-02.json new file mode 100644 index 0000000..40b1bc4 --- /dev/null +++ b/countersign-v2/mac-02.json @@ -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" + } +} diff --git a/countersign-v2/mac0-01.json b/countersign-v2/mac0-01.json new file mode 100644 index 0000000..612ef54 --- /dev/null +++ b/countersign-v2/mac0-01.json @@ -0,0 +1,62 @@ +{ + "title":"MAC0-01: MAC0 message w/ one countersignature version 2", + "input":{ + "plaintext":"This is the content.", + "mac0":{ + "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":"84644D41433043A101054054546869732069732074686520636F6E74656E742E", + "CEK_hex":"849B57219DAE48DE646D07DBB533566E976686457C1491BE3A76DCEA6C427188", + "recipients":[ + { + } + ], + "countersigners":[ + { + "ToBeSign_hex":"8672436f756e7465725369676e6174757265563243a1010543a101274054546869732069732074686520636f6e74656e742e815820a1a848d3471f9d61ee49018d244c824772f223ad4f935293f1789fc3a08d8c58" + } + ] + }, + "output":{ + "cbor_diag":"17([h'A10105', {11: [h'A10127', {4: h'3131'}, h'968A315DF6B4F26362E11F4CFD2F2F4E76232F39657BF1598837FF9332CDDD7581E248116549451F81EF823DA5974F885B681D3D6E38FC4142D8F8E9E7DC8F0D']}, h'546869732069732074686520636F6E74656E742E', h'A1A848D3471F9D61EE49018D244C824772F223AD4F935293F1789FC3A08D8C58'])", + "cbor":"D18443A10105A10B8343A10127A1046231315840968A315DF6B4F26362E11F4CFD2F2F4E76232F39657BF1598837FF9332CDDD7581E248116549451F81EF823DA5974F885B681D3D6E38FC4142D8F8E9E7DC8F0D54546869732069732074686520636F6E74656E742E5820A1A848D3471F9D61EE49018D244C824772F223AD4F935293F1789FC3A08D8C58" + } +} diff --git a/countersign-v2/mac0-02.json b/countersign-v2/mac0-02.json new file mode 100644 index 0000000..4305666 --- /dev/null +++ b/countersign-v2/mac0-02.json @@ -0,0 +1,56 @@ +{ + "title":"MAC0-02: MAC0 message w/ one abbreviated countersignature version 2", + "input":{ + "plaintext":"This is the content.", + "mac0":{ + "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":"84644D41433043A101054054546869732069732074686520636F6E74656E742E", + "CEK_hex":"849B57219DAE48DE646D07DBB533566E976686457C1491BE3A76DCEA6C427188", + "recipients":[ + { + } + ], + "countersigners":[ + { + "ToBeSign_hex":"8573436f756e7465725369676e617475726530563243a101054054546869732069732074686520636f6e74656e742e815820a1a848d3471f9d61ee49018d244c824772f223ad4f935293f1789fc3a08d8c58" + } + ] + }, + "output":{ + "cbor_diag":"17([h'A10105', {12: h'CDD419F4D5DCEE999C16F30D3BFA07921D3E55B92E272D65DB07176EE4425CC255833A728C4FBA731ABF97192B4AD0F231E8397EF3024A56B9C5E9EAE3767E0A'}, h'546869732069732074686520636F6E74656E742E', h'A1A848D3471F9D61EE49018D244C824772F223AD4F935293F1789FC3A08D8C58'])", + "cbor":"D18443A10105A10C5840CDD419F4D5DCEE999C16F30D3BFA07921D3E55B92E272D65DB07176EE4425CC255833A728C4FBA731ABF97192B4AD0F231E8397EF3024A56B9C5E9EAE3767E0A54546869732069732074686520636F6E74656E742E5820A1A848D3471F9D61EE49018D244C824772F223AD4F935293F1789FC3A08D8C58" + } +} diff --git a/countersign-v2/signed-01.json b/countersign-v2/signed-01.json new file mode 100644 index 0000000..0a0fe7c --- /dev/null +++ b/countersign-v2/signed-01.json @@ -0,0 +1,65 @@ +{ + "title":"signed-01: Signed message w/ one counter signature v2 on recipient", + "input":{ + "plaintext":"This is the content.", + "sign":{ + "protected":{ + "ctyp":0 + }, + "signers":[ + { + "key":{ + "kty":"EC2", + "kid":"11", + "crv":"P-256", + "x_hex":"bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff", + "y_hex":"20138bf82dc1b6d562be0fa54ab7804a3a64b6d72ccfed6b6fb6ed28bbfc117e", + "d_hex":"57c92077664146e876760c9520d054aa93c3afb04e306705db6090308507b4d3" + }, + "unprotected":{ + "kid":"11" + }, + "protected":{ + "alg":"ES256" + }, + "countersign":{ + "signers":[ + { + "key":{ + "kty":"EC2", + "kid":"11", + "crv":"P-256", + "x_hex":"bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff", + "y_hex":"20138bf82dc1b6d562be0fa54ab7804a3a64b6d72ccfed6b6fb6ed28bbfc117e", + "d_hex":"57c92077664146e876760c9520d054aa93c3afb04e306705db6090308507b4d3" + }, + "unprotected":{ + "kid":"11" + }, + "protected":{ + "alg":"ES256" + } + } + ] + } + } + ] + } + }, + "intermediates":{ + "signers":[ + { + "ToBeSign_hex":"85695369676E61747572654043A101264054546869732069732074686520636F6E74656E742E", + "countersigners":[ + { + "ToBeSign_hex":"8570436F756E7465725369676E61747572654043A101264054546869732069732074686520636F6E74656E742E" + } + ] + } + ] + }, + "output":{ + "cbor_diag":"98([h'', {11: [h'A10126', {4: h'3131'}, h'5AC05E289D5D0E1B0A7F048A5D2B643813DED50BC9E49220F4F7278F85F19D4A77D655C9D3B51E805A74B099E1E085AACD97FC29D72F887E8802BB6650CCEB2C']}, h'546869732069732074686520636F6E74656E742E', [[h'A10126', {4: h'3131'}, h'E2AEAFD40D69D19DFE6E52077C5D7FF4E408282CBEFB5D06CBF414AF2E19D982AC45AC98B8544C908B4507DE1E90B717C3D34816FE926A2B98F53AFD2FA0F30A']]])", + "cbor":"D8628440A10B8343A10126A10442313158405AC05E289D5D0E1B0A7F048A5D2B643813DED50BC9E49220F4F7278F85F19D4A77D655C9D3B51E805A74B099E1E085AACD97FC29D72F887E8802BB6650CCEB2C54546869732069732074686520636F6E74656E742E818343A10126A1044231315840E2AEAFD40D69D19DFE6E52077C5D7FF4E408282CBEFB5D06CBF414AF2E19D982AC45AC98B8544C908B4507DE1E90B717C3D34816FE926A2B98F53AFD2FA0F30A" + } +} diff --git a/countersign-v2/signed-02.json b/countersign-v2/signed-02.json new file mode 100644 index 0000000..08806a6 --- /dev/null +++ b/countersign-v2/signed-02.json @@ -0,0 +1,59 @@ +{ + "title":"signed-02: Signed message w/ one abbreviated counter signature v2 on recipient", + "input":{ + "plaintext":"This is the content.", + "sign":{ + "protected":{ + "ctyp":0 + }, + "signers":[ + { + "key":{ + "kty":"EC2", + "kid":"11", + "crv":"P-256", + "x_hex":"bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff", + "y_hex":"20138bf82dc1b6d562be0fa54ab7804a3a64b6d72ccfed6b6fb6ed28bbfc117e", + "d_hex":"57c92077664146e876760c9520d054aa93c3afb04e306705db6090308507b4d3" + }, + "unprotected":{ + "kid":"11" + }, + "protected":{ + "alg":"ES256" + }, + "countersign":{ + "signers":[ + { + "key":{ + "kty":"EC2", + "kid":"11", + "crv":"P-256", + "x_hex":"bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff", + "y_hex":"20138bf82dc1b6d562be0fa54ab7804a3a64b6d72ccfed6b6fb6ed28bbfc117e", + "d_hex":"57c92077664146e876760c9520d054aa93c3afb04e306705db6090308507b4d3" + } + } + ] + } + } + ] + } + }, + "intermediates":{ + "signers":[ + { + "ToBeSign_hex":"85695369676E61747572654043A101264054546869732069732074686520636F6E74656E742E", + "countersigners":[ + { + "ToBeSign_hex":"8471436F756E7465725369676E617475726530404054546869732069732074686520636F6E74656E742E" + } + ] + } + ] + }, + "output":{ + "cbor_diag":"98([h'', {12: h'A51F7694753F2FBCC38968693CDA0A6D8083966AEDF1A675EAAACAEADA9FB3EF5742850018A1C2CEFA2109143E31A6686770D15770072A14FD0ADBF155F34AB1'}, h'546869732069732074686520636F6E74656E742E', [[h'A10126', {4: h'3131'}, h'E2AEAFD40D69D19DFE6E52077C5D7FF4E408282CBEFB5D06CBF414AF2E19D982AC45AC98B8544C908B4507DE1E90B717C3D34816FE926A2B98F53AFD2FA0F30A']]])", + "cbor":"D8628440A10C5840A51F7694753F2FBCC38968693CDA0A6D8083966AEDF1A675EAAACAEADA9FB3EF5742850018A1C2CEFA2109143E31A6686770D15770072A14FD0ADBF155F34AB154546869732069732074686520636F6E74656E742E818343A10126A1044231315840E2AEAFD40D69D19DFE6E52077C5D7FF4E408282CBEFB5D06CBF414AF2E19D982AC45AC98B8544C908B4507DE1E90B717C3D34816FE926A2B98F53AFD2FA0F30A" + } +} diff --git a/countersign-v2/signed1-01.json b/countersign-v2/signed1-01.json new file mode 100644 index 0000000..e70ff61 --- /dev/null +++ b/countersign-v2/signed1-01.json @@ -0,0 +1,56 @@ +{ + "title":"signed1-01: Sign 1 structure w/ one counter signature version 2", + "input":{ + "plaintext":"This is the content.", + "sign0":{ + "key":{ + "kty":"EC2", + "kid":"11", + "crv":"P-256", + "x_hex":"bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff", + "y_hex":"20138bf82dc1b6d562be0fa54ab7804a3a64b6d72ccfed6b6fb6ed28bbfc117e", + "d_hex":"57c92077664146e876760c9520d054aa93c3afb04e306705db6090308507b4d3" + }, + "unprotected":{ + "kid":"11" + }, + "protected":{ + "alg":"ES256", + "ctyp":0 + }, + "alg":"ES256", + "countersign":{ + "signers":[ + { + "key":{ + "kty":"EC2", + "kid":"bilbo.baggins@hobbiton.example", + "crv":"P-521", + "x_hex":"0072992cb3ac08ecf3e5c63dedec0d51a8c1f79ef2f82f94f3c737bf5de7986671eac625fe8257bbd0394644caaa3aaf8f27a4585fbbcad0f2457620085e5c8f42ad", + "y_hex":"01dca6947bce88bc5790485ac97427342bc35f887d86d65a089377e247e60baa55e4e8501e2ada5724ac51d6909008033ebc10ac999b9d7f5cc2519f3fe1ea1d9475", + "d_hex":"00085138ddabf5ca975f5860f91a08e91d6d5f9a76ad4018766a476680b55cd339e8ab6c72b5facdb2a2a50ac25bd086647dd3e2e6e99e84ca2c3609fdf177feb26d" + }, + "unprotected":{ + "kid":"bilbo.baggins@hobbiton.example" + }, + "protected":{ + "alg":"ES512" + } + } + ] + } + } + }, + "intermediates":{ + "ToBeSign_hex":"846A5369676E61747572653145A2012603004054546869732069732074686520636F6E74656E742E", + "countersigners":[ + { + "ToBeSign_hex":"8672436f756e7465725369676e6174757265563245a20126030044a10138234054546869732069732074686520636f6e74656e742e815840bb587d6b15f47bfd54d2cbfcecef75451e92b08a514bd439fa3aa65c6ac92df0d7328c4a47529b32add3dd1b4e940071c021e9a8f2641f1d8e3b053ddd65ae52" + } + ] + }, + "output":{ + "cbor_diag":"18([h'A201260300', {4: h'3131', 11: [h'A1013823', {4: h'62696C626F2E62616767696E7340686F626269746F6E2E6578616D706C65'}, h'01B1291B0E60A79C459A4A9184A0D393E034B34AF069A1CCA34F5A913AFFFF698002295FA9F8FCBFB6FDFF59132FC0C406E98754A98F1FBFE81C03095F481856BC470170227206FA5BEE3C0431C56A66824E7AAF692985952E31271434B2BA2E47A335C658B5E995AEB5D63CF2D0CED367D3E4CC8FFFD53B70D115BAA9E86961FBD1A5CF']}, h'546869732069732074686520636F6E74656E742E', h'BB587D6B15F47BFD54D2CBFCECEF75451E92B08A514BD439FA3AA65C6AC92DF0D7328C4A47529B32ADD3DD1B4E940071C021E9A8F2641F1D8E3B053DDD65AE52'])", + "cbor":"D28445A201260300A2046231310B8344A1013823A104781E62696C626F2E62616767696E7340686F626269746F6E2E6578616D706C65588401B1291B0E60A79C459A4A9184A0D393E034B34AF069A1CCA34F5A913AFFFF698002295FA9F8FCBFB6FDFF59132FC0C406E98754A98F1FBFE81C03095F481856BC470170227206FA5BEE3C0431C56A66824E7AAF692985952E31271434B2BA2E47A335C658B5E995AEB5D63CF2D0CED367D3E4CC8FFFD53B70D115BAA9E86961FBD1A5CF54546869732069732074686520636F6E74656E742E5840BB587D6B15F47BFD54D2CBFCECEF75451E92B08A514BD439FA3AA65C6AC92DF0D7328C4A47529B32ADD3DD1B4E940071C021E9A8F2641F1D8E3B053DDD65AE52" + } +} diff --git a/countersign-v2/signed1-02.json b/countersign-v2/signed1-02.json new file mode 100644 index 0000000..f3600c4 --- /dev/null +++ b/countersign-v2/signed1-02.json @@ -0,0 +1,50 @@ +{ + "title":"signed1-02: Sign 1 structure w/ abbreviated counter signature version 2", + "input":{ + "plaintext":"This is the content.", + "sign0":{ + "key":{ + "kty":"EC2", + "kid":"11", + "crv":"P-256", + "x_hex":"bac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff", + "y_hex":"20138bf82dc1b6d562be0fa54ab7804a3a64b6d72ccfed6b6fb6ed28bbfc117e", + "d_hex":"57c92077664146e876760c9520d054aa93c3afb04e306705db6090308507b4d3" + }, + "unprotected":{ + "kid":"11" + }, + "protected":{ + "alg":"ES256", + "ctyp":0 + }, + "alg":"ES256", + "countersign":{ + "signers":[ + { + "key":{ + "kty":"EC2", + "kid":"bilbo.baggins@hobbiton.example", + "crv":"P-521", + "x_hex":"0072992cb3ac08ecf3e5c63dedec0d51a8c1f79ef2f82f94f3c737bf5de7986671eac625fe8257bbd0394644caaa3aaf8f27a4585fbbcad0f2457620085e5c8f42ad", + "y_hex":"01dca6947bce88bc5790485ac97427342bc35f887d86d65a089377e247e60baa55e4e8501e2ada5724ac51d6909008033ebc10ac999b9d7f5cc2519f3fe1ea1d9475", + "d_hex":"00085138ddabf5ca975f5860f91a08e91d6d5f9a76ad4018766a476680b55cd339e8ab6c72b5facdb2a2a50ac25bd086647dd3e2e6e99e84ca2c3609fdf177feb26d" + } + } + ] + } + } + }, + "intermediates":{ + "ToBeSign_hex":"846A5369676E61747572653145A2012603004054546869732069732074686520636F6E74656E742E", + "countersigners":[ + { + "ToBeSign_hex":"8573436f756e7465725369676e617475726530563245a2012603004054546869732069732074686520636f6e74656e742e815840bb587d6b15f47bfd54d2cbfcecef75451e92b08a514bd439fa3aa65c6ac92df0d7328c4a47529b32add3dd1b4e940071c021e9a8f2641f1d8e3b053ddd65ae52" + } + ] + }, + "output":{ + "cbor_diag":"18([h'A201260300', {4: h'3131', 12: h'002E7CF9ACA6A181F27C8E8587975647A105CCDDB4B8B8D38282975969BFC071DA08E50374717DF688F7E48B40F9E7E7E8492F008EED621E2B5580318557CACD31F500F6A8BF04FB633955EBDA4EB7523742F48684FE0D089940E64777D93EB61DE27E9AB5EFBD3EEA96303ADF7082804BBF68C30CEBCBDA655A981C7FACC332DBC2F129'}, h'546869732069732074686520636F6E74656E742E', h'BB587D6B15F47BFD54D2CBFCECEF75451E92B08A514BD439FA3AA65C6AC92DF0D7328C4A47529B32ADD3DD1B4E940071C021E9A8F2641F1D8E3B053DDD65AE52'])", + "cbor":"D28445A201260300A2046231310C5884002E7CF9ACA6A181F27C8E8587975647A105CCDDB4B8B8D38282975969BFC071DA08E50374717DF688F7E48B40F9E7E7E8492F008EED621E2B5580318557CACD31F500F6A8BF04FB633955EBDA4EB7523742F48684FE0D089940E64777D93EB61DE27E9AB5EFBD3EEA96303ADF7082804BBF68C30CEBCBDA655A981C7FACC332DBC2F12954546869732069732074686520636F6E74656E742E5840BB587D6B15F47BFD54D2CBFCECEF75451E92B08A514BD439FA3AA65C6AC92DF0D7328C4A47529B32ADD3DD1B4E940071C021E9A8F2641F1D8E3B053DDD65AE52" + } +}