-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: require key-id when resolving key material (#3655)
feat: utilize the DidPublicKeyResolver in the JWT verification
- Loading branch information
1 parent
21ac8b6
commit 1f76ae9
Showing
10 changed files
with
167 additions
and
159 deletions.
There are no files selected for viewing
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
50 changes: 50 additions & 0 deletions
50
...redentials/src/testFixtures/java/org/eclipse/edc/verifiablecredentials/TestFunctions.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,50 @@ | ||
/* | ||
* 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; | ||
|
||
import com.nimbusds.jose.JOSEException; | ||
import com.nimbusds.jose.JWEEncrypter; | ||
import com.nimbusds.jose.JWSVerifier; | ||
import com.nimbusds.jose.crypto.ECDHEncrypter; | ||
import com.nimbusds.jose.crypto.ECDSAVerifier; | ||
import com.nimbusds.jose.jwk.ECKey; | ||
import org.eclipse.edc.iam.did.spi.key.PublicKeyWrapper; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class TestFunctions { | ||
|
||
@NotNull | ||
public static PublicKeyWrapper createPublicKeyWrapper(ECKey vpSigningKey) { | ||
return new PublicKeyWrapper() { | ||
@Override | ||
public JWEEncrypter encrypter() { | ||
try { | ||
return new ECDHEncrypter(vpSigningKey); | ||
} catch (JOSEException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
@Override | ||
public JWSVerifier verifier() { | ||
try { | ||
return new ECDSAVerifier(vpSigningKey); | ||
} catch (JOSEException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
}; | ||
} | ||
} |
Oops, something went wrong.