@sphereon/ssi-sdk.credential-validation 0.38.1-next.3 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1575,7 +1575,8 @@ var CredentialValidation = class {
1575
1575
  } else if (import_ssi_types.CredentialMapper.isSdJwtEncoded(credential)) {
1576
1576
  return await this.cvVerifySDJWTCredential({
1577
1577
  credential,
1578
- hasher
1578
+ hasher,
1579
+ skipStatusCheck: policies?.credentialStatus === false
1579
1580
  }, context);
1580
1581
  } else {
1581
1582
  return await this.cvVerifyW3CCredential({
@@ -1732,13 +1733,17 @@ var CredentialValidation = class {
1732
1733
  }
1733
1734
  }
1734
1735
  async cvVerifySDJWTCredential(args, context) {
1735
- const { credential, hasher = import_ssi_sdk.defaultHasher } = args;
1736
+ const { credential, hasher = import_ssi_sdk.defaultHasher, skipStatusCheck } = args;
1736
1737
  const verification = await context.agent.verifySdJwtVc({
1737
- credential
1738
+ credential,
1739
+ opts: {
1740
+ skipStatusCheck
1741
+ }
1738
1742
  }).catch((error) => {
1739
1743
  console.error(error);
1744
+ const isStatusListFailure = /status list/i.test(error.message ?? "");
1740
1745
  return {
1741
- error: "Invalid SD-JWT VC",
1746
+ error: isStatusListFailure ? "Invalid status list" : "Invalid SD-JWT VC",
1742
1747
  errorDetails: error.message ?? "SD-JWT VC could not be verified"
1743
1748
  };
1744
1749
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../plugin.schema.json","../src/index.ts","../src/agent/CredentialValidation.ts","../src/types/ICredentialValidation.ts"],"sourcesContent":["{\n \"ICredentialValidation\": {\n \"components\": {\n \"schemas\": {\n \"VerifyCredentialArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credential\": {\n \"$ref\": \"#/components/schemas/OriginalVerifiableCredential\"\n },\n \"hasher\": {\n \"$ref\": \"#/components/schemas/HasherSync\"\n },\n \"fetchRemoteContexts\": {\n \"type\": \"boolean\"\n },\n \"policies\": {\n \"$ref\": \"#/components/schemas/VerificationPolicies\"\n }\n },\n \"required\": [\"credential\", \"fetchRemoteContexts\"],\n \"additionalProperties\": false\n },\n \"OriginalVerifiableCredential\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/W3CVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/JwtDecodedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/MdocOid4vpIssuerSigned\"\n },\n {\n \"$ref\": \"#/components/schemas/MdocDocument\"\n }\n ]\n },\n \"W3CVerifiableCredential\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/CompactJWT\"\n }\n ],\n \"description\": \"Represents a signed Verifiable Credential (includes proof), in either JSON, compact JWT or compact SD-JWT VC format. See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model } See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats }\"\n },\n \"IVerifiableCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"proof\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IProof\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IProof\"\n }\n }\n ]\n },\n \"@context\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n }\n }\n ]\n },\n \"type\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"credentialSchema\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/ICredentialSchemaType\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialSchemaType\"\n }\n }\n ]\n },\n \"issuer\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IIssuerId\"\n },\n {\n \"$ref\": \"#/components/schemas/IIssuer\"\n }\n ]\n },\n \"issuanceDate\": {\n \"type\": \"string\"\n },\n \"credentialSubject\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n }\n }\n }\n }\n ]\n },\n \"expirationDate\": {\n \"type\": \"string\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"credentialStatus\": {\n \"$ref\": \"#/components/schemas/ICredentialStatus\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"@context\", \"credentialSubject\", \"issuanceDate\", \"issuer\", \"proof\", \"type\"]\n },\n \"IProof\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IProofType\"\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"created\": {\n \"type\": \"string\"\n },\n \"proofPurpose\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IProofPurpose\"\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"verificationMethod\": {\n \"type\": \"string\"\n },\n \"challenge\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"proofValue\": {\n \"type\": \"string\"\n },\n \"jws\": {\n \"type\": \"string\"\n },\n \"jwt\": {\n \"type\": \"string\"\n },\n \"mso_mdoc\": {\n \"type\": \"string\"\n },\n \"nonce\": {\n \"type\": \"string\"\n },\n \"requiredRevealStatements\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\"type\", \"created\", \"proofPurpose\", \"verificationMethod\"]\n },\n \"IProofType\": {\n \"type\": \"string\",\n \"enum\": [\n \"Ed25519Signature2018\",\n \"Ed25519Signature2020\",\n \"EcdsaSecp256k1Signature2019\",\n \"EcdsaSecp256k1RecoverySignature2020\",\n \"JsonWebSignature2020\",\n \"RsaSignature2018\",\n \"GpgSignature2020\",\n \"JcsEd25519Signature2020\",\n \"BbsBlsSignatureProof2020\",\n \"BbsBlsBoundSignatureProof2020\",\n \"JwtProof2020\",\n \"SdJwtProof2024\",\n \"MsoMdocProof2024\"\n ]\n },\n \"IProofPurpose\": {\n \"type\": \"string\",\n \"enum\": [\n \"verificationMethod\",\n \"assertionMethod\",\n \"authentication\",\n \"keyAgreement\",\n \"contactAgreement\",\n \"capabilityInvocation\",\n \"capabilityDelegation\"\n ]\n },\n \"ICredentialContextType\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"did\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"ICredentialSchemaType\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/ICredentialSchema\"\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"ICredentialSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\"],\n \"additionalProperties\": false\n },\n \"IIssuerId\": {\n \"type\": \"string\"\n },\n \"IIssuer\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\"]\n },\n \"ICredentialStatus\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\", \"type\"]\n },\n \"CompactJWT\": {\n \"type\": \"string\",\n \"description\": \"Represents a Json Web Token in compact form.\"\n },\n \"JwtDecodedVerifiableCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"vc\": {\n \"$ref\": \"#/components/schemas/IVerifiableCredential\"\n },\n \"exp\": {\n \"type\": \"string\"\n },\n \"iss\": {\n \"type\": \"string\"\n },\n \"nbf\": {\n \"type\": \"string\"\n },\n \"sub\": {\n \"type\": \"string\"\n },\n \"jti\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"vc\", \"exp\", \"iss\", \"nbf\", \"sub\", \"jti\"]\n },\n \"SdJwtDecodedVerifiableCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"compactSdJwtVc\": {\n \"type\": \"string\",\n \"description\": \"The compact sd jwt is the sd-jwt encoded as string. It is a normal JWT, with the disclosures and kb-jwt appended separated by ~\"\n },\n \"disclosures\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/SdJwtDisclosure\"\n },\n \"description\": \"The disclosures included within the SD-JWT in both encoded and decoded format. The digests are also included, and allows the disclosures to be linked against the digests in the signed payload.\"\n },\n \"signedPayload\": {\n \"$ref\": \"#/components/schemas/SdJwtSignedVerifiableCredentialPayload\",\n \"description\": \"The signed payload is the payload of the sd-jwt that is actually signed, and that includes the `_sd` and `...` digests.\"\n },\n \"decodedPayload\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredentialPayload\",\n \"description\": \"The decoded payload is the payload when all `_sd` and `...` digests have been replaced by the actual values from the disclosures. This format could also be seen as the 'pretty` version of the SD JWT payload.\\n\\nThis is useful for displaying the contents of the SD JWT VC to the user, or for example for querying the contents of the SD JWT VC using a PEX presentation definition path.\"\n },\n \"kbJwt\": {\n \"type\": \"object\",\n \"properties\": {\n \"header\": {\n \"$ref\": \"#/components/schemas/SdJwtVcKbJwtHeader\"\n },\n \"payload\": {\n \"$ref\": \"#/components/schemas/SdJwtVcKbJwtPayload\"\n },\n \"compact\": {\n \"$ref\": \"#/components/schemas/CompactJWT\"\n }\n },\n \"required\": [\"header\", \"payload\"],\n \"additionalProperties\": false,\n \"description\": \"Key binding JWT\"\n }\n },\n \"required\": [\"compactSdJwtVc\", \"disclosures\", \"signedPayload\", \"decodedPayload\"],\n \"additionalProperties\": false,\n \"description\": \"The decoded SD JWT Verifiable Credential. This representation includes multiple representations of the same SD-JWT, and allows to fully process an SD-JWT, as well as create a presentation SD-JWT (minus the KB-JWT) by removing certain disclosures from the compact SD-JWT.\\n\\nThis representation is useful as it doesn't require a hasher implementation to match the different digests in the signed SD-JWT payload, with the different disclosures.\"\n },\n \"SdJwtDisclosure\": {\n \"type\": \"object\",\n \"properties\": {\n \"encoded\": {\n \"type\": \"string\"\n },\n \"decoded\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedDisclosure\"\n },\n \"digest\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"encoded\", \"decoded\", \"digest\"],\n \"additionalProperties\": false\n },\n \"SdJwtDecodedDisclosure\": {\n \"anyOf\": [\n {\n \"type\": \"array\",\n \"minItems\": 3,\n \"items\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"string\"\n },\n {\n \"$ref\": \"#/components/schemas/JsonValue\"\n }\n ],\n \"maxItems\": 3\n },\n {\n \"type\": \"array\",\n \"minItems\": 2,\n \"items\": [\n {\n \"type\": \"string\"\n },\n {\n \"$ref\": \"#/components/schemas/JsonValue\"\n }\n ],\n \"maxItems\": 2\n }\n ]\n },\n \"JsonValue\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/JsonValue\"\n },\n {\n \"not\": {}\n }\n ]\n }\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/JsonValue\"\n }\n }\n ]\n },\n \"SdJwtSignedVerifiableCredentialPayload\": {\n \"type\": \"object\",\n \"properties\": {\n \"vct\": {\n \"type\": \"string\"\n },\n \"iss\": {\n \"type\": \"string\"\n },\n \"iat\": {\n \"type\": \"number\"\n },\n \"nbf\": {\n \"type\": \"number\"\n },\n \"exp\": {\n \"type\": \"number\"\n },\n \"cnf\": {\n \"type\": \"object\",\n \"properties\": {\n \"jwk\": {},\n \"kid\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false\n },\n \"status\": {\n \"type\": \"object\",\n \"properties\": {\n \"idx\": {\n \"type\": \"number\"\n },\n \"uri\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"idx\", \"uri\"],\n \"additionalProperties\": false\n },\n \"sub\": {\n \"type\": \"string\"\n },\n \"_sd\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"_sd_alg\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/SdJwtJsonValue\"\n },\n {\n \"not\": {}\n },\n {\n \"$ref\": \"#/components/schemas/JsonValue\"\n },\n {\n \"not\": {}\n }\n ]\n },\n \"required\": [\"iat\", \"iss\", \"vct\"],\n \"description\": \"The signed payload of an SD-JWT. Includes fields such as `_sd`, `...` and `_sd_alg`\"\n },\n \"SdJwtJsonValue\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"_sd\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/SdJwtJsonValue\"\n },\n {\n \"not\": {}\n }\n ]\n }\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/SdJwtJsonValue\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"...\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"...\"],\n \"additionalProperties\": false\n }\n ]\n }\n }\n ]\n },\n \"SdJwtDecodedVerifiableCredentialPayload\": {\n \"type\": \"object\",\n \"properties\": {\n \"vct\": {\n \"type\": \"string\"\n },\n \"iss\": {\n \"type\": \"string\"\n },\n \"iat\": {\n \"type\": \"number\"\n },\n \"nbf\": {\n \"type\": \"number\"\n },\n \"exp\": {\n \"type\": \"number\"\n },\n \"cnf\": {\n \"type\": \"object\",\n \"properties\": {\n \"jwk\": {},\n \"kid\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false\n },\n \"status\": {\n \"type\": \"object\",\n \"properties\": {\n \"idx\": {\n \"type\": \"number\"\n },\n \"uri\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"idx\", \"uri\"],\n \"additionalProperties\": false\n },\n \"sub\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"vct\", \"iss\", \"iat\"],\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/JsonValue\"\n },\n {\n \"not\": {}\n }\n ]\n },\n \"description\": \"Decoded 'pretty' SD JWT Verifiable Credential. This representation has all the `_sd` properties removed, and includes the disclosures directly within the payload.\"\n },\n \"SdJwtVcKbJwtHeader\": {\n \"type\": \"object\",\n \"properties\": {\n \"typ\": {\n \"type\": \"string\",\n \"const\": \"kb+jwt\"\n },\n \"alg\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"typ\", \"alg\"]\n },\n \"SdJwtVcKbJwtPayload\": {\n \"type\": \"object\",\n \"properties\": {\n \"iat\": {\n \"type\": \"number\"\n },\n \"aud\": {\n \"type\": \"string\"\n },\n \"nonce\": {\n \"type\": \"string\"\n },\n \"sd_hash\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"iat\", \"aud\", \"nonce\", \"sd_hash\"],\n \"additionalProperties\": {}\n },\n \"MdocOid4vpIssuerSigned\": {\n \"type\": \"string\",\n \"description\": \"Represents a selective disclosure JWT vc in compact form.\"\n },\n \"MdocDocument\": {\n \"$ref\": \"#/components/schemas/com.sphereon.mdoc.data.device.DocumentCbor\"\n },\n \"com.sphereon.mdoc.data.device.DocumentCbor\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {}\n },\n \"HasherSync\": {\n \"$comment\": \"(data: string | ArrayBuffer, alg: string) => Uint8Array\",\n \"type\": \"object\",\n \"properties\": {\n \"namedArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"data\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"$ref\": \"#/components/schemas/ArrayBuffer\"\n }\n ]\n },\n \"alg\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"data\", \"alg\"],\n \"additionalProperties\": false\n }\n }\n },\n \"ArrayBuffer\": {\n \"type\": \"object\",\n \"properties\": {\n \"byteLength\": {\n \"type\": \"number\"\n }\n },\n \"required\": [\"byteLength\"],\n \"additionalProperties\": false\n },\n \"VerificationPolicies\": {\n \"type\": \"object\",\n \"properties\": {\n \"schemaValidation\": {\n \"$ref\": \"#/components/schemas/SchemaValidation\"\n },\n \"credentialStatus\": {\n \"type\": \"boolean\"\n },\n \"expirationDate\": {\n \"type\": \"boolean\"\n },\n \"issuanceDate\": {\n \"type\": \"boolean\"\n }\n },\n \"required\": [\"expirationDate\", \"issuanceDate\"],\n \"additionalProperties\": false\n },\n \"SchemaValidation\": {\n \"type\": \"string\",\n \"enum\": [\"ALWAYS\", \"NEVER\", \"WHEN_PRESENT\"]\n },\n \"VerificationResult\": {\n \"type\": \"object\",\n \"properties\": {\n \"result\": {\n \"type\": \"boolean\"\n },\n \"source\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/WrappedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/WrappedVerifiablePresentation\"\n }\n ]\n },\n \"subResults\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/VerificationSubResult\"\n }\n },\n \"error\": {\n \"type\": \"string\"\n },\n \"errorDetails\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"result\", \"source\", \"subResults\"],\n \"additionalProperties\": false\n },\n \"WrappedVerifiableCredential\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/WrappedW3CVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/WrappedSdJwtVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/WrappedMdocCredential\"\n }\n ]\n },\n \"WrappedW3CVerifiableCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/W3CVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/JwtDecodedVerifiableCredential\"\n }\n ],\n \"description\": \"Original VC that we've received\"\n },\n \"decoded\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/JwtDecodedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/IVerifiableCredential\"\n }\n ],\n \"description\": \"In case of JWT credential it will be the decoded version. In other cases it will be the same as original one\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.JSONLD\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.JWT_ENCODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.JWT_DECODED\"\n }\n ],\n \"description\": \"Type of this credential. Supported types are json-ld, jwt (decoded/encoded)\"\n },\n \"format\": {\n \"type\": \"string\",\n \"enum\": [\"jwt_vc\", \"ldp_vc\", \"ldp\", \"jwt\"],\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"credential\": {\n \"$ref\": \"#/components/schemas/IVerifiableCredential\",\n \"description\": \"Internal stable representation of a Credential\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"credential\"],\n \"additionalProperties\": false\n },\n \"OriginalType.JSONLD\": {\n \"type\": \"string\",\n \"const\": \"json-ld\"\n },\n \"OriginalType.JWT_ENCODED\": {\n \"type\": \"string\",\n \"const\": \"jwt-encoded\"\n },\n \"OriginalType.JWT_DECODED\": {\n \"type\": \"string\",\n \"const\": \"jwt-decoded\"\n },\n \"WrappedSdJwtVerifiableCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/CompactSdJwtVc\"\n }\n ],\n \"description\": \"Original VC that we've received. Can be either the encoded or decoded variant.\"\n },\n \"decoded\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredentialPayload\",\n \"description\": \"Decoded version of the SD-JWT payload. This is the decoded payload, rather than the whole SD-JWT as the `decoded` property is used in e.g. PEX to check for path filters from fields. The full decoded credential can be found in the `credential` field.\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.SD_JWT_VC_DECODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.SD_JWT_VC_ENCODED\"\n }\n ],\n \"description\": \"Type of this credential.\"\n },\n \"format\": {\n \"type\": \"string\",\n \"const\": \"dc+sd-jwt\",\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"credential\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredential\",\n \"description\": \"Internal stable representation of a Credential\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"credential\"],\n \"additionalProperties\": false\n },\n \"CompactSdJwtVc\": {\n \"type\": \"string\",\n \"description\": \"Represents a selective disclosure JWT vc in compact form.\"\n },\n \"OriginalType.SD_JWT_VC_DECODED\": {\n \"type\": \"string\",\n \"const\": \"sd-jwt-vc-decoded\"\n },\n \"OriginalType.SD_JWT_VC_ENCODED\": {\n \"type\": \"string\",\n \"const\": \"sd-jwt-vc-encoded\"\n },\n \"WrappedMdocCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/MdocDocument\"\n },\n {\n \"$ref\": \"#/components/schemas/MdocOid4vpIssuerSigned\"\n }\n ],\n \"description\": \"Original IssuerSigned to Mdoc that we've received. Can be either the encoded or decoded variant.\"\n },\n \"decoded\": {\n \"$ref\": \"#/components/schemas/MdocDecodedPayload\",\n \"description\": \"Record where keys are the namespaces and the values are objects again with the namespace values\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.MSO_MDOC_DECODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.MSO_MDOC_ENCODED\"\n }\n ],\n \"description\": \"Type of this credential.\"\n },\n \"format\": {\n \"type\": \"string\",\n \"const\": \"mso_mdoc\",\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"credential\": {\n \"$ref\": \"#/components/schemas/MdocDocument\",\n \"description\": \"Internal stable representation of a Credential\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"credential\"],\n \"additionalProperties\": false\n },\n \"MdocDecodedPayload\": {\n \"$ref\": \"#/components/schemas/Record<string,Record<string,(string|number|boolean)>>\",\n \"description\": \"Record where keys are the namespaces and the values are objects again with the namespace values\"\n },\n \"Record<string,Record<string,(string|number|boolean)>>\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/components/schemas/Record<string,(string|number|boolean)>\"\n }\n },\n \"Record<string,(string|number|boolean)>\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": [\"string\", \"number\", \"boolean\"]\n }\n },\n \"OriginalType.MSO_MDOC_DECODED\": {\n \"type\": \"string\",\n \"const\": \"mso_mdoc-decoded\"\n },\n \"OriginalType.MSO_MDOC_ENCODED\": {\n \"type\": \"string\",\n \"const\": \"mso_mdoc-encoded\"\n },\n \"WrappedVerifiablePresentation\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/WrappedW3CVerifiablePresentation\"\n },\n {\n \"$ref\": \"#/components/schemas/WrappedSdJwtVerifiablePresentation\"\n },\n {\n \"$ref\": \"#/components/schemas/WrappedMdocPresentation\"\n }\n ]\n },\n \"WrappedW3CVerifiablePresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/W3CVerifiablePresentation\"\n },\n {\n \"$ref\": \"#/components/schemas/JwtDecodedVerifiablePresentation\"\n }\n ],\n \"description\": \"Original VP that we've received\"\n },\n \"decoded\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/JwtDecodedVerifiablePresentation\"\n },\n {\n \"$ref\": \"#/components/schemas/IVerifiablePresentation\"\n }\n ],\n \"description\": \"In case of JWT VP it will be the decoded version. In other cases it will be the same as original one\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.JSONLD\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.JWT_ENCODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.JWT_DECODED\"\n }\n ],\n \"description\": \"Type of this Presentation. Supported types are json-ld and jwt (decoded/encoded) and sd-jwt-vc (decoded/encoded)\"\n },\n \"format\": {\n \"type\": \"string\",\n \"enum\": [\"jwt_vp\", \"ldp_vp\"],\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"presentation\": {\n \"$ref\": \"#/components/schemas/UniformVerifiablePresentation\",\n \"description\": \"Internal stable representation of a Presentation without proofs, created based on https://www.w3.org/TR/vc-data-model/#jwt-decoding\"\n },\n \"vcs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/WrappedW3CVerifiableCredential\"\n },\n \"description\": \"Wrapped Verifiable Credentials belonging to the Presentation\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"presentation\", \"vcs\"],\n \"additionalProperties\": false\n },\n \"W3CVerifiablePresentation\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IVerifiablePresentation\"\n },\n {\n \"$ref\": \"#/components/schemas/CompactJWT\"\n }\n ],\n \"description\": \"Represents a signed Verifiable Presentation (includes proof), in either JSON or compact JWT format. See {@link https://www.w3.org/TR/vc-data-model/#presentations | VC data model } See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats }\"\n },\n \"IVerifiablePresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"proof\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IProof\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IProof\"\n }\n }\n ]\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"@context\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n }\n }\n ]\n },\n \"type\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n ]\n },\n \"verifiableCredential\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/W3CVerifiableCredential\"\n }\n },\n \"presentation_submission\": {\n \"$ref\": \"#/components/schemas/PresentationSubmission\"\n },\n \"holder\": {\n \"type\": \"string\"\n },\n \"verifier\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"@context\", \"proof\"]\n },\n \"PresentationSubmission\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"A UUID or some other unique ID to identify this Presentation Submission\"\n },\n \"definition_id\": {\n \"type\": \"string\",\n \"description\": \"A UUID or some other unique ID to identify this Presentation Definition\"\n },\n \"descriptor_map\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Descriptor\"\n },\n \"description\": \"List of descriptors of how the claims are being mapped to presentation definition\"\n }\n },\n \"required\": [\"id\", \"definition_id\", \"descriptor_map\"],\n \"additionalProperties\": false,\n \"description\": \"It expresses how the inputs are presented as proofs to a Verifier.\"\n },\n \"Descriptor\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"ID to identify the descriptor from Presentation Definition Input Descriptor it coresponds to.\"\n },\n \"path\": {\n \"type\": \"string\",\n \"description\": \"The path where the verifiable credential is located in the presentation submission json\"\n },\n \"path_nested\": {\n \"$ref\": \"#/components/schemas/Descriptor\"\n },\n \"format\": {\n \"type\": \"string\",\n \"description\": \"The Proof or JWT algorith that the proof is in\"\n }\n },\n \"required\": [\"id\", \"path\", \"format\"],\n \"additionalProperties\": false,\n \"description\": \"descriptor map laying out the structure of the presentation submission.\"\n },\n \"JwtDecodedVerifiablePresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"vp\": {\n \"$ref\": \"#/components/schemas/IVerifiablePresentation\"\n },\n \"exp\": {\n \"type\": \"string\"\n },\n \"iss\": {\n \"type\": \"string\"\n },\n \"nbf\": {\n \"type\": \"string\"\n },\n \"sub\": {\n \"type\": \"string\"\n },\n \"jti\": {\n \"type\": \"string\"\n },\n \"aud\": {\n \"type\": \"string\"\n },\n \"iat\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"vp\", \"exp\", \"iss\", \"nbf\", \"sub\", \"jti\", \"aud\", \"iat\"]\n },\n \"UniformVerifiablePresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"@context\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n }\n }\n ]\n },\n \"type\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n ]\n },\n \"verifiableCredential\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/WrappedW3CVerifiableCredential\"\n }\n },\n \"presentation_submission\": {\n \"$ref\": \"#/components/schemas/PresentationSubmission\"\n },\n \"holder\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"@context\", \"type\", \"verifiableCredential\"],\n \"additionalProperties\": false\n },\n \"WrappedSdJwtVerifiablePresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/CompactSdJwtVc\"\n }\n ],\n \"description\": \"Original VP that we've received. Can be either the encoded or decoded variant.\"\n },\n \"decoded\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredentialPayload\",\n \"description\": \"Decoded version of the SD-JWT payload. This is the decoded payload, rather than the whole SD-JWT.\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.SD_JWT_VC_DECODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.SD_JWT_VC_ENCODED\"\n }\n ],\n \"description\": \"Type of this Presentation.\"\n },\n \"format\": {\n \"type\": \"string\",\n \"const\": \"dc+sd-jwt\",\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"presentation\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredential\",\n \"description\": \"Internal stable representation of a Presentation\"\n },\n \"vcs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/WrappedSdJwtVerifiableCredential\"\n },\n \"minItems\": 1,\n \"maxItems\": 1,\n \"description\": \"Wrapped Verifiable Credentials belonging to the Presentation. Will always be an array with a single SdJwtVerifiableCredential entry.\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"presentation\", \"vcs\"],\n \"additionalProperties\": false\n },\n \"WrappedMdocPresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/MdocDeviceResponse\"\n },\n {\n \"$ref\": \"#/components/schemas/MdocOid4vpMdocVpToken\"\n }\n ],\n \"description\": \"Original VP that we've received. Can be either the encoded or decoded variant.\"\n },\n \"decoded\": {\n \"$ref\": \"#/components/schemas/MdocDeviceResponse\",\n \"description\": \"Decoded version of the SD-JWT payload. This is the decoded payload, rather than the whole SD-JWT.\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.MSO_MDOC_ENCODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.MSO_MDOC_DECODED\"\n }\n ],\n \"description\": \"Type of this Presentation.\"\n },\n \"format\": {\n \"type\": \"string\",\n \"const\": \"mso_mdoc\",\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"presentation\": {\n \"$ref\": \"#/components/schemas/MdocDeviceResponse\",\n \"description\": \"Internal stable representation of a Presentation\"\n },\n \"vcs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/WrappedMdocCredential\"\n },\n \"description\": \"Wrapped Mdocs belonging to the Presentation. There can be multiple documents in a single device response\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"presentation\", \"vcs\"],\n \"additionalProperties\": false\n },\n \"MdocDeviceResponse\": {\n \"$ref\": \"#/components/schemas/com.sphereon.mdoc.data.device.DeviceResponseCbor\"\n },\n \"com.sphereon.mdoc.data.device.DeviceResponseCbor\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {}\n },\n \"MdocOid4vpMdocVpToken\": {\n \"type\": \"string\"\n },\n \"VerificationSubResult\": {\n \"type\": \"object\",\n \"properties\": {\n \"result\": {\n \"type\": \"boolean\"\n },\n \"error\": {\n \"type\": \"string\"\n },\n \"errorDetails\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"result\"],\n \"additionalProperties\": false\n },\n \"VerifyMdocCredentialArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credential\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"credential\"],\n \"additionalProperties\": false\n },\n \"ValidateSchemaArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credential\": {\n \"$ref\": \"#/components/schemas/OriginalVerifiableCredential\"\n },\n \"validationPolicy\": {\n \"$ref\": \"#/components/schemas/SchemaValidation\"\n },\n \"hasher\": {\n \"$ref\": \"#/components/schemas/HasherSync\"\n }\n },\n \"required\": [\"credential\"],\n \"additionalProperties\": false\n },\n \"VerifySDJWTCredentialArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credential\": {\n \"type\": \"string\"\n },\n \"hasher\": {\n \"$ref\": \"#/components/schemas/HasherSync\"\n }\n },\n \"required\": [\"credential\"],\n \"additionalProperties\": false\n },\n \"VerifyW3CCredentialArgs\": {\n \"type\": \"object\",\n \"additionalProperties\": false\n }\n },\n \"methods\": {\n \"cvVerifyCredential\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/VerifyCredentialArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerificationResult\"\n }\n },\n \"cvVerifyMdoc\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/VerifyMdocCredentialArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerificationResult\"\n }\n },\n \"cvVerifySchema\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/ValidateSchemaArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerificationResult\"\n }\n },\n \"cvVerifySDJWTCredential\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/VerifySDJWTCredentialArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerificationResult\"\n }\n },\n \"cvVerifyW3CCredential\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/VerifyW3CCredentialArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerificationResult\"\n }\n }\n }\n }\n }\n}\n","/**\n * @public\n */\nconst schema = require('../plugin.schema.json')\nexport { schema }\nexport { CredentialValidation, credentialValidationMethods } from './agent/CredentialValidation'\nexport * from './types/ICredentialValidation'\n","import mdocPkg from '@sphereon/kmp-mdoc-core'\nimport { IVerifySdJwtVcResult } from '@sphereon/ssi-sdk.sd-jwt'\nimport {\n CredentialMapper,\n ICredentialSchemaType,\n IVerifyResult,\n OriginalVerifiableCredential,\n WrappedVerifiableCredential,\n} from '@sphereon/ssi-types'\nimport { IAgentPlugin, IVerifyCredentialArgs, W3CVerifiableCredential as VeramoW3CVerifiableCredential } from '@veramo/core'\nimport addFormats from 'ajv-formats'\nimport Ajv2020 from 'ajv/dist/2020.js'\nimport fetch from 'cross-fetch'\nimport {\n CredentialVerificationError,\n ICredentialValidation,\n RequiredContext,\n schema,\n SchemaValidation,\n ValidateSchemaArgs,\n VerificationResult,\n VerificationSubResult,\n VerifyCredentialArgs,\n VerifyMdocCredentialArgs,\n VerifySDJWTCredentialArgs,\n} from '../index'\nimport IVerifySignatureResult = mdocPkg.com.sphereon.crypto.generic.IVerifySignatureResult\nimport ICoseKeyJson = mdocPkg.com.sphereon.crypto.cose.ICoseKeyJson\nimport decodeFrom = mdocPkg.com.sphereon.kmp.decodeFrom\nimport IssuerSignedCbor = mdocPkg.com.sphereon.mdoc.data.device.IssuerSignedCbor\nimport { defaultHasher } from '@sphereon/ssi-sdk.core'\n\n// Exposing the methods here for any REST implementation\nexport const credentialValidationMethods: Array<string> = [\n 'cvVerifyCredential',\n 'cvVerifySchema',\n 'cvVerifyMdoc',\n 'cvVerifySDJWTCredential',\n 'cvVerifyW3CCredential',\n]\n\n/**\n * {@inheritDoc ICredentialValidation}\n */\nexport class CredentialValidation implements IAgentPlugin {\n readonly schema = schema.ICredentialValidation\n readonly methods: ICredentialValidation = {\n cvVerifyCredential: this.cvVerifyCredential.bind(this),\n cvVerifySchema: this.cvVerifySchema.bind(this),\n cvVerifyMdoc: this.cvVerifyMdoc.bind(this),\n cvVerifySDJWTCredential: this.cvVerifySDJWTCredential.bind(this),\n cvVerifyW3CCredential: this.cvVerifyW3CCredential.bind(this),\n }\n\n private detectSchemas(wrappedVC: WrappedVerifiableCredential): ICredentialSchemaType[] | undefined {\n if ('credential' in wrappedVC) {\n const { credential } = wrappedVC\n\n if ('credentialSchema' in credential) {\n const { credentialSchema } = credential\n\n if (Array.isArray(credentialSchema)) {\n return credentialSchema\n } else if (credentialSchema) {\n return [credentialSchema]\n }\n }\n }\n\n return undefined\n }\n\n private async cvVerifyCredential(args: VerifyCredentialArgs, context: RequiredContext): Promise<VerificationResult> {\n const { credential, hasher = defaultHasher, policies } = args\n // defaulting the schema validation to when_present\n const schemaResult = await this.cvVerifySchema({\n credential,\n validationPolicy: policies?.schemaValidation ?? SchemaValidation.WHEN_PRESENT,\n hasher,\n })\n if (!schemaResult.result) {\n return schemaResult\n }\n if (CredentialMapper.isMsoMdocOid4VPEncoded(credential)) {\n return await this.cvVerifyMdoc({ credential }, context)\n } else if (CredentialMapper.isSdJwtEncoded(credential)) {\n return await this.cvVerifySDJWTCredential({ credential, hasher }, context)\n } else {\n return await this.cvVerifyW3CCredential(\n {\n ...args,\n credential: credential as VeramoW3CVerifiableCredential,\n },\n context,\n )\n }\n }\n\n private async cvVerifySchema(args: ValidateSchemaArgs): Promise<VerificationResult> {\n const { credential, hasher = defaultHasher, validationPolicy } = args\n const wrappedCredential: WrappedVerifiableCredential = CredentialMapper.toWrappedVerifiableCredential(credential, { hasher })\n if (validationPolicy === SchemaValidation.NEVER) {\n return {\n result: true,\n source: wrappedCredential,\n subResults: [],\n }\n }\n return this.validateSchema(wrappedCredential, validationPolicy)\n }\n\n private async validateSchema(wrappedVC: WrappedVerifiableCredential, validationPolicy?: SchemaValidation): Promise<VerificationResult> {\n const schemas: ICredentialSchemaType[] | undefined = this.detectSchemas(wrappedVC)\n if (!schemas) {\n if (validationPolicy === SchemaValidation.ALWAYS) {\n console.error(\n `No schema found for credential, but validation policy is set to ALWAYS. Returning false. Credential: ${JSON.stringify(wrappedVC.credential, null, 2)}`,\n )\n return {\n result: false,\n source: wrappedVC,\n subResults: [],\n }\n } else {\n return {\n result: true,\n source: wrappedVC,\n subResults: [],\n }\n }\n }\n\n const subResults: VerificationSubResult[] = await Promise.all(schemas.map((schema) => this.verifyCredentialAgainstSchema(wrappedVC, schema)))\n\n return {\n result: subResults.every((subResult) => subResult.result),\n source: wrappedVC,\n subResults,\n }\n }\n\n private async fetchSchema(uri: string) {\n const response = await fetch(uri)\n if (!response.ok) {\n throw new Error(`Unable to fetch schema from ${uri}`)\n }\n return response.json()\n }\n\n private async verifyCredentialAgainstSchema(wrappedVC: WrappedVerifiableCredential, schema: ICredentialSchemaType): Promise<VerificationSubResult> {\n const schemaUrl: string = typeof schema === 'string' ? schema : schema.id\n let schemaValue\n try {\n schemaValue = await this.fetchSchema(schemaUrl)\n } catch (error) {\n console.error(error)\n return {\n result: false,\n error: error,\n }\n }\n\n const ajv = new Ajv2020({ loadSchema: this.fetchSchema })\n addFormats(ajv)\n\n const validate = await ajv.compileAsync(schemaValue)\n const valid = validate(wrappedVC.credential)\n if (!valid) {\n console.error(`Schema validation failed for `, wrappedVC.credential)\n }\n return {\n result: valid,\n }\n }\n\n private async cvVerifyMdoc(args: VerifyMdocCredentialArgs, context: RequiredContext): Promise<VerificationResult> {\n const { credential } = args\n\n const rawBytes = decodeFrom(credential, mdocPkg.com.sphereon.kmp.Encoding.BASE64URL)\n // Stash raw mdoc bytes so @sphereon/ssi-sdk.mdl-mdoc's verify1Async can rebuild Sig_structure\n // from the untouched protected/payload bytes, working around the kmp-mdoc-core UTF-8 string\n // round-trip that corrupts binary protected-header values (e.g. a bstr kid).\n const u8Raw: Uint8Array =\n rawBytes instanceof Uint8Array\n ? rawBytes\n : ArrayBuffer.isView(rawBytes)\n ? new Uint8Array((rawBytes as ArrayBufferView).buffer, (rawBytes as ArrayBufferView).byteOffset, (rawBytes as ArrayBufferView).byteLength)\n : Uint8Array.from((rawBytes as unknown as number[]).map((b) => b & 0xff))\n const g = globalThis as unknown as { __sphereon_mdoc_raw_bytes?: Uint8Array }\n const prevRaw = g.__sphereon_mdoc_raw_bytes\n g.__sphereon_mdoc_raw_bytes = u8Raw\n let verification: IVerifySignatureResult<ICoseKeyJson>\n try {\n const issuerSigned = IssuerSignedCbor.Static.cborDecode(rawBytes)\n verification = await context.agent.mdocVerifyIssuerSigned({ input: issuerSigned.toJson().issuerAuth }).catch((error: Error) => {\n console.error(error)\n return {\n name: 'mdoc',\n critical: true,\n error: true,\n message: error.message ?? 'Mdoc Issuer Signed VC could not be verified',\n } satisfies IVerifySignatureResult<ICoseKeyJson>\n })\n } finally {\n g.__sphereon_mdoc_raw_bytes = prevRaw\n }\n\n return {\n source: CredentialMapper.toWrappedVerifiableCredential(credential as OriginalVerifiableCredential, { hasher: defaultHasher }),\n result: !verification.error,\n subResults: [],\n ...(verification.error && {\n error: verification.message ?? `Could not verify mdoc from issuer`,\n }),\n }\n }\n\n private async cvVerifyW3CCredential(args: IVerifyCredentialArgs, context: RequiredContext): Promise<VerificationResult> {\n // We also allow/add boolean, because 4.x Veramo returns a boolean for JWTs. 5.X will return better results\n const { credential, policies } = args\n\n const result: IVerifyResult | boolean = (await context.agent.verifyCredential(args)) as IVerifyResult | boolean\n\n if (typeof result === 'boolean') {\n return {\n // FIXME the source is never used, need to start using this as the source of truth\n source: CredentialMapper.toWrappedVerifiableCredential(args.credential as OriginalVerifiableCredential, { hasher: defaultHasher }),\n result,\n ...(!result && {\n error: 'Invalid JWT VC',\n errorDetails: `JWT VC was not valid with policies: ${JSON.stringify(policies)}`,\n }),\n subResults: [],\n }\n } else {\n // TODO look at what this is doing and make it simple and readable\n let error: string | undefined\n let errorDetails: string | undefined\n const subResults: Array<VerificationSubResult> = []\n if (result.error) {\n error = result.error?.message ?? ''\n errorDetails = result.error?.details?.code ?? ''\n errorDetails = (errorDetails !== '' ? `${errorDetails}, ` : '') + (result.error?.details?.url ?? '')\n if (result.error?.errors) {\n error = (error !== '' ? `${error}, ` : '') + result.error?.errors?.map((error) => error.message ?? error.name).join(', ')\n errorDetails =\n (errorDetails !== '' ? `${errorDetails}, ` : '') +\n result.error?.errors?.map((error) => (error?.details?.code ? `${error.details.code}, ` : '') + (error?.details?.url ?? '')).join(', ')\n }\n console.error(error)\n }\n\n return {\n source: CredentialMapper.toWrappedVerifiableCredential(credential as OriginalVerifiableCredential, { hasher: defaultHasher }),\n result: result.verified,\n subResults,\n error,\n errorDetails,\n }\n }\n }\n\n private async cvVerifySDJWTCredential(args: VerifySDJWTCredentialArgs, context: RequiredContext): Promise<VerificationResult> {\n const { credential, hasher = defaultHasher } = args\n\n const verification: IVerifySdJwtVcResult | CredentialVerificationError = await context.agent\n .verifySdJwtVc({ credential })\n .catch((error: Error): CredentialVerificationError => {\n console.error(error)\n return {\n error: 'Invalid SD-JWT VC',\n errorDetails: error.message ?? 'SD-JWT VC could not be verified',\n }\n })\n\n const result = 'header' in verification && 'payload' in verification\n return {\n source: CredentialMapper.toWrappedVerifiableCredential(credential as OriginalVerifiableCredential, { hasher: hasher ?? defaultHasher }),\n result,\n subResults: [],\n ...(!result && { ...verification }),\n }\n }\n}\n","import { IAgentContext, ICredentialVerifier, IPluginMethodMap } from '@veramo/core'\nimport { HasherSync, WrappedVerifiableCredential, WrappedVerifiablePresentation } from '@sphereon/ssi-types'\nimport { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc'\nimport { OriginalVerifiableCredential } from '@sphereon/ssi-types'\n\nexport interface ICredentialValidation extends IPluginMethodMap {\n cvVerifyCredential(args: VerifyCredentialArgs, context: RequiredContext): Promise<VerificationResult>\n cvVerifySchema(args: ValidateSchemaArgs): Promise<VerificationResult>\n cvVerifyMdoc(args: VerifyMdocCredentialArgs, context: RequiredContext): Promise<VerificationResult>\n cvVerifySDJWTCredential(args: VerifySDJWTCredentialArgs, context: RequiredContext): Promise<VerificationResult>\n cvVerifyW3CCredential(args: VerifyW3CCredentialArgs, context: RequiredContext): Promise<VerificationResult>\n}\n\nexport enum SchemaValidation {\n ALWAYS = 'ALWAYS',\n NEVER = 'NEVER',\n WHEN_PRESENT = 'WHEN_PRESENT',\n}\n\nexport type VerifyCredentialArgs = {\n credential: OriginalVerifiableCredential\n hasher?: HasherSync\n fetchRemoteContexts: boolean\n policies?: VerificationPolicies\n}\n\nexport type VerificationPolicies = {\n schemaValidation?: SchemaValidation\n credentialStatus?: boolean\n expirationDate: boolean\n issuanceDate: boolean\n}\n\nexport type ValidateSchemaArgs = {\n credential: OriginalVerifiableCredential\n validationPolicy?: SchemaValidation\n hasher?: HasherSync\n}\n\nexport type VerifyMdocCredentialArgs = { credential: string }\n\nexport type VerifySDJWTCredentialArgs = {\n credential: string\n hasher?: HasherSync\n}\n\nexport type VerifyW3CCredentialArgs = {}\n\nexport type VerificationResult = {\n result: boolean\n source: WrappedVerifiableCredential | WrappedVerifiablePresentation\n subResults: Array<VerificationSubResult>\n error?: string | undefined\n errorDetails?: string\n}\n\nexport type VerificationSubResult = {\n result: boolean\n error?: string\n errorDetails?: string\n}\n\nexport type CredentialVerificationError = {\n error?: string\n errorDetails?: string\n}\n\nexport type RequiredContext = IAgentContext<ImDLMdoc & ICredentialVerifier>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,gCAAAA,SAAA;AAAA,IAAAA,QAAA;AAAA,MACE,uBAAyB;AAAA,QACvB,YAAc;AAAA,UACZ,SAAW;AAAA,YACT,sBAAwB;AAAA,cACtB,MAAQ;AAAA,cACR,YAAc;AAAA,gBACZ,YAAc;AAAA,kBACZ,MAAQ;AAAA,gBACV;AAAA,gBACA,QAAU;AAAA,kBACR,MAAQ;AAAA,gBACV;AAAA,gBACA,qBAAuB;AAAA,kBACrB,MAAQ;AAAA,gBACV;AAAA,gBACA,UAAY;AAAA,kBACV,MAAQ;AAAA,gBACV;AAAA,cACF;AAAA,cACA,UAAY,CAAC,cAAc,qBAAqB;AAAA,cAChD,sBAAwB;AAAA,YAC1B;AAAA,YACA,8BAAgC;AAAA,cAC9B,OAAS;AAAA,gBACP;AAAA,kBACE,MAAQ;AAAA,gBACV;AAAA,gBACA;AAAA,kBACE,MAAQ;AAAA,gBACV;AAAA,gBACA;AAAA,kBACE,MAAQ;AAAA,gBACV;AAAA,gBACA;AAAA,kBACE,MAAQ;AAAA,gBACV;AAAA,gB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IACF,CAAA;AAEF,UAAMtE,SAAS,YAAY0D,gBAAgB,aAAaA;AACxD,WAAO;MACLnD,QAAQN,kCAAiBI,8BAA8BpB,YAA4C;QAAEO,QAAQA,UAAUC;MAAc,CAAA;MACrIO;MACAQ,YAAY,CAAA;MACZ,GAAI,CAACR,UAAU;QAAE,GAAG0D;MAAa;IACnC;EACF;AACF;;;AC9QO,IAAKsB,mBAAAA,0BAAAA,mBAAAA;;;;SAAAA;;;;AFVZ,IAAMC,SAASC;","names":["module","decodeFrom","mdocPkg","IssuerSignedCbor","credentialValidationMethods","CredentialValidation","schema","ICredentialValidation","methods","cvVerifyCredential","bind","cvVerifySchema","cvVerifyMdoc","cvVerifySDJWTCredential","cvVerifyW3CCredential","detectSchemas","wrappedVC","credential","credentialSchema","Array","isArray","undefined","args","context","hasher","defaultHasher","policies","schemaResult","validationPolicy","schemaValidation","SchemaValidation","WHEN_PRESENT","result","CredentialMapper","isMsoMdocOid4VPEncoded","isSdJwtEncoded","wrappedCredential","toWrappedVerifiableCredential","NEVER","source","subResults","validateSchema","schemas","ALWAYS","console","error","JSON","stringify","Promise","all","map","verifyCredentialAgainstSchema","every","subResult","fetchSchema","uri","response","fetch","ok","Error","json","schemaUrl","id","schemaValue","ajv","Ajv2020","loadSchema","addFormats","validate","compileAsync","valid","rawBytes","com","sphereon","kmp","Encoding","BASE64URL","u8Raw","Uint8Array","ArrayBuffer","isView","buffer","byteOffset","byteLength","from","b","g","globalThis","prevRaw","__sphereon_mdoc_raw_bytes","verification","issuerSigned","Static","cborDecode","agent","mdocVerifyIssuerSigned","input","toJson","issuerAuth","catch","name","critical","message","verifyCredential","errorDetails","details","code","url","errors","join","verified","verifySdJwtVc","SchemaValidation","schema","require"]}
1
+ {"version":3,"sources":["../plugin.schema.json","../src/index.ts","../src/agent/CredentialValidation.ts","../src/types/ICredentialValidation.ts"],"sourcesContent":["{\n \"ICredentialValidation\": {\n \"components\": {\n \"schemas\": {\n \"VerifyCredentialArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credential\": {\n \"$ref\": \"#/components/schemas/OriginalVerifiableCredential\"\n },\n \"hasher\": {\n \"$ref\": \"#/components/schemas/HasherSync\"\n },\n \"fetchRemoteContexts\": {\n \"type\": \"boolean\"\n },\n \"policies\": {\n \"$ref\": \"#/components/schemas/VerificationPolicies\"\n }\n },\n \"required\": [\"credential\", \"fetchRemoteContexts\"],\n \"additionalProperties\": false\n },\n \"OriginalVerifiableCredential\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/W3CVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/JwtDecodedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/MdocOid4vpIssuerSigned\"\n },\n {\n \"$ref\": \"#/components/schemas/MdocDocument\"\n }\n ]\n },\n \"W3CVerifiableCredential\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/CompactJWT\"\n }\n ],\n \"description\": \"Represents a signed Verifiable Credential (includes proof), in either JSON, compact JWT or compact SD-JWT VC format. See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model } See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats }\"\n },\n \"IVerifiableCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"proof\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IProof\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IProof\"\n }\n }\n ]\n },\n \"@context\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n }\n }\n ]\n },\n \"type\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"credentialSchema\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/ICredentialSchemaType\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialSchemaType\"\n }\n }\n ]\n },\n \"issuer\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IIssuerId\"\n },\n {\n \"$ref\": \"#/components/schemas/IIssuer\"\n }\n ]\n },\n \"issuanceDate\": {\n \"type\": \"string\"\n },\n \"credentialSubject\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n }\n }\n }\n }\n ]\n },\n \"expirationDate\": {\n \"type\": \"string\"\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"credentialStatus\": {\n \"$ref\": \"#/components/schemas/ICredentialStatus\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"@context\", \"credentialSubject\", \"issuanceDate\", \"issuer\", \"proof\", \"type\"]\n },\n \"IProof\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IProofType\"\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"created\": {\n \"type\": \"string\"\n },\n \"proofPurpose\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IProofPurpose\"\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"verificationMethod\": {\n \"type\": \"string\"\n },\n \"challenge\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"proofValue\": {\n \"type\": \"string\"\n },\n \"jws\": {\n \"type\": \"string\"\n },\n \"jwt\": {\n \"type\": \"string\"\n },\n \"mso_mdoc\": {\n \"type\": \"string\"\n },\n \"nonce\": {\n \"type\": \"string\"\n },\n \"requiredRevealStatements\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\"type\", \"created\", \"proofPurpose\", \"verificationMethod\"]\n },\n \"IProofType\": {\n \"type\": \"string\",\n \"enum\": [\n \"Ed25519Signature2018\",\n \"Ed25519Signature2020\",\n \"EcdsaSecp256k1Signature2019\",\n \"EcdsaSecp256k1RecoverySignature2020\",\n \"JsonWebSignature2020\",\n \"RsaSignature2018\",\n \"GpgSignature2020\",\n \"JcsEd25519Signature2020\",\n \"BbsBlsSignatureProof2020\",\n \"BbsBlsBoundSignatureProof2020\",\n \"JwtProof2020\",\n \"SdJwtProof2024\",\n \"MsoMdocProof2024\"\n ]\n },\n \"IProofPurpose\": {\n \"type\": \"string\",\n \"enum\": [\n \"verificationMethod\",\n \"assertionMethod\",\n \"authentication\",\n \"keyAgreement\",\n \"contactAgreement\",\n \"capabilityInvocation\",\n \"capabilityDelegation\"\n ]\n },\n \"ICredentialContextType\": {\n \"anyOf\": [\n {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"did\": {\n \"type\": \"string\"\n }\n }\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"ICredentialSchemaType\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/ICredentialSchema\"\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"ICredentialSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\"],\n \"additionalProperties\": false\n },\n \"IIssuerId\": {\n \"type\": \"string\"\n },\n \"IIssuer\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\"]\n },\n \"ICredentialStatus\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\", \"type\"]\n },\n \"CompactJWT\": {\n \"type\": \"string\",\n \"description\": \"Represents a Json Web Token in compact form.\"\n },\n \"JwtDecodedVerifiableCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"vc\": {\n \"$ref\": \"#/components/schemas/IVerifiableCredential\"\n },\n \"exp\": {\n \"type\": \"string\"\n },\n \"iss\": {\n \"type\": \"string\"\n },\n \"nbf\": {\n \"type\": \"string\"\n },\n \"sub\": {\n \"type\": \"string\"\n },\n \"jti\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"vc\", \"exp\", \"iss\", \"nbf\", \"sub\", \"jti\"]\n },\n \"SdJwtDecodedVerifiableCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"compactSdJwtVc\": {\n \"type\": \"string\",\n \"description\": \"The compact sd jwt is the sd-jwt encoded as string. It is a normal JWT, with the disclosures and kb-jwt appended separated by ~\"\n },\n \"disclosures\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/SdJwtDisclosure\"\n },\n \"description\": \"The disclosures included within the SD-JWT in both encoded and decoded format. The digests are also included, and allows the disclosures to be linked against the digests in the signed payload.\"\n },\n \"signedPayload\": {\n \"$ref\": \"#/components/schemas/SdJwtSignedVerifiableCredentialPayload\",\n \"description\": \"The signed payload is the payload of the sd-jwt that is actually signed, and that includes the `_sd` and `...` digests.\"\n },\n \"decodedPayload\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredentialPayload\",\n \"description\": \"The decoded payload is the payload when all `_sd` and `...` digests have been replaced by the actual values from the disclosures. This format could also be seen as the 'pretty` version of the SD JWT payload.\\n\\nThis is useful for displaying the contents of the SD JWT VC to the user, or for example for querying the contents of the SD JWT VC using a PEX presentation definition path.\"\n },\n \"kbJwt\": {\n \"type\": \"object\",\n \"properties\": {\n \"header\": {\n \"$ref\": \"#/components/schemas/SdJwtVcKbJwtHeader\"\n },\n \"payload\": {\n \"$ref\": \"#/components/schemas/SdJwtVcKbJwtPayload\"\n },\n \"compact\": {\n \"$ref\": \"#/components/schemas/CompactJWT\"\n }\n },\n \"required\": [\"header\", \"payload\"],\n \"additionalProperties\": false,\n \"description\": \"Key binding JWT\"\n }\n },\n \"required\": [\"compactSdJwtVc\", \"disclosures\", \"signedPayload\", \"decodedPayload\"],\n \"additionalProperties\": false,\n \"description\": \"The decoded SD JWT Verifiable Credential. This representation includes multiple representations of the same SD-JWT, and allows to fully process an SD-JWT, as well as create a presentation SD-JWT (minus the KB-JWT) by removing certain disclosures from the compact SD-JWT.\\n\\nThis representation is useful as it doesn't require a hasher implementation to match the different digests in the signed SD-JWT payload, with the different disclosures.\"\n },\n \"SdJwtDisclosure\": {\n \"type\": \"object\",\n \"properties\": {\n \"encoded\": {\n \"type\": \"string\"\n },\n \"decoded\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedDisclosure\"\n },\n \"digest\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"encoded\", \"decoded\", \"digest\"],\n \"additionalProperties\": false\n },\n \"SdJwtDecodedDisclosure\": {\n \"anyOf\": [\n {\n \"type\": \"array\",\n \"minItems\": 3,\n \"items\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"string\"\n },\n {\n \"$ref\": \"#/components/schemas/JsonValue\"\n }\n ],\n \"maxItems\": 3\n },\n {\n \"type\": \"array\",\n \"minItems\": 2,\n \"items\": [\n {\n \"type\": \"string\"\n },\n {\n \"$ref\": \"#/components/schemas/JsonValue\"\n }\n ],\n \"maxItems\": 2\n }\n ]\n },\n \"JsonValue\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/JsonValue\"\n },\n {\n \"not\": {}\n }\n ]\n }\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/JsonValue\"\n }\n }\n ]\n },\n \"SdJwtSignedVerifiableCredentialPayload\": {\n \"type\": \"object\",\n \"properties\": {\n \"vct\": {\n \"type\": \"string\"\n },\n \"iss\": {\n \"type\": \"string\"\n },\n \"iat\": {\n \"type\": \"number\"\n },\n \"nbf\": {\n \"type\": \"number\"\n },\n \"exp\": {\n \"type\": \"number\"\n },\n \"cnf\": {\n \"type\": \"object\",\n \"properties\": {\n \"jwk\": {},\n \"kid\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false\n },\n \"status\": {\n \"type\": \"object\",\n \"properties\": {\n \"idx\": {\n \"type\": \"number\"\n },\n \"uri\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"idx\", \"uri\"],\n \"additionalProperties\": false\n },\n \"sub\": {\n \"type\": \"string\"\n },\n \"_sd\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"_sd_alg\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/SdJwtJsonValue\"\n },\n {\n \"not\": {}\n },\n {\n \"$ref\": \"#/components/schemas/JsonValue\"\n },\n {\n \"not\": {}\n }\n ]\n },\n \"required\": [\"iat\", \"iss\", \"vct\"],\n \"description\": \"The signed payload of an SD-JWT. Includes fields such as `_sd`, `...` and `_sd_alg`\"\n },\n \"SdJwtJsonValue\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"boolean\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"_sd\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/SdJwtJsonValue\"\n },\n {\n \"not\": {}\n }\n ]\n }\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/SdJwtJsonValue\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"...\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"...\"],\n \"additionalProperties\": false\n }\n ]\n }\n }\n ]\n },\n \"SdJwtDecodedVerifiableCredentialPayload\": {\n \"type\": \"object\",\n \"properties\": {\n \"vct\": {\n \"type\": \"string\"\n },\n \"iss\": {\n \"type\": \"string\"\n },\n \"iat\": {\n \"type\": \"number\"\n },\n \"nbf\": {\n \"type\": \"number\"\n },\n \"exp\": {\n \"type\": \"number\"\n },\n \"cnf\": {\n \"type\": \"object\",\n \"properties\": {\n \"jwk\": {},\n \"kid\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false\n },\n \"status\": {\n \"type\": \"object\",\n \"properties\": {\n \"idx\": {\n \"type\": \"number\"\n },\n \"uri\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"idx\", \"uri\"],\n \"additionalProperties\": false\n },\n \"sub\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"vct\", \"iss\", \"iat\"],\n \"additionalProperties\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/JsonValue\"\n },\n {\n \"not\": {}\n }\n ]\n },\n \"description\": \"Decoded 'pretty' SD JWT Verifiable Credential. This representation has all the `_sd` properties removed, and includes the disclosures directly within the payload.\"\n },\n \"SdJwtVcKbJwtHeader\": {\n \"type\": \"object\",\n \"properties\": {\n \"typ\": {\n \"type\": \"string\",\n \"const\": \"kb+jwt\"\n },\n \"alg\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"typ\", \"alg\"]\n },\n \"SdJwtVcKbJwtPayload\": {\n \"type\": \"object\",\n \"properties\": {\n \"iat\": {\n \"type\": \"number\"\n },\n \"aud\": {\n \"type\": \"string\"\n },\n \"nonce\": {\n \"type\": \"string\"\n },\n \"sd_hash\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"iat\", \"aud\", \"nonce\", \"sd_hash\"],\n \"additionalProperties\": {}\n },\n \"MdocOid4vpIssuerSigned\": {\n \"type\": \"string\",\n \"description\": \"Represents a selective disclosure JWT vc in compact form.\"\n },\n \"MdocDocument\": {\n \"$ref\": \"#/components/schemas/com.sphereon.mdoc.data.device.DocumentCbor\"\n },\n \"com.sphereon.mdoc.data.device.DocumentCbor\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {}\n },\n \"HasherSync\": {\n \"$comment\": \"(data: string | ArrayBuffer, alg: string) => Uint8Array\",\n \"type\": \"object\",\n \"properties\": {\n \"namedArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"data\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"$ref\": \"#/components/schemas/ArrayBuffer\"\n }\n ]\n },\n \"alg\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"data\", \"alg\"],\n \"additionalProperties\": false\n }\n }\n },\n \"ArrayBuffer\": {\n \"type\": \"object\",\n \"properties\": {\n \"byteLength\": {\n \"type\": \"number\"\n }\n },\n \"required\": [\"byteLength\"],\n \"additionalProperties\": false\n },\n \"VerificationPolicies\": {\n \"type\": \"object\",\n \"properties\": {\n \"schemaValidation\": {\n \"$ref\": \"#/components/schemas/SchemaValidation\"\n },\n \"credentialStatus\": {\n \"type\": \"boolean\"\n },\n \"expirationDate\": {\n \"type\": \"boolean\"\n },\n \"issuanceDate\": {\n \"type\": \"boolean\"\n }\n },\n \"required\": [\"expirationDate\", \"issuanceDate\"],\n \"additionalProperties\": false\n },\n \"SchemaValidation\": {\n \"type\": \"string\",\n \"enum\": [\"ALWAYS\", \"NEVER\", \"WHEN_PRESENT\"]\n },\n \"VerificationResult\": {\n \"type\": \"object\",\n \"properties\": {\n \"result\": {\n \"type\": \"boolean\"\n },\n \"source\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/WrappedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/WrappedVerifiablePresentation\"\n }\n ]\n },\n \"subResults\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/VerificationSubResult\"\n }\n },\n \"error\": {\n \"type\": \"string\"\n },\n \"errorDetails\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"result\", \"source\", \"subResults\"],\n \"additionalProperties\": false\n },\n \"WrappedVerifiableCredential\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/WrappedW3CVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/WrappedSdJwtVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/WrappedMdocCredential\"\n }\n ]\n },\n \"WrappedW3CVerifiableCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/W3CVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/JwtDecodedVerifiableCredential\"\n }\n ],\n \"description\": \"Original VC that we've received\"\n },\n \"decoded\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/JwtDecodedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/IVerifiableCredential\"\n }\n ],\n \"description\": \"In case of JWT credential it will be the decoded version. In other cases it will be the same as original one\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.JSONLD\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.JWT_ENCODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.JWT_DECODED\"\n }\n ],\n \"description\": \"Type of this credential. Supported types are json-ld, jwt (decoded/encoded)\"\n },\n \"format\": {\n \"type\": \"string\",\n \"enum\": [\"jwt_vc\", \"ldp_vc\", \"ldp\", \"jwt\"],\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"credential\": {\n \"$ref\": \"#/components/schemas/IVerifiableCredential\",\n \"description\": \"Internal stable representation of a Credential\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"credential\"],\n \"additionalProperties\": false\n },\n \"OriginalType.JSONLD\": {\n \"type\": \"string\",\n \"const\": \"json-ld\"\n },\n \"OriginalType.JWT_ENCODED\": {\n \"type\": \"string\",\n \"const\": \"jwt-encoded\"\n },\n \"OriginalType.JWT_DECODED\": {\n \"type\": \"string\",\n \"const\": \"jwt-decoded\"\n },\n \"WrappedSdJwtVerifiableCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/CompactSdJwtVc\"\n }\n ],\n \"description\": \"Original VC that we've received. Can be either the encoded or decoded variant.\"\n },\n \"decoded\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredentialPayload\",\n \"description\": \"Decoded version of the SD-JWT payload. This is the decoded payload, rather than the whole SD-JWT as the `decoded` property is used in e.g. PEX to check for path filters from fields. The full decoded credential can be found in the `credential` field.\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.SD_JWT_VC_DECODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.SD_JWT_VC_ENCODED\"\n }\n ],\n \"description\": \"Type of this credential.\"\n },\n \"format\": {\n \"type\": \"string\",\n \"const\": \"dc+sd-jwt\",\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"credential\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredential\",\n \"description\": \"Internal stable representation of a Credential\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"credential\"],\n \"additionalProperties\": false\n },\n \"CompactSdJwtVc\": {\n \"type\": \"string\",\n \"description\": \"Represents a selective disclosure JWT vc in compact form.\"\n },\n \"OriginalType.SD_JWT_VC_DECODED\": {\n \"type\": \"string\",\n \"const\": \"sd-jwt-vc-decoded\"\n },\n \"OriginalType.SD_JWT_VC_ENCODED\": {\n \"type\": \"string\",\n \"const\": \"sd-jwt-vc-encoded\"\n },\n \"WrappedMdocCredential\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/MdocDocument\"\n },\n {\n \"$ref\": \"#/components/schemas/MdocOid4vpIssuerSigned\"\n }\n ],\n \"description\": \"Original IssuerSigned to Mdoc that we've received. Can be either the encoded or decoded variant.\"\n },\n \"decoded\": {\n \"$ref\": \"#/components/schemas/MdocDecodedPayload\",\n \"description\": \"Record where keys are the namespaces and the values are objects again with the namespace values\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.MSO_MDOC_DECODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.MSO_MDOC_ENCODED\"\n }\n ],\n \"description\": \"Type of this credential.\"\n },\n \"format\": {\n \"type\": \"string\",\n \"const\": \"mso_mdoc\",\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"credential\": {\n \"$ref\": \"#/components/schemas/MdocDocument\",\n \"description\": \"Internal stable representation of a Credential\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"credential\"],\n \"additionalProperties\": false\n },\n \"MdocDecodedPayload\": {\n \"$ref\": \"#/components/schemas/Record<string,Record<string,(string|number|boolean)>>\",\n \"description\": \"Record where keys are the namespaces and the values are objects again with the namespace values\"\n },\n \"Record<string,Record<string,(string|number|boolean)>>\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/components/schemas/Record<string,(string|number|boolean)>\"\n }\n },\n \"Record<string,(string|number|boolean)>\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": [\"string\", \"number\", \"boolean\"]\n }\n },\n \"OriginalType.MSO_MDOC_DECODED\": {\n \"type\": \"string\",\n \"const\": \"mso_mdoc-decoded\"\n },\n \"OriginalType.MSO_MDOC_ENCODED\": {\n \"type\": \"string\",\n \"const\": \"mso_mdoc-encoded\"\n },\n \"WrappedVerifiablePresentation\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/WrappedW3CVerifiablePresentation\"\n },\n {\n \"$ref\": \"#/components/schemas/WrappedSdJwtVerifiablePresentation\"\n },\n {\n \"$ref\": \"#/components/schemas/WrappedMdocPresentation\"\n }\n ]\n },\n \"WrappedW3CVerifiablePresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/W3CVerifiablePresentation\"\n },\n {\n \"$ref\": \"#/components/schemas/JwtDecodedVerifiablePresentation\"\n }\n ],\n \"description\": \"Original VP that we've received\"\n },\n \"decoded\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/JwtDecodedVerifiablePresentation\"\n },\n {\n \"$ref\": \"#/components/schemas/IVerifiablePresentation\"\n }\n ],\n \"description\": \"In case of JWT VP it will be the decoded version. In other cases it will be the same as original one\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.JSONLD\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.JWT_ENCODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.JWT_DECODED\"\n }\n ],\n \"description\": \"Type of this Presentation. Supported types are json-ld and jwt (decoded/encoded) and sd-jwt-vc (decoded/encoded)\"\n },\n \"format\": {\n \"type\": \"string\",\n \"enum\": [\"jwt_vp\", \"ldp_vp\"],\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"presentation\": {\n \"$ref\": \"#/components/schemas/UniformVerifiablePresentation\",\n \"description\": \"Internal stable representation of a Presentation without proofs, created based on https://www.w3.org/TR/vc-data-model/#jwt-decoding\"\n },\n \"vcs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/WrappedW3CVerifiableCredential\"\n },\n \"description\": \"Wrapped Verifiable Credentials belonging to the Presentation\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"presentation\", \"vcs\"],\n \"additionalProperties\": false\n },\n \"W3CVerifiablePresentation\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IVerifiablePresentation\"\n },\n {\n \"$ref\": \"#/components/schemas/CompactJWT\"\n }\n ],\n \"description\": \"Represents a signed Verifiable Presentation (includes proof), in either JSON or compact JWT format. See {@link https://www.w3.org/TR/vc-data-model/#presentations | VC data model } See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats }\"\n },\n \"IVerifiablePresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"proof\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/IProof\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IProof\"\n }\n }\n ]\n },\n \"id\": {\n \"type\": \"string\"\n },\n \"@context\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n }\n }\n ]\n },\n \"type\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n ]\n },\n \"verifiableCredential\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/W3CVerifiableCredential\"\n }\n },\n \"presentation_submission\": {\n \"$ref\": \"#/components/schemas/PresentationSubmission\"\n },\n \"holder\": {\n \"type\": \"string\"\n },\n \"verifier\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"@context\", \"proof\"]\n },\n \"PresentationSubmission\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"A UUID or some other unique ID to identify this Presentation Submission\"\n },\n \"definition_id\": {\n \"type\": \"string\",\n \"description\": \"A UUID or some other unique ID to identify this Presentation Definition\"\n },\n \"descriptor_map\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/Descriptor\"\n },\n \"description\": \"List of descriptors of how the claims are being mapped to presentation definition\"\n }\n },\n \"required\": [\"id\", \"definition_id\", \"descriptor_map\"],\n \"additionalProperties\": false,\n \"description\": \"It expresses how the inputs are presented as proofs to a Verifier.\"\n },\n \"Descriptor\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"description\": \"ID to identify the descriptor from Presentation Definition Input Descriptor it coresponds to.\"\n },\n \"path\": {\n \"type\": \"string\",\n \"description\": \"The path where the verifiable credential is located in the presentation submission json\"\n },\n \"path_nested\": {\n \"$ref\": \"#/components/schemas/Descriptor\"\n },\n \"format\": {\n \"type\": \"string\",\n \"description\": \"The Proof or JWT algorith that the proof is in\"\n }\n },\n \"required\": [\"id\", \"path\", \"format\"],\n \"additionalProperties\": false,\n \"description\": \"descriptor map laying out the structure of the presentation submission.\"\n },\n \"JwtDecodedVerifiablePresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"vp\": {\n \"$ref\": \"#/components/schemas/IVerifiablePresentation\"\n },\n \"exp\": {\n \"type\": \"string\"\n },\n \"iss\": {\n \"type\": \"string\"\n },\n \"nbf\": {\n \"type\": \"string\"\n },\n \"sub\": {\n \"type\": \"string\"\n },\n \"jti\": {\n \"type\": \"string\"\n },\n \"aud\": {\n \"type\": \"string\"\n },\n \"iat\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"vp\", \"exp\", \"iss\", \"nbf\", \"sub\", \"jti\", \"aud\", \"iat\"]\n },\n \"UniformVerifiablePresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"@context\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/ICredentialContextType\"\n }\n }\n ]\n },\n \"type\": {\n \"anyOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n ]\n },\n \"verifiableCredential\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/WrappedW3CVerifiableCredential\"\n }\n },\n \"presentation_submission\": {\n \"$ref\": \"#/components/schemas/PresentationSubmission\"\n },\n \"holder\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"@context\", \"type\", \"verifiableCredential\"],\n \"additionalProperties\": false\n },\n \"WrappedSdJwtVerifiablePresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredential\"\n },\n {\n \"$ref\": \"#/components/schemas/CompactSdJwtVc\"\n }\n ],\n \"description\": \"Original VP that we've received. Can be either the encoded or decoded variant.\"\n },\n \"decoded\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredentialPayload\",\n \"description\": \"Decoded version of the SD-JWT payload. This is the decoded payload, rather than the whole SD-JWT.\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.SD_JWT_VC_DECODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.SD_JWT_VC_ENCODED\"\n }\n ],\n \"description\": \"Type of this Presentation.\"\n },\n \"format\": {\n \"type\": \"string\",\n \"const\": \"dc+sd-jwt\",\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"presentation\": {\n \"$ref\": \"#/components/schemas/SdJwtDecodedVerifiableCredential\",\n \"description\": \"Internal stable representation of a Presentation\"\n },\n \"vcs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/WrappedSdJwtVerifiableCredential\"\n },\n \"minItems\": 1,\n \"maxItems\": 1,\n \"description\": \"Wrapped Verifiable Credentials belonging to the Presentation. Will always be an array with a single SdJwtVerifiableCredential entry.\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"presentation\", \"vcs\"],\n \"additionalProperties\": false\n },\n \"WrappedMdocPresentation\": {\n \"type\": \"object\",\n \"properties\": {\n \"original\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/MdocDeviceResponse\"\n },\n {\n \"$ref\": \"#/components/schemas/MdocOid4vpMdocVpToken\"\n }\n ],\n \"description\": \"Original VP that we've received. Can be either the encoded or decoded variant.\"\n },\n \"decoded\": {\n \"$ref\": \"#/components/schemas/MdocDeviceResponse\",\n \"description\": \"Decoded version of the SD-JWT payload. This is the decoded payload, rather than the whole SD-JWT.\"\n },\n \"type\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/components/schemas/OriginalType.MSO_MDOC_ENCODED\"\n },\n {\n \"$ref\": \"#/components/schemas/OriginalType.MSO_MDOC_DECODED\"\n }\n ],\n \"description\": \"Type of this Presentation.\"\n },\n \"format\": {\n \"type\": \"string\",\n \"const\": \"mso_mdoc\",\n \"description\": \"The claim format, typically used during exchange transport protocols\"\n },\n \"presentation\": {\n \"$ref\": \"#/components/schemas/MdocDeviceResponse\",\n \"description\": \"Internal stable representation of a Presentation\"\n },\n \"vcs\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/WrappedMdocCredential\"\n },\n \"description\": \"Wrapped Mdocs belonging to the Presentation. There can be multiple documents in a single device response\"\n }\n },\n \"required\": [\"original\", \"decoded\", \"type\", \"format\", \"presentation\", \"vcs\"],\n \"additionalProperties\": false\n },\n \"MdocDeviceResponse\": {\n \"$ref\": \"#/components/schemas/com.sphereon.mdoc.data.device.DeviceResponseCbor\"\n },\n \"com.sphereon.mdoc.data.device.DeviceResponseCbor\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {}\n },\n \"MdocOid4vpMdocVpToken\": {\n \"type\": \"string\"\n },\n \"VerificationSubResult\": {\n \"type\": \"object\",\n \"properties\": {\n \"result\": {\n \"type\": \"boolean\"\n },\n \"error\": {\n \"type\": \"string\"\n },\n \"errorDetails\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"result\"],\n \"additionalProperties\": false\n },\n \"VerifyMdocCredentialArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credential\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"credential\"],\n \"additionalProperties\": false\n },\n \"ValidateSchemaArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credential\": {\n \"$ref\": \"#/components/schemas/OriginalVerifiableCredential\"\n },\n \"validationPolicy\": {\n \"$ref\": \"#/components/schemas/SchemaValidation\"\n },\n \"hasher\": {\n \"$ref\": \"#/components/schemas/HasherSync\"\n }\n },\n \"required\": [\"credential\"],\n \"additionalProperties\": false\n },\n \"VerifySDJWTCredentialArgs\": {\n \"type\": \"object\",\n \"properties\": {\n \"credential\": {\n \"type\": \"string\"\n },\n \"hasher\": {\n \"$ref\": \"#/components/schemas/HasherSync\"\n }\n },\n \"required\": [\"credential\"],\n \"additionalProperties\": false\n },\n \"VerifyW3CCredentialArgs\": {\n \"type\": \"object\",\n \"additionalProperties\": false\n }\n },\n \"methods\": {\n \"cvVerifyCredential\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/VerifyCredentialArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerificationResult\"\n }\n },\n \"cvVerifyMdoc\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/VerifyMdocCredentialArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerificationResult\"\n }\n },\n \"cvVerifySchema\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/ValidateSchemaArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerificationResult\"\n }\n },\n \"cvVerifySDJWTCredential\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/VerifySDJWTCredentialArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerificationResult\"\n }\n },\n \"cvVerifyW3CCredential\": {\n \"description\": \"\",\n \"arguments\": {\n \"$ref\": \"#/components/schemas/VerifyW3CCredentialArgs\"\n },\n \"returnType\": {\n \"$ref\": \"#/components/schemas/VerificationResult\"\n }\n }\n }\n }\n }\n}\n","/**\n * @public\n */\nconst schema = require('../plugin.schema.json')\nexport { schema }\nexport { CredentialValidation, credentialValidationMethods } from './agent/CredentialValidation'\nexport * from './types/ICredentialValidation'\n","import mdocPkg from '@sphereon/kmp-mdoc-core'\nimport { IVerifySdJwtVcResult } from '@sphereon/ssi-sdk.sd-jwt'\nimport {\n CredentialMapper,\n ICredentialSchemaType,\n IVerifyResult,\n OriginalVerifiableCredential,\n WrappedVerifiableCredential,\n} from '@sphereon/ssi-types'\nimport { IAgentPlugin, IVerifyCredentialArgs, W3CVerifiableCredential as VeramoW3CVerifiableCredential } from '@veramo/core'\nimport addFormats from 'ajv-formats'\nimport Ajv2020 from 'ajv/dist/2020.js'\nimport fetch from 'cross-fetch'\nimport {\n CredentialVerificationError,\n ICredentialValidation,\n RequiredContext,\n schema,\n SchemaValidation,\n ValidateSchemaArgs,\n VerificationResult,\n VerificationSubResult,\n VerifyCredentialArgs,\n VerifyMdocCredentialArgs,\n VerifySDJWTCredentialArgs,\n} from '../index'\nimport IVerifySignatureResult = mdocPkg.com.sphereon.crypto.generic.IVerifySignatureResult\nimport ICoseKeyJson = mdocPkg.com.sphereon.crypto.cose.ICoseKeyJson\nimport decodeFrom = mdocPkg.com.sphereon.kmp.decodeFrom\nimport IssuerSignedCbor = mdocPkg.com.sphereon.mdoc.data.device.IssuerSignedCbor\nimport { defaultHasher } from '@sphereon/ssi-sdk.core'\n\n// Exposing the methods here for any REST implementation\nexport const credentialValidationMethods: Array<string> = [\n 'cvVerifyCredential',\n 'cvVerifySchema',\n 'cvVerifyMdoc',\n 'cvVerifySDJWTCredential',\n 'cvVerifyW3CCredential',\n]\n\n/**\n * {@inheritDoc ICredentialValidation}\n */\nexport class CredentialValidation implements IAgentPlugin {\n readonly schema = schema.ICredentialValidation\n readonly methods: ICredentialValidation = {\n cvVerifyCredential: this.cvVerifyCredential.bind(this),\n cvVerifySchema: this.cvVerifySchema.bind(this),\n cvVerifyMdoc: this.cvVerifyMdoc.bind(this),\n cvVerifySDJWTCredential: this.cvVerifySDJWTCredential.bind(this),\n cvVerifyW3CCredential: this.cvVerifyW3CCredential.bind(this),\n }\n\n private detectSchemas(wrappedVC: WrappedVerifiableCredential): ICredentialSchemaType[] | undefined {\n if ('credential' in wrappedVC) {\n const { credential } = wrappedVC\n\n if ('credentialSchema' in credential) {\n const { credentialSchema } = credential\n\n if (Array.isArray(credentialSchema)) {\n return credentialSchema\n } else if (credentialSchema) {\n return [credentialSchema]\n }\n }\n }\n\n return undefined\n }\n\n private async cvVerifyCredential(args: VerifyCredentialArgs, context: RequiredContext): Promise<VerificationResult> {\n const { credential, hasher = defaultHasher, policies } = args\n // defaulting the schema validation to when_present\n const schemaResult = await this.cvVerifySchema({\n credential,\n validationPolicy: policies?.schemaValidation ?? SchemaValidation.WHEN_PRESENT,\n hasher,\n })\n if (!schemaResult.result) {\n return schemaResult\n }\n if (CredentialMapper.isMsoMdocOid4VPEncoded(credential)) {\n return await this.cvVerifyMdoc({ credential }, context)\n } else if (CredentialMapper.isSdJwtEncoded(credential)) {\n // Honor the credentialStatus policy: when status checking is disabled (e.g. during issuance), skip the\n // status-list token verification so an untrusted status-list signer cannot block a valid credential.\n return await this.cvVerifySDJWTCredential({ credential, hasher, skipStatusCheck: policies?.credentialStatus === false }, context)\n } else {\n return await this.cvVerifyW3CCredential(\n {\n ...args,\n credential: credential as VeramoW3CVerifiableCredential,\n },\n context,\n )\n }\n }\n\n private async cvVerifySchema(args: ValidateSchemaArgs): Promise<VerificationResult> {\n const { credential, hasher = defaultHasher, validationPolicy } = args\n const wrappedCredential: WrappedVerifiableCredential = CredentialMapper.toWrappedVerifiableCredential(credential, { hasher })\n if (validationPolicy === SchemaValidation.NEVER) {\n return {\n result: true,\n source: wrappedCredential,\n subResults: [],\n }\n }\n return this.validateSchema(wrappedCredential, validationPolicy)\n }\n\n private async validateSchema(wrappedVC: WrappedVerifiableCredential, validationPolicy?: SchemaValidation): Promise<VerificationResult> {\n const schemas: ICredentialSchemaType[] | undefined = this.detectSchemas(wrappedVC)\n if (!schemas) {\n if (validationPolicy === SchemaValidation.ALWAYS) {\n console.error(\n `No schema found for credential, but validation policy is set to ALWAYS. Returning false. Credential: ${JSON.stringify(wrappedVC.credential, null, 2)}`,\n )\n return {\n result: false,\n source: wrappedVC,\n subResults: [],\n }\n } else {\n return {\n result: true,\n source: wrappedVC,\n subResults: [],\n }\n }\n }\n\n const subResults: VerificationSubResult[] = await Promise.all(schemas.map((schema) => this.verifyCredentialAgainstSchema(wrappedVC, schema)))\n\n return {\n result: subResults.every((subResult) => subResult.result),\n source: wrappedVC,\n subResults,\n }\n }\n\n private async fetchSchema(uri: string) {\n const response = await fetch(uri)\n if (!response.ok) {\n throw new Error(`Unable to fetch schema from ${uri}`)\n }\n return response.json()\n }\n\n private async verifyCredentialAgainstSchema(wrappedVC: WrappedVerifiableCredential, schema: ICredentialSchemaType): Promise<VerificationSubResult> {\n const schemaUrl: string = typeof schema === 'string' ? schema : schema.id\n let schemaValue\n try {\n schemaValue = await this.fetchSchema(schemaUrl)\n } catch (error) {\n console.error(error)\n return {\n result: false,\n error: error,\n }\n }\n\n const ajv = new Ajv2020({ loadSchema: this.fetchSchema })\n addFormats(ajv)\n\n const validate = await ajv.compileAsync(schemaValue)\n const valid = validate(wrappedVC.credential)\n if (!valid) {\n console.error(`Schema validation failed for `, wrappedVC.credential)\n }\n return {\n result: valid,\n }\n }\n\n private async cvVerifyMdoc(args: VerifyMdocCredentialArgs, context: RequiredContext): Promise<VerificationResult> {\n const { credential } = args\n\n const rawBytes = decodeFrom(credential, mdocPkg.com.sphereon.kmp.Encoding.BASE64URL)\n // Stash raw mdoc bytes so @sphereon/ssi-sdk.mdl-mdoc's verify1Async can rebuild Sig_structure\n // from the untouched protected/payload bytes, working around the kmp-mdoc-core UTF-8 string\n // round-trip that corrupts binary protected-header values (e.g. a bstr kid).\n const u8Raw: Uint8Array =\n rawBytes instanceof Uint8Array\n ? rawBytes\n : ArrayBuffer.isView(rawBytes)\n ? new Uint8Array((rawBytes as ArrayBufferView).buffer, (rawBytes as ArrayBufferView).byteOffset, (rawBytes as ArrayBufferView).byteLength)\n : Uint8Array.from((rawBytes as unknown as number[]).map((b) => b & 0xff))\n const g = globalThis as unknown as { __sphereon_mdoc_raw_bytes?: Uint8Array }\n const prevRaw = g.__sphereon_mdoc_raw_bytes\n g.__sphereon_mdoc_raw_bytes = u8Raw\n let verification: IVerifySignatureResult<ICoseKeyJson>\n try {\n const issuerSigned = IssuerSignedCbor.Static.cborDecode(rawBytes)\n verification = await context.agent.mdocVerifyIssuerSigned({ input: issuerSigned.toJson().issuerAuth }).catch((error: Error) => {\n console.error(error)\n return {\n name: 'mdoc',\n critical: true,\n error: true,\n message: error.message ?? 'Mdoc Issuer Signed VC could not be verified',\n } satisfies IVerifySignatureResult<ICoseKeyJson>\n })\n } finally {\n g.__sphereon_mdoc_raw_bytes = prevRaw\n }\n\n return {\n source: CredentialMapper.toWrappedVerifiableCredential(credential as OriginalVerifiableCredential, { hasher: defaultHasher }),\n result: !verification.error,\n subResults: [],\n ...(verification.error && {\n error: verification.message ?? `Could not verify mdoc from issuer`,\n }),\n }\n }\n\n private async cvVerifyW3CCredential(args: IVerifyCredentialArgs, context: RequiredContext): Promise<VerificationResult> {\n // We also allow/add boolean, because 4.x Veramo returns a boolean for JWTs. 5.X will return better results\n const { credential, policies } = args\n\n const result: IVerifyResult | boolean = (await context.agent.verifyCredential(args)) as IVerifyResult | boolean\n\n if (typeof result === 'boolean') {\n return {\n // FIXME the source is never used, need to start using this as the source of truth\n source: CredentialMapper.toWrappedVerifiableCredential(args.credential as OriginalVerifiableCredential, { hasher: defaultHasher }),\n result,\n ...(!result && {\n error: 'Invalid JWT VC',\n errorDetails: `JWT VC was not valid with policies: ${JSON.stringify(policies)}`,\n }),\n subResults: [],\n }\n } else {\n // TODO look at what this is doing and make it simple and readable\n let error: string | undefined\n let errorDetails: string | undefined\n const subResults: Array<VerificationSubResult> = []\n if (result.error) {\n error = result.error?.message ?? ''\n errorDetails = result.error?.details?.code ?? ''\n errorDetails = (errorDetails !== '' ? `${errorDetails}, ` : '') + (result.error?.details?.url ?? '')\n if (result.error?.errors) {\n error = (error !== '' ? `${error}, ` : '') + result.error?.errors?.map((error) => error.message ?? error.name).join(', ')\n errorDetails =\n (errorDetails !== '' ? `${errorDetails}, ` : '') +\n result.error?.errors?.map((error) => (error?.details?.code ? `${error.details.code}, ` : '') + (error?.details?.url ?? '')).join(', ')\n }\n console.error(error)\n }\n\n return {\n source: CredentialMapper.toWrappedVerifiableCredential(credential as OriginalVerifiableCredential, { hasher: defaultHasher }),\n result: result.verified,\n subResults,\n error,\n errorDetails,\n }\n }\n }\n\n private async cvVerifySDJWTCredential(args: VerifySDJWTCredentialArgs, context: RequiredContext): Promise<VerificationResult> {\n const { credential, hasher = defaultHasher, skipStatusCheck } = args\n\n const verification: IVerifySdJwtVcResult | CredentialVerificationError = await context.agent\n .verifySdJwtVc({ credential, opts: { skipStatusCheck } })\n .catch((error: Error): CredentialVerificationError => {\n console.error(error)\n // Distinguish a status-list verification failure (the status-list token's signer is untrusted/invalid)\n // from the credential's own signature failing, so the UI can show a clear, specific message. The\n // low-level lib tags status failures with \"status list\".\n const isStatusListFailure = /status list/i.test(error.message ?? '')\n return {\n error: isStatusListFailure ? 'Invalid status list' : 'Invalid SD-JWT VC',\n errorDetails: error.message ?? 'SD-JWT VC could not be verified',\n }\n })\n\n const result = 'header' in verification && 'payload' in verification\n return {\n source: CredentialMapper.toWrappedVerifiableCredential(credential as OriginalVerifiableCredential, { hasher: hasher ?? defaultHasher }),\n result,\n subResults: [],\n ...(!result && { ...verification }),\n }\n }\n}\n","import { IAgentContext, ICredentialVerifier, IPluginMethodMap } from '@veramo/core'\nimport { HasherSync, WrappedVerifiableCredential, WrappedVerifiablePresentation } from '@sphereon/ssi-types'\nimport { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc'\nimport { OriginalVerifiableCredential } from '@sphereon/ssi-types'\n\nexport interface ICredentialValidation extends IPluginMethodMap {\n cvVerifyCredential(args: VerifyCredentialArgs, context: RequiredContext): Promise<VerificationResult>\n cvVerifySchema(args: ValidateSchemaArgs): Promise<VerificationResult>\n cvVerifyMdoc(args: VerifyMdocCredentialArgs, context: RequiredContext): Promise<VerificationResult>\n cvVerifySDJWTCredential(args: VerifySDJWTCredentialArgs, context: RequiredContext): Promise<VerificationResult>\n cvVerifyW3CCredential(args: VerifyW3CCredentialArgs, context: RequiredContext): Promise<VerificationResult>\n}\n\nexport enum SchemaValidation {\n ALWAYS = 'ALWAYS',\n NEVER = 'NEVER',\n WHEN_PRESENT = 'WHEN_PRESENT',\n}\n\nexport type VerifyCredentialArgs = {\n credential: OriginalVerifiableCredential\n hasher?: HasherSync\n fetchRemoteContexts: boolean\n policies?: VerificationPolicies\n}\n\nexport type VerificationPolicies = {\n schemaValidation?: SchemaValidation\n credentialStatus?: boolean\n expirationDate: boolean\n issuanceDate: boolean\n}\n\nexport type ValidateSchemaArgs = {\n credential: OriginalVerifiableCredential\n validationPolicy?: SchemaValidation\n hasher?: HasherSync\n}\n\nexport type VerifyMdocCredentialArgs = { credential: string }\n\nexport type VerifySDJWTCredentialArgs = {\n credential: string\n hasher?: HasherSync\n // When true, the status-list token is not fetched/verified (honors a `credentialStatus: false` policy).\n skipStatusCheck?: boolean\n}\n\nexport type VerifyW3CCredentialArgs = {}\n\nexport type VerificationResult = {\n result: boolean\n source: WrappedVerifiableCredential | WrappedVerifiablePresentation\n subResults: Array<VerificationSubResult>\n error?: string | undefined\n errorDetails?: string\n}\n\nexport type VerificationSubResult = {\n result: boolean\n error?: string\n errorDetails?: string\n}\n\nexport type CredentialVerificationError = {\n error?: string\n errorDetails?: string\n}\n\nexport type RequiredContext = IAgentContext<ImDLMdoc & ICredentialVerifier>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,gCAAAA,SAAA;AAAA,IAAAA,QAAA;AAAA,MACE,uBAAyB;AAAA,QACvB,YAAc;AAAA,UACZ,SAAW;AAAA,YACT,sBAAwB;AAAA,cACtB,MAAQ;AAA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4D,SAASC,OAAO,GAAG7D,OAAM4D,QAAQC,IAAI,OAAO,OAAO7D,QAAO4D,SAASE,OAAO,GAAC,EAAIE,KAAK,IAAA;QACrI;AACAjE,gBAAQC,MAAMA,KAAAA;MAChB;AAEA,aAAO;QACLN,QAAQR,kCAAiBM,8BAA8BtB,YAA4C;UAAEO,QAAQC;QAAc,CAAA;QAC3HO,QAAQA,OAAOgF;QACftE;QACAK;QACA2D;MACF;IACF;EACF;EAEA,MAAc7F,wBAAwBS,MAAiCC,SAAuD;AAC5H,UAAM,EAAEN,YAAYO,SAASC,8BAAeW,gBAAe,IAAKd;AAEhE,UAAMsE,eAAmE,MAAMrE,QAAQyE,MACpFiB,cAAc;MAAEhG;MAAYiG,MAAM;QAAE9E;MAAgB;IAAE,CAAA,EACtDiE,MAAM,CAACtD,UAAAA;AACND,cAAQC,MAAMA,KAAAA;AAId,YAAMoE,sBAAsB,eAAeC,KAAKrE,MAAMyD,WAAW,EAAA;AACjE,aAAO;QACLzD,OAAOoE,sBAAsB,wBAAwB;QACrDT,cAAc3D,MAAMyD,WAAW;MACjC;IACF,CAAA;AAEF,UAAMxE,SAAS,YAAY4D,gBAAgB,aAAaA;AACxD,WAAO;MACLnD,QAAQR,kCAAiBM,8BAA8BtB,YAA4C;QAAEO,QAAQA,UAAUC;MAAc,CAAA;MACrIO;MACAU,YAAY,CAAA;MACZ,GAAI,CAACV,UAAU;QAAE,GAAG4D;MAAa;IACnC;EACF;AACF;;;ACpRO,IAAKyB,mBAAAA,0BAAAA,mBAAAA;;;;SAAAA;;;;AFVZ,IAAMC,SAASC;","names":["module","decodeFrom","mdocPkg","IssuerSignedCbor","credentialValidationMethods","CredentialValidation","schema","ICredentialValidation","methods","cvVerifyCredential","bind","cvVerifySchema","cvVerifyMdoc","cvVerifySDJWTCredential","cvVerifyW3CCredential","detectSchemas","wrappedVC","credential","credentialSchema","Array","isArray","undefined","args","context","hasher","defaultHasher","policies","schemaResult","validationPolicy","schemaValidation","SchemaValidation","WHEN_PRESENT","result","CredentialMapper","isMsoMdocOid4VPEncoded","isSdJwtEncoded","skipStatusCheck","credentialStatus","wrappedCredential","toWrappedVerifiableCredential","NEVER","source","subResults","validateSchema","schemas","ALWAYS","console","error","JSON","stringify","Promise","all","map","verifyCredentialAgainstSchema","every","subResult","fetchSchema","uri","response","fetch","ok","Error","json","schemaUrl","id","schemaValue","ajv","Ajv2020","loadSchema","addFormats","validate","compileAsync","valid","rawBytes","com","sphereon","kmp","Encoding","BASE64URL","u8Raw","Uint8Array","ArrayBuffer","isView","buffer","byteOffset","byteLength","from","b","g","globalThis","prevRaw","__sphereon_mdoc_raw_bytes","verification","issuerSigned","Static","cborDecode","agent","mdocVerifyIssuerSigned","input","toJson","issuerAuth","catch","name","critical","message","verifyCredential","errorDetails","details","code","url","errors","join","verified","verifySdJwtVc","opts","isStatusListFailure","test","SchemaValidation","schema","require"]}
package/dist/index.d.cts CHANGED
@@ -55,6 +55,7 @@ type VerifyMdocCredentialArgs = {
55
55
  type VerifySDJWTCredentialArgs = {
56
56
  credential: string;
57
57
  hasher?: HasherSync;
58
+ skipStatusCheck?: boolean;
58
59
  };
59
60
  type VerifyW3CCredentialArgs = {};
60
61
  type VerificationResult = {
package/dist/index.d.ts CHANGED
@@ -55,6 +55,7 @@ type VerifyMdocCredentialArgs = {
55
55
  type VerifySDJWTCredentialArgs = {
56
56
  credential: string;
57
57
  hasher?: HasherSync;
58
+ skipStatusCheck?: boolean;
58
59
  };
59
60
  type VerifyW3CCredentialArgs = {};
60
61
  type VerificationResult = {
package/dist/index.js CHANGED
@@ -1539,7 +1539,8 @@ var CredentialValidation = class {
1539
1539
  } else if (CredentialMapper.isSdJwtEncoded(credential)) {
1540
1540
  return await this.cvVerifySDJWTCredential({
1541
1541
  credential,
1542
- hasher
1542
+ hasher,
1543
+ skipStatusCheck: policies?.credentialStatus === false
1543
1544
  }, context);
1544
1545
  } else {
1545
1546
  return await this.cvVerifyW3CCredential({
@@ -1696,13 +1697,17 @@ var CredentialValidation = class {
1696
1697
  }
1697
1698
  }
1698
1699
  async cvVerifySDJWTCredential(args, context) {
1699
- const { credential, hasher = defaultHasher } = args;
1700
+ const { credential, hasher = defaultHasher, skipStatusCheck } = args;
1700
1701
  const verification = await context.agent.verifySdJwtVc({
1701
- credential
1702
+ credential,
1703
+ opts: {
1704
+ skipStatusCheck
1705
+ }
1702
1706
  }).catch((error) => {
1703
1707
  console.error(error);
1708
+ const isStatusListFailure = /status list/i.test(error.message ?? "");
1704
1709
  return {
1705
- error: "Invalid SD-JWT VC",
1710
+ error: isStatusListFailure ? "Invalid status list" : "Invalid SD-JWT VC",
1706
1711
  errorDetails: error.message ?? "SD-JWT VC could not be verified"
1707
1712
  };
1708
1713
  });