digitalbazaar / data-integrity

Data Integrity Proof library for use with jsonld-signatures.
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Add logic for verifying `proof.created` #30

Closed aljones15 closed 2 months ago

aljones15 commented 3 months ago
{
  "verified": true,
  "results": [
    {
      "proof": {
        "@context": [
          "https://www.w3.org/ns/credentials/v2",
          {
            "@protected": true,
            "DriverLicenseCredential": "urn:example:DriverLicenseCredential",
            "DriverLicense": {
              "@id": "urn:example:DriverLicense",
              "@context": {
                "@protected": true,
                "id": "@id",
                "type": "@type",
                "documentIdentifier": "urn:example:documentIdentifier",
                "dateOfBirth": "urn:example:dateOfBirth",
                "expirationDate": "urn:example:expiration",
                "issuingAuthority": "urn:example:issuingAuthority"
              }
            },
            "driverLicense": {
              "@id": "urn:example:driverLicense",
              "@type": "@id"
            }
          }
        ],
        "type": "DataIntegrityProof",
        "created": "invalidDate",
        "verificationMethod": "did:key:z6MkwXG2WjeQnNxSoynSGYU8V9j3QzP3JSqhdmkHc6SaVWoT#z6MkwXG2WjeQnNxSoynSGYU8V9j3QzP3JSqhdmkHc6SaVWoT",
        "cryptosuite": "eddsa-rdfc-2022",
        "proofPurpose": "assertionMethod",
        "proofValue": "z3QFjBubFzd5AB4xMZxnYaadiQgfp3iK2UdBwtkHxrZSU7Q27q2X25JYvHTJwr9WUvibDqjMZaDY5vGiVPoRvDtPi"
      },
      "verified": true,
      "verificationMethod": {
        "@context": "https://w3id.org/security/suites/ed25519-2020/v1",
        "id": "did:key:z6MkwXG2WjeQnNxSoynSGYU8V9j3QzP3JSqhdmkHc6SaVWoT#z6MkwXG2WjeQnNxSoynSGYU8V9j3QzP3JSqhdmkHc6SaVWoT",
        "type": "Ed25519VerificationKey2020",
        "controller": "did:key:z6MkwXG2WjeQnNxSoynSGYU8V9j3QzP3JSqhdmkHc6SaVWoT",
        "publicKeyMultibase": "z6MkwXG2WjeQnNxSoynSGYU8V9j3QzP3JSqhdmkHc6SaVWoT"
      },
      "purposeResult": {
        "valid": true
      }
    }
  ]

Library currently verifies proofs with created set to all sorts of weird stuff such as the above.

dlongley commented 2 months ago

Addressed by #34.