Code example for Certificate

Methods: getPublicKey

0
    /** 
     * This test just calls <code>testGetPublicKey()</code> method<br> 
     */ 
    public final void testGetPublicKey() { 
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        c1.getPublicKey();
    } 
 
    /** 
     * This test just calls <code>writeReplace()</code> method<br> 
     */ 
    public final void testWriteReplace() throws Exception { 
        MyCertificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        Object obj = c1.writeReplace();
        assertTrue(obj.toString().contains("java.security.cert.Certificate$CertificateRep"));
    } 
 
public class MyModifiablePublicKey implements PublicKey {
 
        private PublicKey key;
        private boolean modifiedAlgo;