Code example for TrustAnchor

Methods: getCA

0
 
        PublicKey pk = new TestKeyPair(keyAlg).getPublic();
 
        // sub testcase 1 
        TrustAnchor ta =
            new TrustAnchor(validCaNameRfc2253, pk, null);
        X500Principal ca = ta.getCA();
        assertEquals("equals1", validCaNameRfc2253, ca.getName());
        // sub testcase 2 
        X500Principal x500p = new X500Principal(validCaNameRfc2253);
        ta = new TrustAnchor(x500p, pk, null);
        assertEquals("equals2", x500p, ta.getCA());
    } 
 
    // 
    // Private stuff 
    // 
     
    /* 
     * The following methods return valid DER encoding 
     * for the following ASN.1 definition (as specified in RFC 3280 -