From b0ec06a2508d75238a3a30a9a168d539e0ba36ed Mon Sep 17 00:00:00 2001 From: Wind4Greg Date: Mon, 24 Jun 2024 14:28:13 -0700 Subject: [PATCH 1/5] Upate error codes. --- index.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 560c6bb..16af967 100644 --- a/index.html +++ b/index.html @@ -822,12 +822,13 @@

Proof Configuration (ecdsa-rdfc-2019)

  • If |proofConfig|.|type| is not set to `DataIntegrityProof` and/or |proofConfig|.|cryptosuite| is not set to `ecdsa-rdfc-2019`, an -`INVALID_PROOF_CONFIGURATION` error MUST be raised. +error MUST be raised and SHOULD convey an error type of +`PROOF_GENERATION_ERROR`.
  • If |proofConfig|.|created| is set and if the value is not a -valid [[XMLSCHEMA11-2]] datetime, an `INVALID_PROOF_DATETIME` error MUST be -raised. +valid [[XMLSCHEMA11-2]] datetime, an error MUST be +raised and SHOULD convey an error type of `PROOF_GENERATION_ERROR`.
  • Set |proofConfig|.|@context| to @@ -1149,11 +1150,11 @@

    Proof Configuration (ecdsa-jcs-2019)

  • If |proofConfig|.|type| is not set to `DataIntegrityProof` and/or |proofConfig|.|cryptosuite| is not set to `ecdsa-jcs-2019`, an -`INVALID_PROOF_CONFIGURATION` error MUST be raised. +`PROOF_GENERATION_ERROR` error MUST be raised.
  • If |proofConfig|.|created| is set and if the value is not a -valid [[XMLSCHEMA11-2]] datetime, an `INVALID_PROOF_DATETIME` error MUST be +valid [[XMLSCHEMA11-2]] datetime, an `PROOF_GENERATION_ERROR` error MUST be raised.
  • @@ -2773,11 +2774,11 @@

    Base Proof Configuration (ecdsa-sd-2023)

  • If |proofConfig|.|type| is not set to `DataIntegrityProof` and/or |proofConfig|.|cryptosuite| is not set to `ecdsa-sd-2023`, an -`INVALID_PROOF_CONFIGURATION` error MUST be raised. +`PROOF_GENERATION_ERROR` error MUST be raised.
  • If |proofConfig|.|created| is set and if the value is not a -valid [[XMLSCHEMA11-2]] datetime, an `INVALID_PROOF_DATETIME` error MUST be +valid [[XMLSCHEMA11-2]] datetime, an `PROOF_GENERATION_ERROR` error MUST be raised.
  • From aea8bece66825214b17a9a7a78d8a80306f198cb Mon Sep 17 00:00:00 2001 From: Wind4Greg Date: Mon, 24 Jun 2024 14:45:53 -0700 Subject: [PATCH 2/5] Update error handling language. Add error codes where needed. --- index.html | 53 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index 16af967..2528f57 100644 --- a/index.html +++ b/index.html @@ -732,8 +732,9 @@

    Transformation (ecdsa-rdfc-2019)

  • If |options|.|type| is not set to the string `DataIntegrityProof` and |options|.|cryptosuite| is not -set to the string `ecdsa-rdfc-2019` then a `PROOF_TRANSFORMATION_ERROR` MUST be -raised. +set to the string `ecdsa-rdfc-2019` then +an error MUST be raised and SHOULD convey an error type of +`PROOF_TRANSFORMATION_ERROR`.
  • Let |canonicalDocument| be the result of applying the @@ -1061,8 +1062,8 @@

    Transformation (ecdsa-jcs-2019)

  • If |options|.|type| is not set to the string `DataIntegrityProof` and |options|.|cryptosuite| is not -set to the string `ecdsa-jcs-2019`, then a `PROOF_TRANSFORMATION_ERROR` MUST be -raised. +set to the string `ecdsa-jcs-2019`, then an error MUST be raised and SHOULD +convey an error type of `PROOF_TRANSFORMATION_ERROR`.
  • Let |canonicalDocument| be the result of applying the @@ -1149,13 +1150,14 @@

    Proof Configuration (ecdsa-jcs-2019)

  • If |proofConfig|.|type| is not set to `DataIntegrityProof` and/or -|proofConfig|.|cryptosuite| is not set to `ecdsa-jcs-2019`, an -`PROOF_GENERATION_ERROR` error MUST be raised. +|proofConfig|.|cryptosuite| is not set to `ecdsa-jcs-2019`, +an error MUST be raised and SHOULD convey an error type of +`PROOF_GENERATION_ERROR`.
  • If |proofConfig|.|created| is set and if the value is not a -valid [[XMLSCHEMA11-2]] datetime, an `PROOF_GENERATION_ERROR` error MUST be -raised. +valid [[XMLSCHEMA11-2]] datetime, an an error MUST be raised and SHOULD convey +an error type of `PROOF_GENERATION_ERROR`.
  • Let |canonicalProofConfig| be the result of applying the @@ -1779,7 +1781,9 @@

    selectPaths

    Set |parentValue| to |value|.
  • -Set |value| to |parentValue.|path|. If |value| is now undefined, throw an error +Set |value| to |parentValue.|path|. If |value| is now undefined, +an error MUST be raised and SHOULD convey an error type of +`PROOF_GENERATION_ERROR` indicating that the JSON pointer does not match the given |document|.
  • @@ -2199,7 +2203,8 @@

    parseBaseProofValue

    1. Ensure the |proofValue| string starts with `u`, indicating that it is a -multibase-base64url-no-pad-encoded value, throwing an error if it does not. +multibase-base64url-no-pad-encoded value, if it does not an error MUST be raised +and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`.
    2. Initialize |decodedProofValue| to the result of base64url-no-pad-decoding the @@ -2207,7 +2212,8 @@

      parseBaseProofValue

    3. Ensure that the |decodedProofValue| starts with the ECDSA-SD base proof header -bytes 0xd9, 0x5d, and 0x00, throwing an error if it does not. +bytes 0xd9, 0x5d, and 0x00, if it does not an error MUST be raised and SHOULD +convey an error type of `PROOF_VERIFICATION_ERROR`.
    4. Initialize |components| to an array that is the result of CBOR-decoding the @@ -2470,7 +2476,8 @@

      parseDerivedProofValue

      1. Ensure the |proofValue| string starts with `u`, indicating that it is a -multibase-base64url-no-pad-encoded value, throwing an error if it does not. +multibase-base64url-no-pad-encoded value, if it does not an error MUST be raised +and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`.
      2. Initialize |decodedProofValue| to the result of base64url-no-pad-decoding the @@ -2478,7 +2485,8 @@

        parseDerivedProofValue

      3. Ensure that the |decodedProofValue| starts with the ECDSA-SD disclosure proof -header bytes `0xd9`, `0x5d`, and `0x01`, throwing an error if it does not. +header bytes `0xd9`, `0x5d`, and `0x01`, if it does not an error MUST be raised +and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`.
      4. Initialize |components| to an array that is the result of CBOR-decoding the @@ -2486,7 +2494,8 @@

        parseDerivedProofValue

        result is an array of five elements. Ensure the result is an array of five elements: a byte array of length 64, a byte array of length 36, an array of byte arrays, each of length 64, a map of integers to byte arrays of length 32, and an -array of integers, throwing an error if not. +array of integers, if it does not an error MUST be raised and SHOULD convey an +error type of `PROOF_VERIFICATION_ERROR`.
      5. Replace the fourth element in |components| using the result of calling the @@ -2773,13 +2782,14 @@

        Base Proof Configuration (ecdsa-sd-2023)

      6. If |proofConfig|.|type| is not set to `DataIntegrityProof` and/or -|proofConfig|.|cryptosuite| is not set to `ecdsa-sd-2023`, an -`PROOF_GENERATION_ERROR` error MUST be raised. +|proofConfig|.|cryptosuite| is not set to `ecdsa-sd-2023`, +an error MUST be raised and SHOULD convey an error type of +`PROOF_GENERATION_ERROR`.
      7. If |proofConfig|.|created| is set and if the value is not a -valid [[XMLSCHEMA11-2]] datetime, an `PROOF_GENERATION_ERROR` error MUST be -raised. +valid [[XMLSCHEMA11-2]] datetime, an error MUST be raised and SHOULD convey an +error type of `PROOF_GENERATION_ERROR`.
      8. Set |proofConfig|.|@context| to @@ -2935,9 +2945,10 @@

        Verify Derived Proof (ecdsa-sd-2023)

        custom JSON-LD API options, such as a document loader.
      9. -If the length of |signatures| does not match the length of |nonMandatory|, throw -an error indicating that the signature count does not match the non-mandatory -message count. +If the length of |signatures| does not match the length of |nonMandatory|, +an error MUST be raised and SHOULD convey an error type of +`PROOF_VERIFICATION_ERROR` indicating that the signature count does not match +the non-mandatory message count.
      10. Initialize |publicKeyBytes| to the public key bytes expressed in |publicKey|. From 0e5318a8b4fc5a4bd144f6d5184a4a720fc4a9e4 Mon Sep 17 00:00:00 2001 From: Greg Bernstein Date: Tue, 25 Jun 2024 08:22:47 -0700 Subject: [PATCH 3/5] Unify Error Handling: Editorial, punctuation and phrasing updates, for consistency and clarity. Co-authored-by: Ted Thibodeau Jr Co-authored-by: Dave Longley --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 2528f57..7eaa236 100644 --- a/index.html +++ b/index.html @@ -732,7 +732,7 @@

        Transformation (ecdsa-rdfc-2019)

      11. If |options|.|type| is not set to the string `DataIntegrityProof` and |options|.|cryptosuite| is not -set to the string `ecdsa-rdfc-2019` then +set to the string `ecdsa-rdfc-2019`, an error MUST be raised and SHOULD convey an error type of `PROOF_TRANSFORMATION_ERROR`.
      12. @@ -1062,7 +1062,7 @@

        Transformation (ecdsa-jcs-2019)

      13. If |options|.|type| is not set to the string `DataIntegrityProof` and |options|.|cryptosuite| is not -set to the string `ecdsa-jcs-2019`, then an error MUST be raised and SHOULD +set to the string `ecdsa-jcs-2019`, an error MUST be raised and SHOULD convey an error type of `PROOF_TRANSFORMATION_ERROR`.
      14. @@ -1156,7 +1156,7 @@

        Proof Configuration (ecdsa-jcs-2019)

      15. If |proofConfig|.|created| is set and if the value is not a -valid [[XMLSCHEMA11-2]] datetime, an an error MUST be raised and SHOULD convey +valid [[XMLSCHEMA11-2]] datetime, an error MUST be raised and SHOULD convey an error type of `PROOF_GENERATION_ERROR`.
      16. From 69623079aefbf653291de9c4fe0119fd4507362e Mon Sep 17 00:00:00 2001 From: Greg Bernstein Date: Tue, 25 Jun 2024 08:25:45 -0700 Subject: [PATCH 4/5] Unify Error Handling: Editorial, punctuation and phrasing updates, for consistency and clarity. Co-authored-by: Ted Thibodeau Jr --- index.html | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index 7eaa236..8320838 100644 --- a/index.html +++ b/index.html @@ -1783,7 +1783,7 @@

        selectPaths

      17. Set |value| to |parentValue.|path|. If |value| is now undefined, an error MUST be raised and SHOULD convey an error type of -`PROOF_GENERATION_ERROR` +`PROOF_GENERATION_ERROR`, indicating that the JSON pointer does not match the given |document|.
      18. @@ -2202,8 +2202,8 @@

        parseBaseProofValue

        1. -Ensure the |proofValue| string starts with `u`, indicating that it is a -multibase-base64url-no-pad-encoded value, if it does not an error MUST be raised +If the |proofValue| string does not start with `u`, indicating that it is +a multibase-base64url-no-pad-encoded value, an error MUST be raised and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`.
        2. @@ -2211,8 +2211,8 @@

          parseBaseProofValue

          substring after the leading `u` in |proofValue|.
        3. -Ensure that the |decodedProofValue| starts with the ECDSA-SD base proof header -bytes 0xd9, 0x5d, and 0x00, if it does not an error MUST be raised and SHOULD +If the |decodedProofValue| does not start with the ECDSA-SD base proof +header bytes `0xd9`, `0x5d`, and `0x00`, an error MUST be raised and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`.
        4. @@ -2476,7 +2476,8 @@

          parseDerivedProofValue

          1. Ensure the |proofValue| string starts with `u`, indicating that it is a -multibase-base64url-no-pad-encoded value, if it does not an error MUST be raised +If the |proofValue| string does not start with `u`, indicating that it is a +multibase-base64url-no-pad-encoded value, an error MUST be raised and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`.
          2. @@ -2484,18 +2485,17 @@

            parseDerivedProofValue

            substring after the leading `u` in |proofValue|.
          3. -Ensure that the |decodedProofValue| starts with the ECDSA-SD disclosure proof -header bytes `0xd9`, `0x5d`, and `0x01`, if it does not an error MUST be raised +If the |decodedProofValue| does not start with the ECDSA-SD disclosure proof +header bytes `0xd9`, `0x5d`, and `0x01`, an error MUST be raised and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`.
          4. -Initialize |components| to an array that is the result of CBOR-decoding the -bytes that follow the three-byte ECDSA-SD disclosure proof header. Ensure the -result is an array of five elements. Ensure the result is an array of five -elements: a byte array of length 64, a byte array of length 36, an array of byte -arrays, each of length 64, a map of integers to byte arrays of length 32, and an -array of integers, if it does not an error MUST be raised and SHOULD convey an -error type of `PROOF_VERIFICATION_ERROR`. +Initialize |components| to an array that is the result of CBOR-decoding the bytes +that follow the three-byte ECDSA-SD disclosure proof header. If the result is not +an array of the following five elements — a byte array of length 64; a byte array +of length 36; an array of byte arrays, each of length 64; a map of integers to +byte arrays, each of length 32; and an array of integers — an error MUST be raised +and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`.
          5. Replace the fourth element in |components| using the result of calling the @@ -2947,7 +2947,7 @@

            Verify Derived Proof (ecdsa-sd-2023)

          6. If the length of |signatures| does not match the length of |nonMandatory|, an error MUST be raised and SHOULD convey an error type of -`PROOF_VERIFICATION_ERROR` indicating that the signature count does not match +`PROOF_VERIFICATION_ERROR`, indicating that the signature count does not match the non-mandatory message count.
          7. From 671150ec47819b16b42c0e1ee76692a2064c3c92 Mon Sep 17 00:00:00 2001 From: Wind4Greg Date: Fri, 28 Jun 2024 12:09:34 -0700 Subject: [PATCH 5/5] Formatting: Linked all error codes used back to DI spec with "data-cite" attribute. --- index.html | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 8320838..26ab2e9 100644 --- a/index.html +++ b/index.html @@ -734,7 +734,7 @@

            Transformation (ecdsa-rdfc-2019)

            `DataIntegrityProof` and |options|.|cryptosuite| is not set to the string `ecdsa-rdfc-2019`, an error MUST be raised and SHOULD convey an error type of -`PROOF_TRANSFORMATION_ERROR`. +PROOF_TRANSFORMATION_ERROR.
          8. Let |canonicalDocument| be the result of applying the @@ -824,12 +824,13 @@

            Proof Configuration (ecdsa-rdfc-2019)

            If |proofConfig|.|type| is not set to `DataIntegrityProof` and/or |proofConfig|.|cryptosuite| is not set to `ecdsa-rdfc-2019`, an error MUST be raised and SHOULD convey an error type of -`PROOF_GENERATION_ERROR`. +PROOF_GENERATION_ERROR.
          9. If |proofConfig|.|created| is set and if the value is not a valid [[XMLSCHEMA11-2]] datetime, an error MUST be -raised and SHOULD convey an error type of `PROOF_GENERATION_ERROR`. +raised and SHOULD convey an error type of +PROOF_GENERATION_ERROR.
          10. Set |proofConfig|.|@context| to @@ -1063,7 +1064,8 @@

            Transformation (ecdsa-jcs-2019)

            If |options|.|type| is not set to the string `DataIntegrityProof` and |options|.|cryptosuite| is not set to the string `ecdsa-jcs-2019`, an error MUST be raised and SHOULD -convey an error type of `PROOF_TRANSFORMATION_ERROR`. +convey an error type of +PROOF_TRANSFORMATION_ERROR.
          11. Let |canonicalDocument| be the result of applying the @@ -1152,12 +1154,13 @@

            Proof Configuration (ecdsa-jcs-2019)

            If |proofConfig|.|type| is not set to `DataIntegrityProof` and/or |proofConfig|.|cryptosuite| is not set to `ecdsa-jcs-2019`, an error MUST be raised and SHOULD convey an error type of -`PROOF_GENERATION_ERROR`. +PROOF_GENERATION_ERROR.
          12. If |proofConfig|.|created| is set and if the value is not a valid [[XMLSCHEMA11-2]] datetime, an error MUST be raised and SHOULD convey -an error type of `PROOF_GENERATION_ERROR`. +an error type of +PROOF_GENERATION_ERROR.
          13. Let |canonicalProofConfig| be the result of applying the @@ -1783,7 +1786,7 @@

            selectPaths

          14. Set |value| to |parentValue.|path|. If |value| is now undefined, an error MUST be raised and SHOULD convey an error type of -`PROOF_GENERATION_ERROR`, +PROOF_GENERATION_ERROR, indicating that the JSON pointer does not match the given |document|.
          15. @@ -2204,7 +2207,8 @@

            parseBaseProofValue

          16. If the |proofValue| string does not start with `u`, indicating that it is a multibase-base64url-no-pad-encoded value, an error MUST be raised -and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`. +and SHOULD convey an error type of +PROOF_VERIFICATION_ERROR.
          17. Initialize |decodedProofValue| to the result of base64url-no-pad-decoding the @@ -2213,7 +2217,8 @@

            parseBaseProofValue

          18. If the |decodedProofValue| does not start with the ECDSA-SD base proof header bytes `0xd9`, `0x5d`, and `0x00`, an error MUST be raised and SHOULD -convey an error type of `PROOF_VERIFICATION_ERROR`. +convey an error type of +PROOF_VERIFICATION_ERROR.
          19. Initialize |components| to an array that is the result of CBOR-decoding the @@ -2478,7 +2483,8 @@

            parseDerivedProofValue

            Ensure the |proofValue| string starts with `u`, indicating that it is a If the |proofValue| string does not start with `u`, indicating that it is a multibase-base64url-no-pad-encoded value, an error MUST be raised -and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`. +and SHOULD convey an error type of +PROOF_VERIFICATION_ERROR.
          20. Initialize |decodedProofValue| to the result of base64url-no-pad-decoding the @@ -2487,7 +2493,8 @@

            parseDerivedProofValue

          21. If the |decodedProofValue| does not start with the ECDSA-SD disclosure proof header bytes `0xd9`, `0x5d`, and `0x01`, an error MUST be raised -and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`. +and SHOULD convey an error type of +PROOF_VERIFICATION_ERROR.
          22. Initialize |components| to an array that is the result of CBOR-decoding the bytes @@ -2495,7 +2502,8 @@

            parseDerivedProofValue

            an array of the following five elements — a byte array of length 64; a byte array of length 36; an array of byte arrays, each of length 64; a map of integers to byte arrays, each of length 32; and an array of integers — an error MUST be raised -and SHOULD convey an error type of `PROOF_VERIFICATION_ERROR`. +and SHOULD convey an error type of +PROOF_VERIFICATION_ERROR.
          23. Replace the fourth element in |components| using the result of calling the @@ -2784,12 +2792,13 @@

            Base Proof Configuration (ecdsa-sd-2023)

            If |proofConfig|.|type| is not set to `DataIntegrityProof` and/or |proofConfig|.|cryptosuite| is not set to `ecdsa-sd-2023`, an error MUST be raised and SHOULD convey an error type of -`PROOF_GENERATION_ERROR`. +PROOF_GENERATION_ERROR.
          24. If |proofConfig|.|created| is set and if the value is not a valid [[XMLSCHEMA11-2]] datetime, an error MUST be raised and SHOULD convey an -error type of `PROOF_GENERATION_ERROR`. +error type of +PROOF_GENERATION_ERROR.
          25. Set |proofConfig|.|@context| to @@ -2947,7 +2956,8 @@

            Verify Derived Proof (ecdsa-sd-2023)

          26. If the length of |signatures| does not match the length of |nonMandatory|, an error MUST be raised and SHOULD convey an error type of -`PROOF_VERIFICATION_ERROR`, indicating that the signature count does not match +PROOF_VERIFICATION_ERROR, +indicating that the signature count does not match the non-mandatory message count.