Code example for X509Certificate

Methods: getExtensionValue

0
                fail("The values for extension "+id+" differ.");
            } 
        } 
        assertNull("Null value should be returned in the case of "
                + "nonexisting extension",  
                certificate.getExtensionValue("1.1.1.1"));
    } 
     
    /** 
     * getCriticalExtensionOIDs() method testing. 
     */ 
    public void testGetCriticalExtensionOIDs() { 
        Set certCEOids = certificate.getCriticalExtensionOIDs();
        if (!(certCEOids.containsAll(allCritical) 
                    && allCritical.containsAll(certCEOids))) {
            fail("Incorrect value of Critical Extension OIDs");
        } 
    } 
     
    /** 
     * getNonCriticalExtensionOIDs() method testing.