-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b89f482
commit 30fe45f
Showing
20 changed files
with
239 additions
and
139 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
extensions/common/crypto/jwt-verifiable-credentials/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* | ||
*/ | ||
plugins { | ||
`java-library` | ||
`java-test-fixtures` | ||
} | ||
|
||
dependencies { | ||
implementation(libs.nimbus.jwt) | ||
|
||
implementation(project(":spi:common:json-ld-spi")) | ||
implementation(project(":spi:common:identity-trust-spi")) | ||
implementation(project(":core:common:util")) | ||
implementation(project(":extensions:common:iam:decentralized-identity:identity-did-crypto")) | ||
|
||
|
||
testImplementation(project(":extensions:common:json-ld")) | ||
testImplementation(project(":core:common:junit")) | ||
|
||
testFixturesImplementation(libs.nimbus.jwt) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 53 additions & 60 deletions
113
...fication/JwtPresentationVerifierTest.java → ...ials/jwt/JwtPresentationVerifierTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...ntials/src/testFixtures/java/org/eclipse/edc/verifiablecredentials/jwt/TestConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* | ||
*/ | ||
|
||
package org.eclipse.edc.verifiablecredentials.jwt; | ||
|
||
public interface TestConstants { | ||
String CENTRAL_ISSUER_KEY_ID = "#central-issuer-key1"; | ||
String PRESENTER_KEY_ID = "#my-key1"; | ||
String VP_HOLDER_ID = "did:web:test-issuer"; | ||
String MY_OWN_DID = "did:web:myself"; | ||
String CENTRAL_ISSUER_DID = "did:web:some-official-issuer"; | ||
|
||
// taken straight from here: https://www.w3.org/TR/vc-data-model/#example-verifiable-presentation-using-jwt-compact-serialization-non-normative | ||
String VC_CONTENT_DEGREE_EXAMPLE = """ | ||
{ | ||
"@context": [ | ||
"https://www.w3.org/2018/credentials/v1", | ||
"https://www.w3.org/2018/credentials/examples/v1" | ||
], | ||
"type": [ | ||
"VerifiableCredential", | ||
"UniversityDegreeCredential" | ||
], | ||
"credentialSubject": { | ||
"id": "degreeSub", | ||
"degree": { | ||
"type": "BachelorDegree", | ||
"name": "<span lang='fr-CA'>Baccalauréat en musiques numériques</span>" | ||
} | ||
} | ||
} | ||
"""; | ||
|
||
String VC_CONTENT_CERTIFICATE_EXAMPLE = """ | ||
{ | ||
"@context": [ | ||
"https://www.w3.org/2018/credentials/v1", | ||
"https://www.w3.org/2018/credentials/examples/v1" | ||
], | ||
"type": [ | ||
"VerifiableCredential", | ||
"IsoCertificateCredential" | ||
], | ||
"issuer":"did:web:test-issuer", | ||
"issuanceDate": "2022-10-18T12:56:00Z", | ||
"credentialSubject": { | ||
"id": "https://w3id.org/example/isoCred", | ||
"degree": { | ||
"type": "Iso9001Certificate", | ||
"name": "ISO 9001 Certificate for excellence in many things" | ||
} | ||
} | ||
} | ||
"""; | ||
|
||
// taken straight from here: https://www.w3.org/TR/vc-data-model/#example-verifiable-presentation-using-jwt-compact-serialization-non-normative | ||
String VP_CONTENT_TEMPLATE = """ | ||
{ | ||
"@context": [ | ||
"https://www.w3.org/2018/credentials/v1", | ||
"https://www.w3.org/2018/credentials/examples/v1" | ||
], | ||
"id": "https://exapmle.com/test-vp", | ||
"holder": "https://holder.test.com", | ||
"type": [ | ||
"VerifiablePresentation" | ||
], | ||
"verifiableCredential": [ | ||
%s | ||
] | ||
} | ||
"""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.