Code example for TrustAnchor

Methods: getCAPublicKey

0
        TrustAnchor ta =
            new TrustAnchor(validCaNameRfc2253, pk, null);
        assertEquals("equals1", pk, ta.getCAPublicKey());
        // sub testcase 2 
        X500Principal x500p = new X500Principal(validCaNameRfc2253);
        ta = new TrustAnchor(x500p, pk, null);
        assertEquals("equals2", pk, ta.getCAPublicKey());
    } 
 
 
    /** 
     * Test #1 for <code>getCAName()</code> method<br> 
     *   
     * Assertion: returns most trusted CA name as <code>String</code><br> 
     * Test preconditions: valid name passed to the constructor<br> 
     * Expected: the same name must be returned by the method<br> 
     * @throws InvalidKeySpecException 
     */ 
    public final void testGetCAName01() throws Exception { 
 
        PublicKey pk = new TestKeyPair(keyAlg).getPublic();