From 59ffc304a552854ba0f26b64b659f65ad9eea2e4 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Tue, 7 Jan 2025 09:16:21 +0100 Subject: [PATCH] fix: update expiration date of test VCs --- .../resources/jws2020/issuing/0001_vc.json | 2 +- .../signature/jws2020/IssuerTests.java | 6 ++-- .../signature/jws2020/VerifierTests.java | 8 ++--- .../resources/jws2020/issuing/0001_vc.json | 2 +- .../resources/jws2020/verifying/0001_vc.json | 8 ++--- .../jws2020/verifying/0003_vc_embedded.json | 17 ++++----- .../verifying/0004_vc_two_valid_proofs.json | 36 +++++++++---------- .../jws2020/verifying/0007_vp_compacted.json | 18 +++++----- 8 files changed, 48 insertions(+), 49 deletions(-) diff --git a/extensions/common/crypto/ldp-verifiable-credentials/src/test/resources/jws2020/issuing/0001_vc.json b/extensions/common/crypto/ldp-verifiable-credentials/src/test/resources/jws2020/issuing/0001_vc.json index f23ce7a2556..3d302f4f394 100644 --- a/extensions/common/crypto/ldp-verifiable-credentials/src/test/resources/jws2020/issuing/0001_vc.json +++ b/extensions/common/crypto/ldp-verifiable-credentials/src/test/resources/jws2020/issuing/0001_vc.json @@ -11,7 +11,7 @@ "MembershipCredential" ], "issuer": "did:web:localhost:member0123456789", - "expirationDate": "2024-12-31T23:00:00Z", + "expirationDate": "2099-12-31T23:00:00Z", "@context": [ "https://www.w3.org/ns/did/v1", "https://www.w3.org/2018/credentials/v1", diff --git a/extensions/common/crypto/lib/jws2020-lib/src/test/java/org/eclipse/edc/security/signature/jws2020/IssuerTests.java b/extensions/common/crypto/lib/jws2020-lib/src/test/java/org/eclipse/edc/security/signature/jws2020/IssuerTests.java index cd3593ad88e..6cc215f78f9 100644 --- a/extensions/common/crypto/lib/jws2020-lib/src/test/java/org/eclipse/edc/security/signature/jws2020/IssuerTests.java +++ b/extensions/common/crypto/lib/jws2020-lib/src/test/java/org/eclipse/edc/security/signature/jws2020/IssuerTests.java @@ -17,12 +17,10 @@ import com.apicatalog.jsonld.loader.SchemeRouter; import com.apicatalog.ld.DocumentError; import com.apicatalog.ld.signature.SigningError; -import com.apicatalog.ld.signature.VerificationError; import com.apicatalog.vc.verifier.Verifier; import com.fasterxml.jackson.databind.ObjectMapper; import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.jwk.Curve; -import com.nimbusds.jose.jwk.JWK; import com.nimbusds.jose.jwk.KeyUse; import com.nimbusds.jose.jwk.RSAKey; import com.nimbusds.jose.jwk.gen.ECKeyGenerator; @@ -195,7 +193,7 @@ void signEmbeddedVerificationMethod() throws SigningError, DocumentError { @Test void signVerificationDidKey() throws SigningError, DocumentError { var vc = readResourceAsJson("jws2020/issuing/0001_vc.json"); - var eckey = (JWK) CryptoConverter.create(""" + var eckey = CryptoConverter.create(""" { "kty": "EC", "d": "UEUJVbKZC3vR-y65gXx8NZVnE0QD5xe6qOk4eiObj-qVOg5zqt9zc0d6fdu4mUuu", @@ -257,7 +255,7 @@ void signCompactedPresentation() throws SigningError, DocumentError { } @Test - void signAndVerify() throws JOSEException, SigningError, DocumentError, VerificationError { + void signAndVerify() throws JOSEException, SigningError, DocumentError { var vc = readResourceAsJson("jws2020/issuing/0001_vc.json"); var ecKey = new ECKeyGenerator(Curve.P_256).keyID("test-foo").generate(); diff --git a/extensions/common/crypto/lib/jws2020-lib/src/test/java/org/eclipse/edc/security/signature/jws2020/VerifierTests.java b/extensions/common/crypto/lib/jws2020-lib/src/test/java/org/eclipse/edc/security/signature/jws2020/VerifierTests.java index b512bbecd91..6e9913013f3 100644 --- a/extensions/common/crypto/lib/jws2020-lib/src/test/java/org/eclipse/edc/security/signature/jws2020/VerifierTests.java +++ b/extensions/common/crypto/lib/jws2020-lib/src/test/java/org/eclipse/edc/security/signature/jws2020/VerifierTests.java @@ -44,7 +44,7 @@ void verifyValidVc() throws VerificationError, DocumentError { @DisplayName("t0002: forged credentials subject") @Test - void verify_forgedSubject() throws VerificationError, DocumentError { + void verify_forgedSubject() { var vc = readResourceAsJson("jws2020/verifying/0002_vc_forged.json"); assertThatThrownBy(() -> verifier.verify(vc)).isInstanceOf(VerificationError.class); } @@ -67,7 +67,7 @@ void verify_multipleValidProofs() throws VerificationError, DocumentError { @DisplayName("t0005: proof set having one forged proof") @Test - void verify_oneForgedProof() throws VerificationError, DocumentError { + void verify_oneForgedProof() { var vc = readResourceAsJson("jws2020/verifying/0005_vc_one_forged_proof.json"); assertThatThrownBy(() -> verifier.verify(vc)).isInstanceOf(VerificationError.class); } @@ -82,7 +82,7 @@ void verify_oneForgedProof() throws VerificationError, DocumentError { @Disabled("did:key is not supported") @DisplayName("t0006: DID key as verification method (not yet supported)") @Test - void verify_didKeyAsVerificationMethod() throws VerificationError, DocumentError { + void verify_didKeyAsVerificationMethod() { var vc = readResourceAsJson("jws2020/verifying/0006_vc_did_key.json"); assertThatThrownBy(() -> verifier.verify(vc)).isInstanceOf(UnsupportedOperationException.class) .hasMessage("Cannot deserialize public key, expected JWK format"); @@ -98,7 +98,7 @@ void verify_validSignedVp() throws VerificationError, DocumentError { @DisplayName("t0008: forged signed VP") @Test - void verify_forgedSignedVp() throws VerificationError, DocumentError { + void verify_forgedSignedVp() { var vc = readResourceAsJson("jws2020/verifying/0007_vp_compacted_forged.json"); assertThatThrownBy(() -> verifier.verify(vc)).isInstanceOf(VerificationError.class); } diff --git a/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/issuing/0001_vc.json b/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/issuing/0001_vc.json index 433f7c9def9..9eee6f7d14e 100644 --- a/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/issuing/0001_vc.json +++ b/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/issuing/0001_vc.json @@ -11,7 +11,7 @@ "MembershipCredential" ], "issuer": "did:web:localhost:member0123456789", - "expirationDate": "2024-12-31T23:00:00Z", + "expirationDate": "2099-12-31T23:00:00Z", "@context": [ "https://org.eclipse.edc/linkedCredentialData", "https://www.w3.org/ns/did/v1", diff --git a/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0001_vc.json b/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0001_vc.json index a824a5cf476..7d814ee37f3 100644 --- a/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0001_vc.json +++ b/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0001_vc.json @@ -10,13 +10,13 @@ "MembershipCredential" ], "issuer": "did:web:localhost:member0123456789", - "expirationDate": "2024-12-31T23:00:00Z", + "expirationDate": "2099-12-31T23:00:00Z", "proof": { + "verificationMethod": "https://org.eclipse.edc/verification-method", "type": "JsonWebSignature2020", - "created": "2022-12-31T23:00:00Z", "proofPurpose": "assertionMethod", - "verificationMethod": "https://org.eclipse.edc/verification-method", - "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..5JhJYiqLAMoKtOB7687KFY0FaiFiiCfeWrwG_LUCBIzIBU05Hsvt44aZZrj3QOm9qef25g0Obr8199wtNM_Elh9o25j6n4a99sGMCi38xsDQupCUE6FKwOjxopF49Jex" + "created": "2025-01-07T07:55:59.778743Z", + "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..GFhdBOtls3uFe-G8WArw1Kb0juGndUEBx6KSZ43rdU-QZ0_vPQpqA9uyKrzM8lQZSqAtnlvTeRiGIw6I7Fs0JFef9vH31kIEdXbhBvRJ8tQm5cGtspH106AvJA1P60ok" }, "@context": [ "https://www.w3.org/ns/did/v1", diff --git a/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0003_vc_embedded.json b/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0003_vc_embedded.json index 0920b8e205a..008f90e569b 100644 --- a/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0003_vc_embedded.json +++ b/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0003_vc_embedded.json @@ -11,22 +11,23 @@ "https://org.eclipse.edc/linkedCredentialData#MembershipCredential" ], "issuer": "did:web:localhost:member0123456789", - "expirationDate": "2024-12-31T23:00:00Z", + "expirationDate": "2099-12-31T23:00:00Z", "proof": { - "type": "JsonWebSignature2020", - "created": "2022-12-31T23:00:00Z", + "created": "2025-01-07T08:03:46.647007Z", + "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..dcNZ7xhRkdd_OgCtNesBtODrGjhUyWlwArYGLKEXTf9bHFCSt8b886nrFx1f_tUfevezWHi7a-6o62Hjy6LcxyXTSi_EVV_QVoi0ms9AIktqkXzdyVggNmRroetkCAHi", "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", "verificationMethod": { - "type": "JsonWebKey2020", + "controller": "did:key:zQ3shP2mWsZYWgvgM11nenXRTx9L1yiJKmkf9dfX7NaMKb1pX", + "id": "https://org.eclipse.edc/keys/a8a73ff1-f8b4-49fd-b128-120cf95c7bfe", "publicKeyJwk": { - "kty": "EC", "crv": "P-384", + "kty": "EC", "x": "AqMfyYAh2SMf8bMoLbE6mOCbVyz8hukpBqrVheAFP4Anz2_cfzLEKKROD5EaAxSo", "y": "P4KceKXv31JasLqvBPZWA9t1S2cMiHIQQ8ttAl5cFX3xBuzIPlgTRWPOVaNPWNFl" }, - "id": "https://org.eclipse.edc/keys/99159241-bbf7-4bcd-8851-c31f186d348d" - }, - "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..fhdTmvoci7jqs-Qvlq74abkn2DWQuLHM_KPVk0tAXAVujjPRhs7BB-5uNakehNhrJm1q6sU_vfUwJ2UxO6SaWTP9twp9cTRWhN1hnY_cV1eMht_BLUv7Ld9cuUIJyqrN" + "type": "JsonWebKey2020" + } }, "@context": [ "https://www.w3.org/ns/did/v1", diff --git a/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0004_vc_two_valid_proofs.json b/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0004_vc_two_valid_proofs.json index 0292e80f22f..0b915906443 100644 --- a/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0004_vc_two_valid_proofs.json +++ b/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0004_vc_two_valid_proofs.json @@ -11,31 +11,31 @@ "MembershipCredential" ], "issuer": "did:web:localhost:member0123456789", - "expirationDate": "2024-12-31T23:00:00Z", + "expirationDate": "2099-12-31T23:00:00Z", "proof": [ { + "created": "2025-01-07T07:58:57.889159Z", + "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..MUNffcmHBrGjhQ_oMU8p-HveHXITPrE4op_HdgVyoHr25Ara51AMYZrhoX6fn6CPzCxcELhw3Spzp0P1b1fpeCKeEREjWXbGSXz4TL0eqSnHNxVW4sS2j02ElLsV1wHO", + "proofPurpose": "assertionMethod", "type": "JsonWebSignature2020", - "created": "2022-12-31T23:00:00Z", + "verificationMethod": "https://org.eclipse.edc/verification-method" + }, + { + "created": "2025-01-07T08:15:28.929673Z", + "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..TJCK_b4oJNaq7xAybTObJgKXci2Ax7yYYQXF3duCoFPpNulyrcnlRRdFIcl3yQ-Beq9qdQi00Gw3XObUawoIGoiCqgA12pAxa8dgUB4mOctFpTv1ix_nLERRoSSsc_yu", "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", "verificationMethod": { - "type": "JsonWebKey2020", + "controller": "did:key:zQ3shP2mWsZYWgvgM11nenXRTx9L1yiJKmkf9dfX7NaMKb1pX", + "id": "https://org.eclipse.edc/keys/3f00670d-8910-45eb-9153-1a00ad0f72f1", "publicKeyJwk": { - "kty": "OKP", - "use": "sig", - "crv": "Ed25519", - "kid": "5887dc79-c009-407a-8c37-70fcd924a01d", - "x": "xNg3NR6296VQs_knTHXFhk3XDbPq281onF4E7O-B7E8" + "crv": "P-384", + "kty": "EC", + "x": "AqMfyYAh2SMf8bMoLbE6mOCbVyz8hukpBqrVheAFP4Anz2_cfzLEKKROD5EaAxSo", + "y": "P4KceKXv31JasLqvBPZWA9t1S2cMiHIQQ8ttAl5cFX3xBuzIPlgTRWPOVaNPWNFl" }, - "id": "https://org.eclipse.edc/keys/bb5331ac-e114-42c3-8b39-75b3a67ecde1" - }, - "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..h0ArjC72Tfd5C4AgmK8rtLNpsm2OLN8X8QY9omubagVEE1aBaBAKbuxm4VEWYkHSnMXcsH5kESGZ4E1cSLDoDg" - }, - { - "type": "JsonWebSignature2020", - "created": "2022-12-31T23:00:00Z", - "proofPurpose": "assertionMethod", - "verificationMethod": "https://org.eclipse.edc/verification-method", - "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..ITV0pAeQEyB2621UivBNAPKL7tEGoQ79huZFKV64i3TOxKfOGYCZJfUp0GMWDmyFI-WkSXd0aqxF62CyFt5_AZrhlPFhefwHIOb9WIbUUaa96xN5-_wzfL3qa2MuADCh" + "type": "JsonWebKey2020" + } } ], "@context": [ diff --git a/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0007_vp_compacted.json b/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0007_vp_compacted.json index 302b8c2e528..2dbbea6704a 100644 --- a/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0007_vp_compacted.json +++ b/extensions/common/crypto/lib/jws2020-lib/src/test/resources/jws2020/verifying/0007_vp_compacted.json @@ -14,21 +14,21 @@ "MembershipCredential" ], "issuer": "did:web:localhost:member0123456789", - "expirationDate": "2024-12-31T23:00:00Z", + "expirationDate": "2099-12-31T23:00:00Z", "proof": { - "type": "JsonWebSignature2020", - "created": "2022-12-31T23:00:00Z", + "created": "2025-01-07T07:58:57.889159Z", + "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..MUNffcmHBrGjhQ_oMU8p-HveHXITPrE4op_HdgVyoHr25Ara51AMYZrhoX6fn6CPzCxcELhw3Spzp0P1b1fpeCKeEREjWXbGSXz4TL0eqSnHNxVW4sS2j02ElLsV1wHO", "proofPurpose": "assertionMethod", - "verificationMethod": "https://org.eclipse.edc/verification-method", - "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..SwEkR4duA97jHy_WSVKIHLJqd8i2IidedmlMpUKyeV0YlPNz0pjPEKM9p7PqBb7oRIKG3-5qCxpzNhbsIEZZMzEMjWE1adckJ9SMiNr_G1wiAh3Op0cZHDgZBevIPElG" + "type": "JsonWebSignature2020", + "verificationMethod": "https://org.eclipse.edc/verification-method" } }, "proof": { - "verificationMethod": "https://org.eclipse.edc/verification-method", - "type": "JsonWebSignature2020", + "created": "2025-01-07T07:59:46.273602Z", + "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..R37HBNsRTuHj1kL2pr5EF3BajeeZkZe9r8i6bWYdU5MnwWr7PP5j845-czUJdfQOYTXZ-pKI8KraVcz88G2F5uaDD9NgDWvOb25QFjVoSAjo5oB1EIedUfQC3hkQId-j", "proofPurpose": "assertionMethod", - "created": "2022-12-31T23:00:00Z", - "jws": "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFUzM4NCJ9..vo8x80Jm5h_qubTcDvrF3VXy6RRXcX0OdWQ8XLg_cXP_3-1-xXqT--dLMpQUfaPsOV-Y5Gu27gsukI73yKiBs63ebQ3Llc8gQB_BrZ5Ianfy4IcLh7dviW1KqtJ3e2y-" + "type": "JsonWebSignature2020", + "verificationMethod": "https://org.eclipse.edc/verification-method" }, "@context": [ "https://www.w3.org/ns/did/v1",