當前位置: 首頁>>代碼示例>>Java>>正文


Java PKIXCertPathValidatorResult類代碼示例

本文整理匯總了Java中java.security.cert.PKIXCertPathValidatorResult的典型用法代碼示例。如果您正苦於以下問題:Java PKIXCertPathValidatorResult類的具體用法?Java PKIXCertPathValidatorResult怎麽用?Java PKIXCertPathValidatorResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PKIXCertPathValidatorResult類屬於java.security.cert包,在下文中一共展示了PKIXCertPathValidatorResult類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testPKIXCertPathValidatorResult01

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:28,代碼來源:PKIXCertPathValidatorResultTest.java

示例2: testPKIXCertPathValidatorResult02

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * 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) {
    }
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:24,代碼來源:PKIXCertPathValidatorResultTest.java

示例3: testPKIXCertPathValidatorResult03

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * 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) {
    }
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:28,代碼來源:PKIXCertPathValidatorResultTest.java

示例4: testPKIXCertPathValidatorResult04

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:23,代碼來源:PKIXCertPathValidatorResultTest.java

示例5: testGetTrustAnchor

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * Test for <code>getTrustAnchor()</code> method<br>
 * Assertion: returns <code>TrustAnchor</code> (never <code>null</code>)
 * @throws NoSuchAlgorithmException
 * @throws InvalidKeySpecException
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "getTrustAnchor",
    args = {}
)
public final void testGetTrustAnchor() throws Exception {
    TrustAnchor ta = TestUtils.getTrustAnchor();
    if (ta == null) {
        fail(getName() + ": not performed (could not create test TrustAnchor)");
    }

    PKIXCertPathValidatorResult vr =
        new PKIXCertPathValidatorResult(
                ta,
                null,
                testPublicKey);

    // must return the same reference passed
    // as a parameter to the constructor
    assertSame(ta, vr.getTrustAnchor());
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:29,代碼來源:PKIXCertPathValidatorResultTest.java

示例6: testGetPublicKey

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * Test for <code>getPublicKey()</code> method<br>
 * Assertion: returns the subject's public key (never <code>null</code>)
 * @throws NoSuchAlgorithmException
 * @throws InvalidKeySpecException
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "getPublicKey",
    args = {}
)
public final void testGetPublicKey() throws Exception {
    TrustAnchor ta = TestUtils.getTrustAnchor();
    if (ta == null) {
        fail(getName() + ": not performed (could not create test TrustAnchor)");
    }

    PublicKey pk = testPublicKey;
    PKIXCertPathValidatorResult vr =
        new PKIXCertPathValidatorResult(
                ta,
                null,
                pk);

    // must return the same reference passed
    // as a parameter to the constructor
    assertSame(pk, vr.getPublicKey());
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:30,代碼來源:PKIXCertPathValidatorResultTest.java

示例7: testGetPolicyTree01

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * 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());
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:33,代碼來源:PKIXCertPathValidatorResultTest.java

