Code example for X509Certificate

Methods: verify

0
    /** 
     * TODO 
     * verify(PublicKey key, String sigProvider) method testing. 
     */ 
    public void testVerify2() throws Exception { 
        certificate.verify(publicKey, Signature.getInstance("SHA1withDSA")
                .getProvider().getName());
    } 
     
    /** 
     * TODO 
     * verify(PublicKey key) method testing. 
     */ 
    public void testVerify3() throws Exception { 
        try { 
            certificate.verify(publicKey);
            fail("Incorrect signature successfully verified.");
        } catch (Exception e) {
        } 
    }