Code example for PolicyQualifierInfo

Methods: getEncoded

0
    public final void testPolicyQualifierInfo04() throws IOException  { 
        // get valid encoding 
        byte[] encoding = getDerEncoding();
        byte[] encodingCopy = encoding.clone();
        // pass valid array 
        PolicyQualifierInfo i = new PolicyQualifierInfo(encodingCopy);
        // get encoding 
        byte[] encodingRet = i.getEncoded();
        // check returned array 
        assertTrue(Arrays.equals(encoding, encodingRet));
        // modify input 
        encodingCopy[0] = (byte)0;
        // get encoding again 
        byte[] encodingRet1 = i.getEncoded();
        // check that above modification did not change 
        // internal state of the PolicyQualifierInfo instance 
        assertTrue(Arrays.equals(encoding, encodingRet1));
    } 
 
    /**