Code example for PolicyQualifierInfo

Methods: getPolicyQualifier

0
        byte[] encoding = getDerEncoding();
        // get policy qualifier encoding 
        byte[] pqEncoding = new byte[28];
        System.arraycopy(encoding, 12, pqEncoding, 0, pqEncoding.length);
        // pass valid array 
        PolicyQualifierInfo i = new PolicyQualifierInfo(encoding);
        // get encoding 
        byte[] pqEncodingRet = i.getPolicyQualifier();
        // modify returned array 
        pqEncodingRet[0] = (byte)0;
        // get encoding again 
        byte[] pqEncodingRet1 = i.getPolicyQualifier();
        // 
        assertNotSame(pqEncodingRet, pqEncodingRet1);
        // check that above modification did not change 
        // internal state of the PolicyQualifierInfo instance 
        assertTrue(Arrays.equals(pqEncoding, pqEncodingRet1));
    } 
 
    /**