Skip to content

Commit

Permalink
fix: add keyId to createPresentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafasalfiti committed Apr 22, 2024
1 parent c39730a commit 7e613b4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,14 @@ private void buildVPJsonLd(String callerBpn, List<VerifiableCredential> verifiab
@SneakyThrows({ InvalidPrivateKeyFormatException.class})
private void buildVPJwtEdDSA(String audience, String callerBpn, Wallet callerWallet, List<VerifiableCredential> verifiableCredentials, SupportedAlgorithms algorithm, Map<String, Object> response) {
Pair<Did, Object> result = getPrivateKey(callerWallet, algorithm, audience, callerBpn);
String keyId = walletKeyService.getWalletKeyIdByWalletId(callerWallet.getId());

SerializedJwtPresentationFactory presentationFactory = new SerializedJwtPresentationFactoryImpl(
new SignedJwtFactory(new OctetKeyPairFactory()), new JsonLdSerializerImpl(), result.getKey());

X25519PrivateKey ed25519Key = (X25519PrivateKey) result.getRight();
X25519PrivateKey privateKey = new X25519PrivateKey(ed25519Key.asByte());
SignedJWT presentation = presentationFactory.createPresentation(result.getLeft(), verifiableCredentials, audience, privateKey , "keyId" );
SignedJWT presentation = presentationFactory.createPresentation(result.getLeft(), verifiableCredentials, audience, privateKey , keyId);

response.put(StringPool.VP, presentation.serialize());
}
Expand Down

0 comments on commit 7e613b4

Please sign in to comment.