Pages

This tutorial covers the basics of the science of cryptography. It explains how programmers and network professionals can use cryptography to maintain the privacy of computer data. Starting with the origins of cryptography, it moves on to explain cryptosystems, various traditional and modern ciphers, public key encryption, data integration, message authentication, and digital signatures.

Tuesday 22 October 2019

[SOLVED] PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors

PROBLEM
PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
CAUSE 
does not recognize the digital certificate  issuer or path validatioan failed
My CODE 
  PKIXParameters params = new PKIXParameters(Collections.singleton(anchor));
  params.setRevocationEnabled(true);
SOLVED

  • Change the digital certificate issuer/certificate authority to JKS format
  • Change the source code to
 KeyStore keystore = KeyStore.getInstance("JKS");
            try (InputStream is = Files.newInputStream(Paths.get("root.jks"))) {
                keystore.load(is, "".toCharArray());
            }

            PKIXParameters params = new PKIXParameters(keystore);
            params.setRevocationEnabled(true);


0 comments:

Post a Comment