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, 2570 bytes with SHA-256
   c6c88938d8ab02a6c11de3b8ee3392492182168547a2b7b25867f6ba35955314.
   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, 2748 bytes, SHA-256
   bd6a21dc91ba7364a6cb8be29a90283e631da29a470c55b99b27f30c4ae68e72
   bytes before the payload, 112 bytes
   d2845868a4012703706170706c69636174696f6e2f6a736f6e045820f823e78e
   15df312ae66be2b2d4a8c035873f68d22abb1b2f52fcc6708cce62b00fa20178
   1868747470733a2f2f6973737565722d312e6578616d706c6502716465636973
   696f6e3a6465632d30303032a0590a0a
   signature
   8a980438259cab842565781e4e181cb2764c7f905c1e99da11c4eb1e90b78e41
   4228657bb1c4981173f98e69c905ffac84cffd10e8b4de4643da6db120749f0c

   B, 195 bytes, SHA-256
   0ea957249b5a7828fc3e05ae6c4cbce69ebad1c22233ee08ce56947ff1de92fd
   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 0x44 instead of 0x45.  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
   637e0b483a8c284fd136a476b857c366d1fd828446d42ab48a153d9ac125781e

   Receipt for A, leaf index 0, 216 bytes, SHA-256
   6acae731f37c8b1c0d09662348e9d27f4bd5ce994df43d464d4b0da7ddf950ec
   d2845862a419018b010fa201782068747470733a2f2f726563656970742d6973
   737565722d312e6578616d706c6502716465636973696f6e3a6465632d303030
   320458204277c54764b34816bb1836860d570849105f452369e4e5c741f5891d
   9fb250400127a119018ca12081582683020081582031ba39cf4f938ef1418fe6
   97bfb11d14fdb3175e64d2a234664342dc8267bae0f658407b2e65e168e7dee2
   058a37e7c292738adf1728f12688d41d421b8526fdf8e22e5aa757c7bf363e22
   14ed0eba652b8ed5371eb808f157f17a89a8c29814241009

   Receipt for B, leaf index 1, 216 bytes, SHA-256
   0207d51ae2e60e0abc98d15a33344a51e3d975a699b8ba82aae144bcc30bf275
   d2845862a419018b010fa201782068747470733a2f2f726563656970742d6973
   737565722d312e6578616d706c6502716465636973696f6e3a6465632d303030
   320458204277c54764b34816bb1836860d570849105f452369e4e5c741f5891d
   9fb250400127a119018ca1208158268302018158200b9977b45f341a071d5df6
   f5cf3ce11aa38d680e3be5315a3024f5aa8f07379ff658407b2e65e168e7dee2
   058a37e7c292738adf1728f12688d41d421b8526fdf8e22e5aa757c7bf363e22
   14ed0eba652b8ed5371eb808f157f17a89a8c29814241009

   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.
