mirror of
https://github.com/corda/corda.git
synced 2025-06-19 15:43:52 +00:00
Merge remote-tracking branch 'open/master' into os-merge-d2b7f8b
This commit is contained in:
@ -114,7 +114,18 @@ object X509Utilities {
|
||||
fun validateCertPath(trustedRoot: X509Certificate, certPath: CertPath) {
|
||||
val params = PKIXParameters(setOf(TrustAnchor(trustedRoot, null)))
|
||||
params.isRevocationEnabled = false
|
||||
CertPathValidator.getInstance("PKIX").validate(certPath, params)
|
||||
try {
|
||||
CertPathValidator.getInstance("PKIX").validate(certPath, params)
|
||||
} catch (e: CertPathValidatorException) {
|
||||
throw CertPathValidatorException(
|
||||
"""Cert path failed to validate against root certificate.
|
||||
Reason: ${e.reason}
|
||||
Offending cert index: ${e.index}
|
||||
Cert path: $certPath
|
||||
|
||||
Root certificate:
|
||||
$trustedRoot""", e, certPath, e.index)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user