Skip to content

Commit

Permalink
MOSIP-28970
Browse files Browse the repository at this point in the history
Signed-off-by: Pankaj Godiyal <[email protected]>
  • Loading branch information
pg-techno123 committed Nov 9, 2023
1 parent dc222af commit 29711da
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -821,20 +821,8 @@ private void loadKeys(String keyStoreFileName, String alias, String keystorePass
*/


public static boolean evictKeys(String keystoreFilePath) {
boolean bKeyFound = false;
for (Entry<String, PrivateKey> entry : privateKeyMap.entrySet()) {
if (entry.getKey().startsWith(keystoreFilePath)) {
bKeyFound = true;
break;
}
}
if (bKeyFound == false)
return true; // No key to remove
boolean bRetVal = privateKeyMap.entrySet().removeIf(e -> e.getKey().startsWith(keystoreFilePath));
if (bRetVal) {
bRetVal = certificateMap.entrySet().removeIf(e -> e.getKey().startsWith(keystoreFilePath));
}
return bRetVal;
public static synchronized void evictKeys(String keystoreFilePath) {
privateKeyMap.entrySet().removeIf(e -> e.getKey().startsWith(keystoreFilePath));
certificateMap.entrySet().removeIf(e -> e.getKey().startsWith(keystoreFilePath));
}
}

0 comments on commit 29711da

Please sign in to comment.