| // Copyright 2026 Google LLC | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // https://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| // See the License for the specific language governing permissions and | |
| // limitations under the License. | |
| // | |
| #ifndef THIRD_PARTY_CREDENTIO_CONSTANTS_STATUS_CODES_H_ | |
| #define THIRD_PARTY_CREDENTIO_CONSTANTS_STATUS_CODES_H_ | |
| #include "absl/strings/str_cat.h" | |
| namespace credentio { | |
| // Constants corresponding to C2PA status codes. | |
| // See | |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_standard_status_codes | |
| // for more information. about the C2PA status codes. Integer ranges for | |
| // success/informational/failure are disjoint to be safe. | |
| // Success status codes. | |
| // See | |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_success_codes. | |
| enum class SuccessStatusCode { | |
| kClaimSignatureValidated = 201, // claimSignature.validated | |
| kClaimSignatureInsideValidity, // claimSignature.insideValidity | |
| // Custom success codes, specific to this validator. | |
| kGoogleAssertionDataHashMatch, // com.google.assertion.dataHash.match | |
| kGoogleAssertionBmffHashMatch, // com.google.assertion.bmffHash.match | |
| kGoogleAssertionBoxesHashMatch, // com.google.assertion.boxesHash.match | |
| // com.google.assertion.multiAssetHash.match | |
| kGoogleAssertionMultiAssetHashMatch, | |
| // com.google.assertion.collectionHash.match | |
| kGoogleAssertionCollectionHashMatch, | |
| kAssertionDataHashMatch, // assertion.dataHash.match | |
| kIngredientClaimSignatureValidated, // ingredient.claimSignature.validated | |
| kIngredientManifestValidated, // ingredient.manifest.validated | |
| kAssertionHashedUriMatch, // assertion.hashedURI.match | |
| kAssertionBmffHashMatch, // assertion.bmffHash.match | |
| kAssertionBoxesHashMatch, // assertion.boxesHash.match | |
| kAssertionCollectionHashMatch, // assertion.collectionHash.match | |
| kAssertionMultiAssetHashMatch, // assertion.multiAssetHash.match | |
| kSigningCredentialTrusted, // signingCredential.trusted | |
| kTimestampTrusted, // timeStamp.trusted | |
| kTimestampValidated, // timeStamp.validated | |
| kSigningCredentialOcspNotRevoked, // signingCredential.ocsp.notRevoked | |
| }; | |
| // Informational status codes. | |
| // See | |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_informational_codes. | |
| enum class InformationalStatusCode { | |
| // Custom informational codes, specific to this validator | |
| // go/keep-sorted start | |
| // Indicates that the OCSP response's `producedAt` timestamp is outside of the | |
| // certificate's validity period or the timestamp's time is outside of the | |
| // validity window of the stapled OCSP response. | |
| kSigningCredentialOcspOutsideValidity = 601, | |
| // com.google.signingCredential.ocsp.outsideValidity | |
| // Indicates that the timestamp's time is outside of the range that can be | |
| // handled by this validator. The timestamp may be considered valid by | |
| // other implementations. | |
| kTimestampOutOfRange, // com.google.timeStamp.outOfRange | |
| // go/keep-sorted end | |
| // Standard informational codes | |
| // go/keep-sorted start | |
| kIngredientUnknownProvenance, // ingredient.unknownProvenance | |
| kSigningCredentialOcspSkipped, // signingCredential.ocsp.skipped | |
| kTimestampMalformed, // timeStamp.malformed | |
| kTimestampMismatch, // timeStamp.mismatch | |
| kTimestampOutsideValidity, // timeStamp.outsideValidity | |
| kTimestampUntrusted, // timeStamp.untrusted | |
| // go/keep-sorted end | |
| // Assertion informational codes | |
| // go/keep-sorted start | |
| // assertion.bmffHash.additionalExclusionsPresent | |
| kAssertionBmffHashAdditionalExclusionsPresent, | |
| // assertion.boxesHash.additionalExclusionsPresent | |
| kAssertionBoxesHashAdditionalExclusionsPresent, | |
| // assertion.dataHash.additionalExclusionsPresent | |
| kAssertionDataHashAdditionalExclusionsPresent, | |
| // go/keep-sorted end | |
| }; | |
| // Failure status codes. | |
| // See | |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_failure_codes. | |
| enum class FailureStatusCode { | |
| kGeneralError = 401, // (custom, name TBD) | |
| // Custom failure codes, specific to this validator. | |
| kGoogleInternalError, // com.google.internal.error | |
| kGoogleUnsupportedSpecVersion, // com.google.unsupportedSpecVersion | |
| kGoogleUnsupportedManifestType, // com.google.unsupportedManifestType | |
| // com.google.assertion.action.unknownAction | |
| kGoogleAssertionActionUnknownAction, | |
| kGoogleAssertionDataHashMismatch, // com.google.assertion.dataHash.mismatch | |
| kGoogleAssertionDataHashMalformed, // com.google.assertion.dataHash.malformed | |
| kGoogleAssertionBmffHashMalformed, // com.google.assertion.bmffHash.malformed | |
| kGoogleAssertionBmffHashMismatch, // com.google.assertion.bmffHash.mismatch | |
| // com.google.assertion.boxesHash.unknownBox | |
| kGoogleAssertionBoxesHashUnknownBox, | |
| kGoogleAssertionBoxesHashMismatch, // com.google.assertion.boxesHash.mismatch | |
| // com.google.assertion.boxesHash.malformed | |
| kGoogleAssertionBoxesHashMalformed, | |
| // com.google.assertion.multiAssetHash.mismatch | |
| kGoogleAssertionMultiAssetHashMismatch, | |
| // com.google.assertion.multiAssetHash.malformed | |
| kGoogleAssertionMultiAssetHashMalformed, | |
| // com.google.assertion.multiAssetHash.missingPart | |
| kGoogleAssertionMultiAssetHashMissingPart, | |
| kGoogleHashedUriUnsupported, // com.google.hashedUri.unsupported | |
| // Failure codes used for C2PA Claim validation. | |
| kAlgorithmUnsupported, // algorithm.unsupported | |
| kClaimHardBindingsMissing, // claim.hardBindings.missing | |
| kClaimMalformed, // claim.malformed | |
| kClaimMissing, // claim.missing | |
| kClaimMultiple, // claim.multiple | |
| kClaimCborInvalid, // claim.cbor.invalid | |
| kClaimSignatureMissing, // claimSignature.missing | |
| kClaimSignatureMismatch, // claimSignature.mismatch | |
| kClaimSignatureOutsideValidity, // claimSignature.outsideValidity | |
| kHashedUriMissing, // hashedUri.missing | |
| kSigningCredentialInvalid, // signingCredential.invalid | |
| kSigningCredentialOcspRevoked, // signingCredential.ocsp.revoked | |
| kSigningCredentialUntrusted, // signingCredential.untrusted | |
| // Failure codes used for C2PA Assertion validation. | |
| kAssertionCborInvalid, // assertion.cbor.invalid | |
| kAssertionJsonInvalid, // assertion.json.invalid | |
| kAssertionMultipleHardBindings, // assertion.multipleHardBindings | |
| kAssertionDataHashMismatch, // assertion.dataHash.mismatch | |
| kAssertionDataHashMalformed, // assertion.dataHash.malformed | |
| kAssertionUndeclared, // assertion.undeclared | |
| kAssertionOutsideManifest, // assertion.outsideManifest | |
| kAssertionMissing, // assertion.missing | |
| kAssertionHashedUriMismatch, // assertion.hashedURI.mismatch | |
| kAssertionNotRedacted, // assertion.notRedacted | |
| kAssertionSelfRedacted, // assertion.selfRedacted | |
| kAssertionBmffHashMalformed, // assertion.bmffHash.malformed | |
| kAssertionBmffHashMismatch, // assertion.bmffHash.mismatch | |
| kAssertionBoxesHashUnknownBox, // assertion.boxesHash.unknownBox | |
| kAssertionBoxesHashMismatch, // assertion.boxesHash.mismatch | |
| kAssertionBoxesHashMalformed, // assertion.boxesHash.malformed | |
| kAssertionMultiAssetHashMismatch, // assertion.multiAssetHash.mismatch | |
| kAssertionMultiAssetHashMalformed, // assertion.multiAssetHash.malformed | |
| kAssertionMultiAssetHashMissingPart, // assertion.multiAssetHash.missingPart | |
| // assertion.collectionHash.incorrectFileCount | |
| kAssertionCollectionHashIncorrectFileCount, | |
| // assertion.collectionHash.invalidURI | |
| kAssertionCollectionHashInvalidUri, | |
| kAssertionCollectionHashMismatch, // assertion.collectionHash.mismatch | |
| kAssertionCollectionHashMalformed, // assertion.collectionHash.malformed | |
| kAssertionActionRedacted, // assertion.action.redacted | |
| kAssertionActionMalformed, // assertion.action.malformed | |
| kAssertionActionSoftBindingMissing, // assertion.action.softBindingMissing | |
| kAssertionActionIngredientMismatch, // assertion.action.ingredientMismatch | |
| kAssertionActionRedactionMismatch, // assertion.action.redactionMismatch | |
| kAssertionIngredientMalformed, // assertion.ingredient.malformed | |
| kHashedUriMismatch, // hashedUri.mismatch | |
| // Failure codes related to C2PA ingredient manifests | |
| kIngredientClaimSignatureMissing, // ingredient.claimSignature.missing | |
| kIngredientClaimSignatureMismatch, // ingredient.claimSignature.mismatch | |
| kIngredientManifestMissing, // ingredient.manifest.missing | |
| kIngredientManifestMismatch, // ingredient.manifest.mismatch | |
| kManifestMultipleParents, // manifest.multipleParents | |
| kManifestUpdateInvalid, // manifest.update.invalid | |
| kManifestUpdateWrongParents, // manifest.update.wrongParents | |
| }; | |
| template <typename Sink> | |
| void AbslStringify(Sink& sink, SuccessStatusCode status) { | |
| switch (status) { | |
| case SuccessStatusCode::kClaimSignatureValidated: | |
| sink.Append("claimSignature.validated"); | |
| return; | |
| case SuccessStatusCode::kClaimSignatureInsideValidity: | |
| sink.Append("claimSignature.insideValidity"); | |
| return; | |
| case SuccessStatusCode::kAssertionDataHashMatch: | |
| sink.Append("assertion.dataHash.match"); | |
| return; | |
| case SuccessStatusCode::kIngredientManifestValidated: | |
| sink.Append("ingredient.manifest.validated"); | |
| return; | |
| case SuccessStatusCode::kIngredientClaimSignatureValidated: | |
| sink.Append("ingredient.claimSignature.validated"); | |
| return; | |
| case SuccessStatusCode::kAssertionHashedUriMatch: | |
| sink.Append("assertion.hashedURI.match"); | |
| return; | |
| case SuccessStatusCode::kAssertionBmffHashMatch: | |
| sink.Append("assertion.bmffHash.match"); | |
| return; | |
| case SuccessStatusCode::kAssertionBoxesHashMatch: | |
| sink.Append("assertion.boxesHash.match"); | |
| return; | |
| case SuccessStatusCode::kAssertionCollectionHashMatch: | |
| sink.Append("assertion.collectionHash.match"); | |
| return; | |
| case SuccessStatusCode::kSigningCredentialTrusted: | |
| sink.Append("signingCredential.trusted"); | |
| return; | |
| case SuccessStatusCode::kTimestampTrusted: | |
| sink.Append("timeStamp.trusted"); | |
| return; | |
| case SuccessStatusCode::kTimestampValidated: | |
| sink.Append("timeStamp.validated"); | |
| return; | |
| case SuccessStatusCode::kSigningCredentialOcspNotRevoked: | |
| sink.Append("signingCredential.ocsp.notRevoked"); | |
| return; | |
| case SuccessStatusCode::kGoogleAssertionDataHashMatch: | |
| sink.Append("com.google.assertion.dataHash.match"); | |
| return; | |
| case SuccessStatusCode::kGoogleAssertionCollectionHashMatch: | |
| sink.Append("com.google.assertion.collectionHash.match"); | |
| return; | |
| case SuccessStatusCode::kGoogleAssertionBmffHashMatch: | |
| sink.Append("com.google.assertion.bmffHash.match"); | |
| return; | |
| case SuccessStatusCode::kGoogleAssertionBoxesHashMatch: | |
| sink.Append("com.google.assertion.boxesHash.match"); | |
| return; | |
| case SuccessStatusCode::kGoogleAssertionMultiAssetHashMatch: | |
| sink.Append("com.google.assertion.multiAssetHash.match"); | |
| return; | |
| case SuccessStatusCode::kAssertionMultiAssetHashMatch: | |
| sink.Append("assertion.multiAssetHash.match"); | |
| return; | |
| } | |
| sink.Append( | |
| absl::StrCat("UNKNOWN_SUCCESS_STATUS_", static_cast<int>(status))); | |
| } | |
| template <typename Sink> | |
| void AbslStringify(Sink& sink, InformationalStatusCode status) { | |
| switch (status) { | |
| case credentio::InformationalStatusCode:: | |
| kSigningCredentialOcspOutsideValidity: | |
| sink.Append("com.google.signingCredential.ocsp.outsideValidity"); | |
| return; | |
| case credentio::InformationalStatusCode::kTimestampOutOfRange: | |
| sink.Append("com.google.timeStamp.outOfRange"); | |
| return; | |
| case InformationalStatusCode::kIngredientUnknownProvenance: | |
| sink.Append("ingredient.unknownProvenance"); | |
| return; | |
| case InformationalStatusCode::kTimestampMalformed: | |
| sink.Append("timeStamp.malformed"); | |
| return; | |
| case InformationalStatusCode::kTimestampUntrusted: | |
| sink.Append("timeStamp.untrusted"); | |
| return; | |
| case credentio::InformationalStatusCode::kTimestampOutsideValidity: | |
| sink.Append("timeStamp.outsideValidity"); | |
| return; | |
| case InformationalStatusCode::kSigningCredentialOcspSkipped: | |
| sink.Append("signingCredential.ocsp.skipped"); | |
| return; | |
| case InformationalStatusCode::kTimestampMismatch: | |
| sink.Append("timeStamp.mismatch"); | |
| return; | |
| case InformationalStatusCode::kAssertionDataHashAdditionalExclusionsPresent: | |
| sink.Append("assertion.dataHash.additionalExclusionsPresent"); | |
| return; | |
| case InformationalStatusCode:: | |
| kAssertionBoxesHashAdditionalExclusionsPresent: | |
| sink.Append("assertion.boxesHash.additionalExclusionsPresent"); | |
| return; | |
| case InformationalStatusCode::kAssertionBmffHashAdditionalExclusionsPresent: | |
| sink.Append("assertion.bmffHash.additionalExclusionsPresent"); | |
| return; | |
| } | |
| sink.Append( | |
| absl::StrCat("UNKNOWN_INFORMATIONAL_STATUS_", static_cast<int>(status))); | |
| } | |
| template <typename Sink> | |
| void AbslStringify(Sink& sink, FailureStatusCode status) { | |
| switch (status) { | |
| case FailureStatusCode::kGeneralError: | |
| sink.Append("general.error"); | |
| return; | |
| case FailureStatusCode::kGoogleInternalError: | |
| sink.Append("com.google.internal.error"); | |
| return; | |
| case FailureStatusCode::kGoogleUnsupportedSpecVersion: | |
| sink.Append("com.google.unsupportedSpecVersion"); | |
| return; | |
| case FailureStatusCode::kGoogleUnsupportedManifestType: | |
| sink.Append("com.google.unsupportedManifestType"); | |
| return; | |
| case FailureStatusCode::kClaimMissing: | |
| sink.Append("claim.missing"); | |
| return; | |
| case FailureStatusCode::kClaimMultiple: | |
| sink.Append("claim.multiple"); | |
| return; | |
| case FailureStatusCode::kClaimCborInvalid: | |
| sink.Append("claim.cbor.invalid"); | |
| return; | |
| case FailureStatusCode::kClaimSignatureMissing: | |
| sink.Append("claimSignature.missing"); | |
| return; | |
| case FailureStatusCode::kClaimSignatureMismatch: | |
| sink.Append("claimSignature.mismatch"); | |
| return; | |
| case FailureStatusCode::kClaimSignatureOutsideValidity: | |
| sink.Append("claimSignature.outsideValidity"); | |
| return; | |
| case FailureStatusCode::kHashedUriMissing: | |
| sink.Append("hashedUri.missing"); | |
| return; | |
| case FailureStatusCode::kSigningCredentialInvalid: | |
| sink.Append("signingCredential.invalid"); | |
| return; | |
| case FailureStatusCode::kSigningCredentialUntrusted: | |
| sink.Append("signingCredential.untrusted"); | |
| return; | |
| case FailureStatusCode::kAssertionCborInvalid: | |
| sink.Append("assertion.cbor.invalid"); | |
| return; | |
| case FailureStatusCode::kAssertionJsonInvalid: | |
| sink.Append("assertion.json.invalid"); | |
| return; | |
| case FailureStatusCode::kClaimHardBindingsMissing: | |
| sink.Append("claim.hardBindings.missing"); | |
| return; | |
| case FailureStatusCode::kClaimMalformed: | |
| sink.Append("claim.malformed"); | |
| return; | |
| case FailureStatusCode::kAssertionMultipleHardBindings: | |
| sink.Append("assertion.multipleHardBindings"); | |
| return; | |
| case FailureStatusCode::kAssertionDataHashMismatch: | |
| sink.Append("assertion.dataHash.mismatch"); | |
| return; | |
| case FailureStatusCode::kAlgorithmUnsupported: | |
| sink.Append("algorithm.unsupported"); | |
| return; | |
| case FailureStatusCode::kAssertionDataHashMalformed: | |
| sink.Append("assertion.dataHash.malformed"); | |
| return; | |
| case FailureStatusCode::kAssertionUndeclared: | |
| sink.Append("assertion.undeclared"); | |
| return; | |
| case FailureStatusCode::kAssertionOutsideManifest: | |
| sink.Append("assertion.outsideManifest"); | |
| return; | |
| case FailureStatusCode::kAssertionMissing: | |
| sink.Append("assertion.missing"); | |
| return; | |
| case FailureStatusCode::kIngredientClaimSignatureMissing: | |
| sink.Append("ingredient.claimSignature.missing"); | |
| return; | |
| case FailureStatusCode::kIngredientClaimSignatureMismatch: | |
| sink.Append("ingredient.claimSignature.mismatch"); | |
| return; | |
| case FailureStatusCode::kIngredientManifestMissing: | |
| sink.Append("ingredient.manifest.missing"); | |
| return; | |
| case FailureStatusCode::kIngredientManifestMismatch: | |
| sink.Append("ingredient.manifest.mismatch"); | |
| return; | |
| case FailureStatusCode::kAssertionHashedUriMismatch: | |
| sink.Append("assertion.hashedURI.mismatch"); | |
| return; | |
| case FailureStatusCode::kAssertionNotRedacted: | |
| sink.Append("assertion.notRedacted"); | |
| return; | |
| case FailureStatusCode::kAssertionSelfRedacted: | |
| sink.Append("assertion.selfRedacted"); | |
| return; | |
| case FailureStatusCode::kAssertionBmffHashMalformed: | |
| sink.Append("assertion.bmffHash.malformed"); | |
| return; | |
| case FailureStatusCode::kAssertionBmffHashMismatch: | |
| sink.Append("assertion.bmffHash.mismatch"); | |
| return; | |
| case FailureStatusCode::kAssertionBoxesHashUnknownBox: | |
| sink.Append("assertion.boxesHash.unknownBox"); | |
| return; | |
| case FailureStatusCode::kAssertionBoxesHashMismatch: | |
| sink.Append("assertion.boxesHash.mismatch"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionActionUnknownAction: | |
| sink.Append("com.google.assertion.action.unknownAction"); | |
| return; | |
| case FailureStatusCode::kAssertionActionRedacted: | |
| sink.Append("assertion.action.redacted"); | |
| return; | |
| case FailureStatusCode::kAssertionActionMalformed: | |
| sink.Append("assertion.action.malformed"); | |
| return; | |
| case FailureStatusCode::kAssertionActionSoftBindingMissing: | |
| sink.Append("assertion.action.softBindingMissing"); | |
| return; | |
| case FailureStatusCode::kAssertionActionIngredientMismatch: | |
| sink.Append("assertion.action.ingredientMismatch"); | |
| return; | |
| case FailureStatusCode::kAssertionActionRedactionMismatch: | |
| sink.Append("assertion.action.redactionMismatch"); | |
| return; | |
| case FailureStatusCode::kAssertionIngredientMalformed: | |
| sink.Append("assertion.ingredient.malformed"); | |
| return; | |
| case FailureStatusCode::kHashedUriMismatch: | |
| sink.Append("hashedUri.mismatch"); | |
| return; | |
| case FailureStatusCode::kManifestMultipleParents: | |
| sink.Append("manifest.multipleParents"); | |
| return; | |
| case FailureStatusCode::kManifestUpdateInvalid: | |
| sink.Append("manifest.update.invalid"); | |
| return; | |
| case FailureStatusCode::kManifestUpdateWrongParents: | |
| sink.Append("manifest.update.wrongParents"); | |
| return; | |
| case FailureStatusCode::kSigningCredentialOcspRevoked: | |
| sink.Append("signingCredential.ocsp.revoked"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionDataHashMismatch: | |
| sink.Append("com.google.assertion.dataHash.mismatch"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionDataHashMalformed: | |
| sink.Append("com.google.assertion.dataHash.malformed"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionBmffHashMalformed: | |
| sink.Append("com.google.assertion.bmffHash.malformed"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionBmffHashMismatch: | |
| sink.Append("com.google.assertion.bmffHash.mismatch"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionBoxesHashUnknownBox: | |
| sink.Append("com.google.assertion.boxesHash.unknownBox"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionBoxesHashMismatch: | |
| sink.Append("com.google.assertion.boxesHash.mismatch"); | |
| return; | |
| case FailureStatusCode::kGoogleHashedUriUnsupported: | |
| sink.Append("com.google.hashedUri.unsupported"); | |
| return; | |
| case FailureStatusCode::kAssertionBoxesHashMalformed: | |
| sink.Append("assertion.boxesHash.malformed"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionBoxesHashMalformed: | |
| sink.Append("com.google.assertion.boxesHash.malformed"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionMultiAssetHashMismatch: | |
| sink.Append("com.google.assertion.multiAssetHash.mismatch"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionMultiAssetHashMalformed: | |
| sink.Append("com.google.assertion.multiAssetHash.malformed"); | |
| return; | |
| case FailureStatusCode::kGoogleAssertionMultiAssetHashMissingPart: | |
| sink.Append("com.google.assertion.multiAssetHash.missingPart"); | |
| return; | |
| case FailureStatusCode::kAssertionMultiAssetHashMismatch: | |
| sink.Append("assertion.multiAssetHash.mismatch"); | |
| return; | |
| case FailureStatusCode::kAssertionMultiAssetHashMalformed: | |
| sink.Append("assertion.multiAssetHash.malformed"); | |
| return; | |
| case FailureStatusCode::kAssertionMultiAssetHashMissingPart: | |
| sink.Append("assertion.multiAssetHash.missingPart"); | |
| return; | |
| case FailureStatusCode::kAssertionCollectionHashIncorrectFileCount: | |
| sink.Append("assertion.collectionHash.incorrectFileCount"); | |
| return; | |
| case FailureStatusCode::kAssertionCollectionHashInvalidUri: | |
| sink.Append("assertion.collectionHash.invalidURI"); | |
| return; | |
| case FailureStatusCode::kAssertionCollectionHashMismatch: | |
| sink.Append("assertion.collectionHash.mismatch"); | |
| return; | |
| case FailureStatusCode::kAssertionCollectionHashMalformed: | |
| sink.Append("assertion.collectionHash.malformed"); | |
| return; | |
| } | |
| sink.Append( | |
| absl::StrCat("UNKNOWN_FAILURE_STATUS_", static_cast<int>(status))); | |
| } | |
| } // namespace credentio | |
| #endif // THIRD_PARTY_CREDENTIO_CONSTANTS_STATUS_CODES_H_ |