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 authored and nitin-vavdiya committed May 14, 2024
1 parent 760ee94 commit 069a7d3
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 069a7d3

Please sign in to comment.