📄 nistcertpathtest.java
字号:
{ doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, new String[] { GOOD_CA_CERT, "PoliciesP2subCA2Cert", "DifferentPoliciesTest5EE" }, new String[] { TRUST_ANCHOR_ROOT_CRL, GOOD_CA_CRL, "PoliciesP2subCA2CRL" }, 0, "No valid policy tree found when one expected."); } public void testOverlappingPoliciesTest6() throws Exception { String[] certList = new String[] { "PoliciesP1234CACert", "PoliciesP1234subCAP123Cert", "PoliciesP1234subsubCAP123P12Cert", "OverlappingPoliciesTest6EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "PoliciesP1234CACRL", "PoliciesP1234subCAP123CRL", "PoliciesP1234subsubCAP123P12CRL" }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList); doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy2, -1, "Path processing failed on policy."); } public void testDifferentPoliciesTest7() throws Exception { String[] certList = new String[] { "PoliciesP123CACert", "PoliciesP123subCAP12Cert", "PoliciesP123subsubCAP12P1Cert", "DifferentPoliciesTest7EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "PoliciesP123CACRL", "PoliciesP123subCAP12CRL", "PoliciesP123subsubCAP12P1CRL" }; doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, 0, "No valid policy tree found when one expected."); } public void testDifferentPoliciesTest8() throws Exception { String[] certList = new String[] { "PoliciesP12CACert", "PoliciesP12subCAP1Cert", "PoliciesP12subsubCAP1P2Cert", "DifferentPoliciesTest8EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "PoliciesP12CACRL", "PoliciesP12subCAP1CRL", "PoliciesP12subsubCAP1P2CRL" }; doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, 1, "No valid policy tree found when one expected."); } public void testDifferentPoliciesTest9() throws Exception { String[] certList = new String[] { "PoliciesP123CACert", "PoliciesP123subCAP12Cert", "PoliciesP123subsubCAP12P2Cert", "PoliciesP123subsubsubCAP12P2P1Cert", "DifferentPoliciesTest9EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "PoliciesP123CACRL", "PoliciesP123subCAP12CRL", "PoliciesP123subsubCAP2P2CRL", "PoliciesP123subsubsubCAP12P2P1CRL" }; doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, 1, "No valid policy tree found when one expected."); } public void testAllCertificatesSamePoliciesTest10() throws Exception { String[] certList = new String[] { "PoliciesP12CACert", "AllCertificatesSamePoliciesTest10EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "PoliciesP12CACRL" }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList); doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy2); } public void testAllCertificatesAnyPolicyTest11() throws Exception { String[] certList = new String[] { "anyPolicyCACert", "AllCertificatesanyPolicyTest11EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "anyPolicyCACRL" }; PKIXCertPathValidatorResult result = doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList); result = doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); } public void testDifferentPoliciesTest12() throws Exception { String[] certList = new String[] { "PoliciesP3CACert", "DifferentPoliciesTest12EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "PoliciesP3CACRL" }; doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, 0, "No valid policy tree found when one expected."); } public void testAllCertificatesSamePoliciesTest13() throws Exception { String[] certList = new String[] { "PoliciesP123CACert", "AllCertificatesSamePoliciesTest13EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "PoliciesP123CACRL" }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy2); doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy3); } public void testAnyPolicyTest14() throws Exception { String[] certList = new String[] { "anyPolicyCACert", "AnyPolicyTest14EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "anyPolicyCACRL" }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy2, -1, "Path processing failed on policy."); } public void testUserNoticeQualifierTest15() throws Exception { String[] certList = new String[] { "UserNoticeQualifierTest15EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList); doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy2, -1, "Path processing failed on policy."); } public void testUserNoticeQualifierTest16() throws Exception { String[] certList = new String[] { GOOD_CA_CERT, "UserNoticeQualifierTest16EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, GOOD_CA_CRL }; PKIXCertPathValidatorResult result = doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList); result = doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy2, -1, "Path processing failed on policy."); } public void testUserNoticeQualifierTest17() throws Exception { String[] certList = new String[] { GOOD_CA_CERT, "UserNoticeQualifierTest17EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, GOOD_CA_CRL }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList); doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy2, -1, "Path processing failed on policy."); } public void testUserNoticeQualifierTest18() throws Exception { String[] certList = new String[] { "PoliciesP12CACert", "UserNoticeQualifierTest18EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "PoliciesP12CACRL" }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy2); } public void testUserNoticeQualifierTest19() throws Exception { String[] certList = new String[] { "UserNoticeQualifierTest19EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy2, -1, "Path processing failed on policy."); } public void testInvalidInhibitPolicyMappingTest1() throws Exception { String[] certList = new String[] { "inhibitPolicyMapping0CACert", "inhibitPolicyMapping0subCACert", "InvalidinhibitPolicyMappingTest1EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "inhibitPolicyMapping0CACRL", "inhibitPolicyMapping0subCACRL" }; doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, null, 0, "No valid policy tree found when one expected."); } public void testValidinhibitPolicyMappingTest2() throws Exception { String[] certList = new String[] { "inhibitPolicyMapping1P12CACert", "inhibitPolicyMapping1P12subCACert", "ValidinhibitPolicyMappingTest2EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "inhibitPolicyMapping1P12CACRL", "inhibitPolicyMapping1P12subCACRL" }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, nistTestPolicy1); } // 4.12.7 public void testValidSelfIssuedinhibitAnyPolicyTest7() throws Exception { String[] certList = new String[] { "inhibitAnyPolicy1CACert", "inhibitAnyPolicy1SelfIssuedCACert", "inhibitAnyPolicy1subCA2Cert", "ValidSelfIssuedinhibitAnyPolicyTest7EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "inhibitAnyPolicy1CACRL", "inhibitAnyPolicy1subCA2CRL" }; doBuilderTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, null, false, false); } // 4.4.19 public void testValidSeparateCertificateandCRLKeysTest19() throws Exception { String[] certList = new String[] { "SeparateCertificateandCRLKeysCertificateSigningCACert", "SeparateCertificateandCRLKeysCRLSigningCert", "ValidSeparateCertificateandCRLKeysTest19EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "SeparateCertificateandCRLKeysCRL" }; doBuilderTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, null, false, false); } public void testValidpathLenConstraintTest13() throws Exception { String[] certList = new String[] { "pathLenConstraint6CACert", "pathLenConstraint6subCA4Cert", "pathLenConstraint6subsubCA41Cert", "pathLenConstraint6subsubsubCA41XCert", "ValidpathLenConstraintTest13EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "pathLenConstraint6CACRL", "pathLenConstraint6subCA4CRL", "pathLenConstraint6subsubCA41CRL", "pathLenConstraint6subsubsubCA41XCRL" }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, null); } // 4.4.10 public void testInvalidUnknownCRLExtensionTest10() throws Exception { String[] certList = new String[] { "UnknownCRLExtensionCACert", "InvalidUnknownCRLExtensionTest10EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "UnknownCRLExtensionCACRL" }; doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, null, 0, "CRL contains unsupported critical extensions."); } // 4.14.3 public void testInvaliddistributionPointTest3() throws Exception { String[] certList = new String[] { "distributionPoint1CACert", "InvaliddistributionPointTest3EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "distributionPoint1CACRL" }; doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, null, 0, "No match for certificate CRL issuing distribution point name to cRLIssuer CRL distribution point."); } // 4.14.5 public void testValiddistributionPointTest5() throws Exception { String[] certList = new String[] { "distributionPoint2CACert", "ValiddistributionPointTest5EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "distributionPoint2CACRL" }; doTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, null); } // 4.14.8 public void testInvaliddistributionPointTest8() throws Exception { String[] certList = new String[] { "distributionPoint2CACert", "InvaliddistributionPointTest8EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "distributionPoint2CACRL" }; doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, null, 0, "No match for certificate CRL issuing distribution point name to cRLIssuer CRL distribution point."); } // 4.14.9 public void testInvaliddistributionPointTest9() throws Exception { String[] certList = new String[] { "distributionPoint2CACert", "InvaliddistributionPointTest9EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "distributionPoint2CACRL" }; doExceptionTest(TRUST_ANCHOR_ROOT_CERTIFICATE, certList, crlList, null, 0, "No match for certificate CRL issuing distribution point name to cRLIssuer CRL distribution point."); } // 4.14.17 public void testInvalidonlySomeReasonsTest17() throws Exception { String[] certList = new String[] { "onlySomeReasonsCA2Cert", "InvalidonlySomeReasonsTest17EE" }; String[] crlList = new String[] { TRUST_ANCHOR_ROOT_CRL, "onlySomeReasonsCA2CRL1", "onlySomeReasonsCA2CRL2" };
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -