mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-29 15:44:14 +00:00
Add error handling to clarify endorsement validation error
This commit is contained in:
parent
d183504a3f
commit
d5fcd06902
@ -1629,11 +1629,18 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
try {
|
||||
cert.verify(signingCert.getPublicKey(), BouncyCastleProvider.PROVIDER_NAME);
|
||||
return true;
|
||||
} catch (InvalidKeyException | CertificateException | NoSuchAlgorithmException
|
||||
| NoSuchProviderException | SignatureException e) {
|
||||
LOGGER.error("Exception thrown while verifying certificate", e);
|
||||
return false;
|
||||
} catch (InvalidKeyException e) {
|
||||
LOGGER.warn("Incorrect key given to validate this cert's signature");
|
||||
} catch (CertificateException e) {
|
||||
LOGGER.warn("Encoding error while validating this cert's signature");
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
LOGGER.warn("Unsupported signature algorithm found during validation");
|
||||
} catch (NoSuchProviderException e) {
|
||||
LOGGER.warn("Incorrect provider for cert signature validation");
|
||||
} catch (SignatureException e) {
|
||||
LOGGER.warn("Exception thrown while verifying certificate", e);
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user