From 9a152103788b33f04cc5800d2aa6b2b4ef981e15 Mon Sep 17 00:00:00 2001 From: Greg Bernstein Date: Sun, 30 Jun 2024 09:16:59 -0700 Subject: [PATCH] Unify error codes and error handling language. Co-authored-by: Ted Thibodeau Jr Co-authored-by: Manu Sporny --- index.html | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index e99b705..f329600 100644 --- a/index.html +++ b/index.html @@ -632,8 +632,9 @@

Transformation (eddsa-rdfc-2022)

  • If options.type is not set to the string `DataIntegrityProof` and options.cryptosuite is not -set to the string `eddsa-rdfc-2022` then a `PROOF_TRANSFORMATION_ERROR` MUST be -raised. +set to the string `eddsa-rdfc-2022` then an error MUST be raised and SHOULD +convey an error type of +PROOF_TRANSFORMATION_ERROR.
  • Let |canonicalDocument| be the result of converting |unsecuredDocument| @@ -724,13 +725,16 @@

    Proof Configuration (eddsa-rdfc-2022)

  • If options.type is not set to `DataIntegrityProof` and -proofConfig.cryptosuite is not set to `eddsa-rdfc-2022`, an -`INVALID_PROOF_CONFIGURATION` error MUST be raised. +proofConfig.cryptosuite is not set to `eddsa-rdfc-2022`, +an error MUST be raised and SHOULD convey an error type of +PROOF_GENERATION_ERROR.
  • Set proofConfig.created to options.created. If the value is not a valid -[[XMLSCHEMA11-2]] datetime, an `INVALID_PROOF_DATETIME` error MUST be raised. +[[XMLSCHEMA11-2]] datetime, +an error MUST be raised and SHOULD convey an error type of +PROOF_GENERATION_ERROR.
  • Set proofConfig.verificationMethod to @@ -1006,7 +1010,9 @@

    Transformation (eddsa-jcs-2022)

    If options.type is not set to the string `DataIntegrityProof` and options.cryptosuite is not set to the string `eddsa-jcs-2022` then an error MUST be raised that -SHOULD use the `MALFORMED_PROOF_ERROR` error code. +SHOULD use the +PROOF_VERIFICATION_ERROR +error code.
  • Let canonicalDocument be the result of applying the @@ -1085,13 +1091,16 @@

    Proof Configuration (eddsa-jcs-2022)

  • If options.type is not set to `DataIntegrityProof` and -proofConfig.cryptosuite is not set to `eddsa-jcs-2022`, an -`INVALID_PROOF_CONFIGURATION` error MUST be raised. +proofConfig.cryptosuite is not set to `eddsa-jcs-2022`, +an error MUST be raised and SHOULD convey an error type of +PROOF_GENERATION_ERROR.
  • Set proofConfig.created to options.created. If the value is not a valid -[[XMLSCHEMA11-2]] datetime, an `INVALID_PROOF_DATETIME` error MUST be raised. +[[XMLSCHEMA11-2]] datetime, +an error MUST be raised and SHOULD convey an error type of +PROOF_GENERATION_ERROR.
  • Set proofConfig.verificationMethod to @@ -2017,7 +2026,9 @@

    Transformation (Ed25519Signature2020)

    1. If options.type is not set to the string - `Ed25519Signature2020`, then a `PROOF_TRANSFORMATION_ERROR` MUST be raised. + `Ed25519Signature2020`, an error MUST be raised and SHOULD convey an error + type of + PROOF_TRANSFORMATION_ERROR.
    2. Let |canonicalDocument| be the result of converting |unsecuredDocument| @@ -2112,13 +2123,16 @@

      Proof Configuration (Ed25519Signature2020)

      proofConfig.cryptosuite to its value.
    3. - If options.type is not set to `Ed25519Signature2020`, an - `INVALID_PROOF_CONFIGURATION` error MUST be raised. +If options.type is not set to `Ed25519Signature2020`, +an error MUST be raised and SHOULD convey an error type of +PROOF_GENERATION_ERROR.
    4. Set proofConfig.created to options.created. If the value is not a valid - [[XMLSCHEMA11-2]] datetime, an `INVALID_PROOF_DATETIME` error MUST be raised. + [[XMLSCHEMA11-2]] datetime, an error MUST be raised and SHOULD convey an + error type of + PROOF_GENERATION_ERROR.
    5. Set proofConfig.verificationMethod to