Skip to content

Commit

Permalink
Clean up exception messages in JSSSignatureSpi
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Aug 21, 2024
1 parent 654e706 commit 8122c91
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,13 @@ public void engineInitVerify(PublicKey publicKey)

sig.initVerify(publicKey);
} catch(NoSuchProviderException e) {
throw new InvalidKeyException("Unable to convert non-JSS key " +
"to JSS key");
throw new InvalidKeyException("Unable to convert non-JSS key to JSS key: " + e.getMessage(), e);
} catch(java.security.spec.InvalidKeySpecException e) {
throw new InvalidKeyException("Unable to convert non-JSS key " +
"to JSS key");
throw new InvalidKeyException("Unable to convert non-JSS key to JSS key: " + e.getMessage(), e);
} catch(java.security.NoSuchAlgorithmException e) {
throw new InvalidKeyException("Algorithm not supported");
throw new InvalidKeyException("Algorithm not supported: " + e.getMessage(), e);
} catch(TokenException e) {
throw new InvalidKeyException("Token exception occurred");
throw new InvalidKeyException("Token exception occurred: " + e.getMessage(), e);
}
}

Expand Down

0 comments on commit 8122c91

Please sign in to comment.