Skip to content

Commit

Permalink
Merge pull request #143 from tw-mosip/MOSIP-25198
Browse files Browse the repository at this point in the history
[MOSIP-25198] - Fix null pointer exception
  • Loading branch information
vijay151096 committed Dec 7, 2023
2 parents 8559cf8 + 04779df commit 213954d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fileignoreconfig:
- filename: src/main/java/io/mosip/mimoto/util/RestApiClient.java
checksum: 77b8afdefbb1f8ff56e140836e6713d150ac48f99c6778e43bc2854e5fcd4732
- filename: src/main/java/io/mosip/mimoto/util/JoseUtil.java
checksum: 1a9b48b950b17c14c32c2ee0c8ad0448d63da887dfb7eb82f4f0bf0b71fdeafa
checksum: 65c4d7f9d4f28e7e4e5376e4f6cdce8b49b485c3ea2ab214f72d018d5d73b6aa
- filename: src/main/java/io/mosip/mimoto/util/CryptoUtil.java
checksum: fc4b7bd41ca63b2060854e218eb50689f77162dc51c45e95f51ec0272bd3585a
- filename: src/main/java/io/mosip/mimoto/util/CryptoCoreUtil.java
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/mosip/mimoto/util/JoseUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ public String getJWT(String clientId) {
String keyStorePathWithFileName = keyStorePath + fileName;
Date issuedAt = Date.from(Instant.now());
Date expiresAt = Date.from(Instant.now().plusMillis(120000));
KeyStore.PrivateKeyEntry privateKeyEntry= null;
RSAPrivateKey privateKey = null;
try {
privateKeyEntry = cryptoCoreUtil.loadP12(keyStorePathWithFileName, alias, cyptoPassword);
KeyStore.PrivateKeyEntry privateKeyEntry = cryptoCoreUtil.loadP12(keyStorePathWithFileName, alias, cyptoPassword);
privateKey = (RSAPrivateKey) privateKeyEntry.getPrivateKey();
} catch (IOException e) {
logger.error("Exception happened while loading the p12 file for invoking token call.");
}
RSAPrivateKey privateKey = (RSAPrivateKey) privateKeyEntry.getPrivateKey();
return JWT.create()
.withHeader(header)
.withIssuer(clientId)
Expand Down

0 comments on commit 213954d

Please sign in to comment.