use of org.apache.harmony.security.tests.support.cert.MyCertificate in project robovm by robovm.
the class CertificateTest method testCertificate.
/**
* 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());
}
use of org.apache.harmony.security.tests.support.cert.MyCertificate in project robovm by robovm.
the class CertificateTest method testGetType.
/**
* Test for <code>getType()</code> method<br>
* Assertion: returns this certificate type
*/
public final void testGetType() {
Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
assertEquals("TEST_TYPE", c1.getType());
}
use of org.apache.harmony.security.tests.support.cert.MyCertificate in project robovm by robovm.
the class CertificateTest method testGetPublicKey.
/**
* This test just calls <code>testGetPublicKey()</code> method<br>
*/
public final void testGetPublicKey() {
Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
c1.getPublicKey();
}
use of org.apache.harmony.security.tests.support.cert.MyCertificate in project robovm by robovm.
the class CertificateTest method testEqualsObject04.
/**
* Test for <code>equals(Object)</code> method<br>
* Assertion: object not equals to other which is not
* instance of <code>Certificate</code>
*/
public final void testEqualsObject04() {
Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
assertFalse(c1.equals("TEST_TYPE"));
}
use of org.apache.harmony.security.tests.support.cert.MyCertificate in project robovm by robovm.
the class CertificateTest method testVerifyPublicKey.
/**
* This test just calls <code>verify(PublicKey)</code> method<br>
*
* @throws InvalidKeyException
* @throws CertificateException
* @throws NoSuchAlgorithmException
* @throws NoSuchProviderException
* @throws SignatureException
*/
public final void testVerifyPublicKey() throws InvalidKeyException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException {
Certificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
c1.verify(null);
}
Aggregations