Code example for TrustAnchor

Methods: getNameConstraints

        PublicKey pk = new TestKeyPair(keyAlg).getPublic();
        byte[] nc = getEncodingPSOnly();
        byte[] ncCopy = nc.clone();
        // sub testcase 5 - nameConstraints can be null 
        TrustAnchor ta = new TrustAnchor(validCaNameRfc2253, pk, ncCopy);
        // modify 
        // check that above modification did not change 
        // object internal state 
        assertTrue(Arrays.equals(nc, ta.getNameConstraints()));
     * Test #4 for <code>TrustAnchor(String, PublicKey, byte[])</code> constructor<br>  
     * Assertion: <code>NullPointerException</code> if <code>caName</code> 
     * or <code>caPublicKey</code> parameter is <code>null</code><br> 
     * Test preconditions: pass <code>null</code> as mentioned parameter<br> 
     * Expected: NullPointerException 
Stop searching for code, let great code find you!  Add Codota to your java IDE