Skip to content

Commit

Permalink
fix: fix kid parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibogus authored and aleksandra-bel committed Mar 15, 2024
1 parent dc3d872 commit 97437b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,18 @@ public SignedJWT createPresentation(Did issuer, List<VerifiableCredential> crede
public void storeWalletKeyES256K(Wallet wallet) {
WalletKey walletKeyES256K;
try {
String keyId = UUID.randomUUID().toString();
// create additional key pair ES256K
ECKey ecJwk = new ECKeyGenerator(Curve.SECP256K1)
.keyUse(KeyUse.SIGNATURE)
.keyID(UUID.randomUUID().toString())
.keyID(keyId)
.provider(BouncyCastleProviderSingleton.getInstance())
.generate();

Wallet walletFromDB = walletRepository.getByDid(wallet.getDid());
walletKeyES256K = WalletKey.builder()
.wallet(walletFromDB)
.keyId(UUID.randomUUID().toString())
.keyId(keyId)
.referenceKey("dummy ref key, removed once vault setup is ready")
.vaultAccessToken("dummy vault access token, removed once vault setup is ready")
.privateKey(encryptionUtils.encrypt(getPrivateKeyString(ecJwk.toECPrivateKey().getEncoded())))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private Wallet createWallet(CreateWalletRequest request, boolean authority, Stri

WalletKey walletKeyED25519 = WalletKey.builder()
.wallet(wallet)
.keyId(UUID.randomUUID().toString())
.keyId(keyId)
.referenceKey("dummy ref key, removed once vault setup is ready")
.vaultAccessToken("dummy vault access token, removed once vault setup is ready")
.privateKey(encryptionUtils.encrypt(getPrivateKeyString(keyPair.getPrivateKey().asByte())))
Expand Down

0 comments on commit 97437b4

Please sign in to comment.