Skip to content

Commit

Permalink
fix: update expiration of test credentials (#4702)
Browse files Browse the repository at this point in the history
fix: update expiration date of test VCs
  • Loading branch information
paullatzelsperger authored Jan 7, 2025
1 parent 4eca675 commit 197d791
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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");
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 197d791

Please sign in to comment.