Code example for Certificate

Methods: getEncodedgetPublicKeygetType

0
    /** 
     * Test for <code>Certificate(String type)</code> method<br> 
     */ 
    public final void testCertificate() throws Exception { 
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
        assertTrue(Arrays.equals(testEncoding, c1.getEncoded()));
        assertEquals("TEST", c1.getPublicKey().getAlgorithm());
        assertTrue(Arrays.equals(new byte[] { (byte) 1, (byte) 2, (byte) 3 },
                                 c1.getPublicKey().getEncoded()));
        assertEquals("TEST_FORMAT", c1.getPublicKey().getFormat());
        assertEquals("TEST_TYPE", c1.getType());
    } 
 
    /** 
     * Test for <code>hashCode()</code> method<br> 
     * Assertion: returns hash of the <code>Certificate</code> instance 
     * @throws CertificateEncodingException 
     */ 
    public final void testHashCode() throws CertificateEncodingException { 
        Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
Stop searching for code, let great code find you!  Add Codota to your java IDE