custom PKIXCertPathChecker (chap 7)
Hi
I implemented my own PKIXCertPathChecker which checks status of cert using OCSP and also some custom extensions. My Custom certpathchecker is stateful, and does not support ForwardChecking , since we need certificates passed to our checker starting from Trust ANchror and to target (end entity) certificate, as described in chapter 7
below is the output of certificate chain (1), certstore passed to PKIXParameters (2), certpath passed to PKIXParameters(3) and Trust Anchor used to construct PKIXParameters (4)
1)
***********************
printing certchain for CN=Sample User Certficate
CN=SubAdminCA2,O=EJBCA Sample,C=SE
CN=AdminCA1,O=EJBCA Sample,C=SE
***********************
2)
***********************
printing certs in certstore
CN=Sample User Certficate issuer is CN=SubAdminCA2,O=EJBCA Sample,C=SE
CN=AdminCA1,O=EJBCA Sample,C=SE issuer is CN=AdminCA1,O=EJBCA Sample,C=SE
CN=SubAdminCA2,O=EJBCA Sample,C=SE issuer is CN=AdminCA1,O=EJBCA Sample,C=SE
***********************
3)
***********************
printing certs in certpath
CN=Sample User Certficate issuer is CN=SubAdminCA2,O=EJBCA Sample,C=SE
CN=SubAdminCA2,O=EJBCA Sample,C=SE issuer is CN=AdminCA1,O=EJBCA Sample,C=SE
***********************
4)
***********************
printing trust anchor CN=AdminCA1,O=EJBCA Sample,C=SE
***********************
Inside check method of CustomCertPathChecker I print certificate passed as argument, and the only thing printed is
***********************
certificate prsented to pathcheckerCN=Sample User Certficate
***********************
so it seems as if the only certificate passed to CustomCertPathChecker is end entity certificate, I would assume from text that it should be AdminCA1 first, followed by SubAdminCA2 and last Sample User Certficate.
NOTE: I set setRevocationEnabled(false) on PKIXParameters , and add my customcertpathchecker through addCertPathChecker. CertPathValidator is constructed as CertPathValidator.getInstance("PKIX", "BC")
any advices would be greatly appreciated.
Sincerely
Ray
|