public PKIXPolicyNode( List _children, int _depth, Set _expectedPolicies, PolicyNode _parent, Set _policyQualifiers, String _validPolicy, boolean _critical) { children = _children; depth = _depth; expectedPolicies = _expectedPolicies; parent = _parent; policyQualifiers = _policyQualifiers; validPolicy = _validPolicy; critical = _critical; }
/** * Test #1 for <code>PKIXCertPathValidatorResult(TrustAnchor, * PolicyNode, PublicKey)</code> constructor<br> * Assertion: creates an instance of * <code>PKIXCertPathValidatorResult</code> * * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ @TestTargetNew( level = TestLevel.PARTIAL_COMPLETE, notes = "Doesn't verify NullPointerException.", method = "PKIXCertPathValidatorResult", args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} ) public final void testPKIXCertPathValidatorResult01() throws InvalidKeySpecException, NoSuchAlgorithmException { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { fail(getName() + ": not performed (could not create test TrustAnchor)"); } new PKIXCertPathValidatorResult( ta, TestUtils.getPolicyTree(), testPublicKey); }
/** * Test #2 for <code>PKIXCertPathValidatorResult(TrustAnchor, * PolicyNode, PublicKey)</code> constructor<br> * Assertion: <code>NullPointerException</code> if * <code>TrustAnchor</code> parameter is <code>null</code> */ @TestTargetNew( level = TestLevel.PARTIAL_COMPLETE, notes = "Verifies NullPointerException.", method = "PKIXCertPathValidatorResult", args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} ) public final void testPKIXCertPathValidatorResult02() { try { // pass null new PKIXCertPathValidatorResult( null, TestUtils.getPolicyTree(), testPublicKey); fail("NPE expected"); } catch (NullPointerException e) { } }
/** * Test #3 for <code>PKIXCertPathValidatorResult(TrustAnchor, * PolicyNode, PublicKey)</code> constructor<br> * Assertion: <code>NullPointerException</code> if * <code>PublicKey</code> parameter is <code>null</code> */ @TestTargetNew( level = TestLevel.PARTIAL_COMPLETE, notes = "Verifies NullPointerException.", method = "PKIXCertPathValidatorResult", args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} ) public final void testPKIXCertPathValidatorResult03() { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { fail(getName() + ": not performed (could not create test TrustAnchor)"); } try { // pass null new PKIXCertPathValidatorResult( ta, TestUtils.getPolicyTree(), null); fail("NPE expected"); } catch (NullPointerException e) { } }
/** * Test #4 for <code>PKIXCertPathValidatorResult(TrustAnchor, * PolicyNode, PublicKey)</code> constructor<br> * Assertion: <code>PolicyNode</code>can be <code>null</code> */ @TestTargetNew( level = TestLevel.PARTIAL_COMPLETE, notes = "Verifies null as a parameter.", method = "PKIXCertPathValidatorResult", args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class} ) public final void testPKIXCertPathValidatorResult04() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { fail(getName() + ": not performed (could not create test TrustAnchor)"); } new PKIXCertPathValidatorResult( ta, null, testPublicKey); }
/** * Test for <code>getPolicyTree()</code> method<br> * Assertion: returns the root node of the valid * policy tree or <code>null</code> if there are * no valid policies * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ @TestTargetNew( level = TestLevel.PARTIAL_COMPLETE, notes = "Verifies that getPolicyTree method returns the root node of the valid policy tree.", method = "getPolicyTree", args = {} ) public final void testGetPolicyTree01() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { fail(getName() + ": not performed (could not create test TrustAnchor)"); } // valid policy tree case; PolicyNode pn = TestUtils.getPolicyTree(); PKIXCertPathValidatorResult vr = new PKIXCertPathValidatorResult( ta, pn, testPublicKey); // must return the same reference passed // as a parameter to the constructor assertSame(pn, vr.getPolicyTree()); }
/** * Test for <code>getPolicyTree()</code> method<br> * Assertion: returns the root node of the valid * policy tree or <code>null</code> if there are * no valid policies * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ public final void testGetPolicyTree01() throws Exception { TrustAnchor ta = TestUtils.getTrustAnchor(); if (ta == null) { fail(getName() + ": not performed (could not create test TrustAnchor)"); } // valid policy tree case; PolicyNode pn = TestUtils.getPolicyTree(); PKIXCertPathValidatorResult vr = new PKIXCertPathValidatorResult( ta, pn, testPublicKey); // must return the same reference passed // as a parameter to the constructor assertSame(pn, vr.getPolicyTree()); }
/** * Gets the root node of the valid policy tree, or null if the * valid policy tree is null. Marks each node of the returned tree * immutable and thread-safe. * * @returns the root node of the valid policy tree, or null if * the valid policy tree is null */ PolicyNode getPolicyTree() { if (rootNode == null) return null; else { PolicyNodeImpl policyTree = rootNode.copyTree(); policyTree.setImmutable(); return policyTree; } }
/** * Gets the root node of the valid policy tree, or null if the * valid policy tree is null. Marks each node of the returned tree * immutable and thread-safe. * * @return the root node of the valid policy tree, or null if * the valid policy tree is null */ PolicyNode getPolicyTree() { if (rootNode == null) return null; else { PolicyNodeImpl policyTree = rootNode.copyTree(); policyTree.setImmutable(); return policyTree; } }
/** * * @return the valid policy tree, <b>null</b> if no valid policy exists. * @throws IllegalStateException if the {@link PKIXCertPathReviewer} was not initialized */ public PolicyNode getPolicyTree() { doChecks(); return policyTree; }
public PolicyNode getParent() { return parent; }
@Override public PolicyNode getParent() { return parent; }