A.4.  Signed Statements for Registration

   This appendix gives one Signed Statement for each way of registration
   in Section 3.7, both for V2-good.  Statement A carries the envelope
   bytes as its payload.  Statement B is made over the content root and
   uses, as one example of a profile, the COSE Hash Envelope of
   [RFC9995] with a detached payload; other profiles are possible.
   These Signed Statements were built from the specifications cited
   here, not with proofbundle.  The SCITT Receipts for A and B at the
   end of this appendix were generated for illustration with the library
   scitt-cose 0.5.0 [SCITT-COSE], and no Transparency Service issued
   them.

   The envelope bytes are the serialization under [RFC8785] of the
   V2-good envelope of Appendix A.3, 2562 bytes with SHA-256
   b318be374a156f8958ea02c13fe1f1db1659b4d9b0f8e0a96bbe4a5303d6d157.
   The test key issuer-1 of the Issuer is built like the keys of
   Appendix A.1 and given by its label, Ed25519 seed (hex) and public
   key (base64).  Its kid is the COSE Key Thumbprint of [RFC9679] with
   SHA-256 over the required parameters kty 1 (OKP), crv 6 (Ed25519) and
   x.

   issuer-1
   draft-gruszka-audit-decision-receipts test key issuer-1
   cce9d25f7abceebfb8d50ce46c19b948d354906ecdbe6b72d53973bed5614e30
   fS1sCQ+XTgtuMzxOnSRz0IMbzm+iFb6bVcB6lEMy8e8=
   kid
   f823e78e15df312ae66be2b2d4a8c035873f68d22abb1b2f52fcc6708cce62b0

   Both Signed Statements are COSE_Sign1 messages of [RFC9052] with tag
   18, an empty unprotected header and an EdDSA (-8) signature of
   [RFC9053] by issuer-1 over the Sig_structure of Section 4.4 of
   [RFC9052].  Their CBOR uses the core deterministic encoding of
   Section 4.2.1 of [RFC8949].  The protected headers carry the CWT
   Claims (label 15) of [RFC9597] with iss "https://issuer-1.example"
   and sub "decision:dec-0002", the subject name of V2-good.  They are
   shown below in diagnostic notation, with kid standing for the value
   above.

   A  {1: -8, 3: "application/json", 4: kid,
       15: {1: "https://issuer-1.example", 2: "decision:dec-0002"}}
   B  {1: -8, 4: kid,
       15: {1: "https://issuer-1.example", 2: "decision:dec-0002"},
       258: -16, 259: "application/vnd.in-toto+json"}

   In B, label 258 (payload_hash_alg) is -16 (SHA-256) and label 259
   (payload_preimage_content_type) is the payloadType of the envelope,
   whose decoded payload is the preimage.  B carries no content type
   (label 3), as Section 4 of [RFC9995] requires for a Hash Envelope.

   A is encoded as the bytes given below, followed by the envelope
   bytes, the two bytes 0x58 0x40 and the signature.  B has a detached
   payload, the content root R(V2-good) of Appendix A.3, and is given in
   full.

   A, 2740 bytes, SHA-256
   1949e5d5ce8c5182a30917600bd88b0fbd8efc4d38369d2639db31d8286c3826
   bytes before the payload, 112 bytes
   d2845868a4012703706170706c69636174696f6e2f6a736f6e045820f823e78e
   15df312ae66be2b2d4a8c035873f68d22abb1b2f52fcc6708cce62b00fa20178
   1868747470733a2f2f6973737565722d312e6578616d706c6502716465636973
   696f6e3a6465632d30303032a0590a02
   signature
   81133647b929c2890869b2ee704d150128fce37390103c7805bd24f0b4c07c0b
   198b0985f9115556dd517e068948209111265fd0a55649aee36a5ddfacb8f509

   B, 195 bytes, SHA-256
   2dbd5e796c0b36d2f8d86086021755b303bb0da19bb45a30da4f9f0c53c0c37d
   d284587ba50127045820f823e78e15df312ae66be2b2d4a8c035873f68d22abb
   1b2f52fcc6708cce62b00fa201781868747470733a2f2f6973737565722d312e
   6578616d706c6502716465636973696f6e3a6465632d303030321901022f1901
   03781c6170706c69636174696f6e2f766e642e696e2d746f746f2b6a736f6ea0
   f65840caec06ad5338ad0b9479190cd34c92eca213074ccfa02fcda1c5af70d8
   3342e3d93819b07b983e8771ebf8c201fe95cc30bdded5a8c6da658d494c3fb2
   4cb603

   A verifier that holds the issuer-1 key decodes each Signed Statement,
   checks that alg is EdDSA, that kid is the thumbprint of that key and
   that iss is as expected, and verifies the signature, for B over the
   detached payload.  Both pass.  Two counterexamples fail at the
   signature.  In the first, the byte at offset 12 of the envelope bytes
   in A, the first character "e" of the base64 payload, is replaced by
   "f".  In the second, B is checked with a detached payload whose first
   byte is 0x4a instead of 0x4b.  The binding of Section 3.7 then holds
   for V2-good.  The payload of A equals its envelope bytes, and the
   payload of B equals its content root and differs from R(V2-bad).
   These envelope bytes use the receipt type of Section 3.10.  The
   historical proofbundle result for the earlier receipt type does not
   establish acceptance of these rebuilt bytes; receipt verification of
   V2-good in this revision is exercised by the Go verifier of this
   package.

   For these Receipts, a local registration in the manner of Section 6.3
   of [RFC9943] first verified the Issuer signature of each Signed
   Statement, for B over the detached payload, and checked that its
   protected header carries kid and CWT Claims with iss and sub

   (Section 6 of [RFC9943]).  It accepted A and then B as the two
   entries of a Merkle Tree of [RFC9162], each entry being the bytes of
   the Signed Statement.  Neither [RFC9942] nor [RFC9943] defines what a
   Transparency Service takes as an entry; the bytes of the Signed
   Statement are the choice of this example, and other services enter,
   for example, a hash of them.  It rejected A with the changed byte, B
   with the changed detached payload, and a variant of A without sub.
   The Receipts are COSE_Sign1 messages of [RFC9942] with vds 1
   (RFC9162_SHA256), a detached payload, the root of that tree, and an
   EdDSA signature by the test key receipt-issuer-1, built like the keys
   of Appendix A.1.  Their CWT Claims carry the iss given below and the
   sub of the Signed Statement, and their kid is the COSE Key Thumbprint
   of the receipt-issuer-1 key.  Both Signed Statements have the same
   sub and both Receipts sign the same root, so the two Receipts share
   their protected header and signature and differ only in their
   inclusion proofs.  Their protected header keeps the label order in
   which scitt-cose writes it (395, 15, 4, 1), not the deterministic
   order of Section 4.2.1 of [RFC8949]; the signature covers the bytes
   as given.

   receipt-issuer-1
   draft-gruszka-audit-decision-receipts test key receipt-issuer-1
   b71a939bfbc162586fffa8b45a0d89d312e7102297906c3174fa6efab2b497fd
   WpbTJ2CMpw5ELCFLr7kLdAjpZInhGIUzQQ5lzCXs0po=
   kid
   4277c54764b34816bb1836860d570849105f452369e4e5c741f5891d9fb25040
   iss
   https://receipt-issuer-1.example

   root, tree size 2
   e58b1b273fcf3fe39303bb7a35ee3848d1fb9da800e7afbee6db89f8ee4bd2a9

   Receipt for A, leaf index 0, 216 bytes, SHA-256
   2bc2a575e0793199ddd244ba344cc8c7e16d147ebcc4922dcacd42d1d1cd9f44
   d2845862a419018b010fa201782068747470733a2f2f726563656970742d6973
   737565722d312e6578616d706c6502716465636973696f6e3a6465632d303030
   320458204277c54764b34816bb1836860d570849105f452369e4e5c741f5891d
   9fb250400127a119018ca120815826830200815820d4a7815865a719e4fc8505
   630e50545f0b4f553ed515aae339ccef5666a31f2ef65840a72c5f94076f4686
   c1de97a9e60e8ebe8f5608ffe1fcea393a86d40333e49efa01b3cb80790c446a
   ba99cc262bc190c55721782b66bc91bafb1ac92837c58008

   Receipt for B, leaf index 1, 216 bytes, SHA-256
   ee1570d0e0f83da846cdaf3040442910f6b671060f1d7ed820cf736b1e0b3ebb
   d2845862a419018b010fa201782068747470733a2f2f726563656970742d6973
   737565722d312e6578616d706c6502716465636973696f6e3a6465632d303030
   320458204277c54764b34816bb1836860d570849105f452369e4e5c741f5891d
   9fb250400127a119018ca1208158268302018158208bb515fb414c1997d9c32e
   67ab48427362c34d3928ac9cfbe3fd67e98101fd23f65840a72c5f94076f4686
   c1de97a9e60e8ebe8f5608ffe1fcea393a86d40333e49efa01b3cb80790c446a
   ba99cc262bc190c55721782b66bc91bafb1ac92837c58008

   A verifier computes the leaf hash, SHA-256 over the byte 0x00
   followed by the entry (Section 2.1.1 of [RFC9162]), applies the
   inclusion path of the Receipt to obtain the root (Section 2.1.3.2 of
   [RFC9162]), and verifies the signature over that root with the
   receipt-issuer-1 key (Section 5.2.1 of [RFC9942]).  Both Receipts
   pass.  Four counterexamples fail at the signature, namely A with the
   Receipt for B, B with the Receipt for A, the Receipt for A with one
   byte of its inclusion path changed, and the Receipt for A checked
   with the issuer-1 key instead of the receipt-issuer-1 key.