示例8: testGetPolicyTree02

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * 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 null if there are no valid policies.",
    method = "getPolicyTree",
    args = {}
)
public final void testGetPolicyTree02() throws Exception {
    TrustAnchor ta = TestUtils.getTrustAnchor();
    if (ta == null) {
        fail(getName() + ": not performed (could not create test TrustAnchor)");
    }

    // no valid policy tree case (null)
    PKIXCertPathValidatorResult vr =
        new PKIXCertPathValidatorResult(
                ta,
                null,
                testPublicKey);

    // must return the same reference passed
    // as a parameter to the constructor
    assertNull(vr.getPolicyTree());
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:32,代碼來源:PKIXCertPathValidatorResultTest.java

示例9: testToString01

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * Test #1 for <code>toString()</code> method<br>
 * Assertion: Returns a formatted string describing this object
 * @throws NoSuchAlgorithmException
 * @throws InvalidKeySpecException
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "toString",
    args = {}
)
public final void testToString01() throws Exception {
    TrustAnchor ta = TestUtils.getTrustAnchor();
    if (ta == null) {
        fail(getName() + ": not performed (could not create test TrustAnchor)");
    }

    PKIXCertPathValidatorResult vr =
        new PKIXCertPathValidatorResult(
                ta,
                TestUtils.getPolicyTree(),
                testPublicKey);

    assertNotNull(vr.toString());
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:27,代碼來源:PKIXCertPathValidatorResultTest.java

示例10: testToString02

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * Test #2 for <code>toString()</code> method<br>
 * Assertion: Returns a formatted string describing this object
 * @throws NoSuchAlgorithmException
 * @throws InvalidKeySpecException
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "toString",
    args = {}
)
public final void testToString02() throws Exception {
    TrustAnchor ta = TestUtils.getTrustAnchor();
    if (ta == null) {
        fail(getName() + ": not performed (could not create test TrustAnchor)");
    }

    PKIXCertPathValidatorResult vr =
        new PKIXCertPathValidatorResult(
                ta,
                null,
                testPublicKey);

    assertNotNull(vr.toString());
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:27,代碼來源:PKIXCertPathValidatorResultTest.java

示例11: testPKIXCertPathValidatorResult03

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * Test #3 for <code>PKIXCertPathValidatorResult(TrustAnchor,
 * PolicyNode, PublicKey)</code> constructor<br>
 * Assertion: <code>NullPointerException</code> if
 * <code>PublicKey</code> parameter is <code>null</code>
 */
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) {
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:22,代碼來源:PKIXCertPathValidatorResultTest.java

示例12: testGetTrustAnchor

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * Test for <code>getTrustAnchor()</code> method<br>
 * Assertion: returns <code>TrustAnchor</code> (never <code>null</code>)
 * @throws NoSuchAlgorithmException
 * @throws InvalidKeySpecException
 */
public final void testGetTrustAnchor() throws Exception {
    TrustAnchor ta = TestUtils.getTrustAnchor();
    if (ta == null) {
        fail(getName() + ": not performed (could not create test TrustAnchor)");
    }

    PKIXCertPathValidatorResult vr =
        new PKIXCertPathValidatorResult(
                ta,
                null,
                testPublicKey);

    // must return the same reference passed
    // as a parameter to the constructor
    assertSame(ta, vr.getTrustAnchor());
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:23,代碼來源:PKIXCertPathValidatorResultTest.java

示例13: testGetPublicKey

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * Test for <code>getPublicKey()</code> method<br>
 * Assertion: returns the subject's public key (never <code>null</code>)
 * @throws NoSuchAlgorithmException
 * @throws InvalidKeySpecException
 */
public final void testGetPublicKey() throws Exception {
    TrustAnchor ta = TestUtils.getTrustAnchor();
    if (ta == null) {
        fail(getName() + ": not performed (could not create test TrustAnchor)");
    }

    PublicKey pk = testPublicKey;
    PKIXCertPathValidatorResult vr =
        new PKIXCertPathValidatorResult(
                ta,
                null,
                pk);

    // must return the same reference passed
    // as a parameter to the constructor
    assertSame(pk, vr.getPublicKey());
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:24,代碼來源:PKIXCertPathValidatorResultTest.java

示例14: testGetPolicyTree01

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * 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());
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:27,代碼來源:PKIXCertPathValidatorResultTest.java

示例15: testGetPolicyTree02

import java.security.cert.PKIXCertPathValidatorResult; //導入依賴的package包/類
/**
 * 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 testGetPolicyTree02() throws Exception {
    TrustAnchor ta = TestUtils.getTrustAnchor();
    if (ta == null) {
        fail(getName() + ": not performed (could not create test TrustAnchor)");
    }

    // no valid policy tree case (null)
    PKIXCertPathValidatorResult vr =
        new PKIXCertPathValidatorResult(
                ta,
                null,
                testPublicKey);

    // must return the same reference passed
    // as a parameter to the constructor
    assertNull(vr.getPolicyTree());
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:26,代碼來源:PKIXCertPathValidatorResultTest.java


注:本文中的java.security.cert.PKIXCertPathValidatorResult類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。