use of java.security.Certificate in project robovm by robovm.
the class Identity2Test method test_certificates.
/**
* java.security.Identity#certificates()
*/
public void test_certificates() throws Exception {
IdentitySubclass sub = new IdentitySubclass("test", new IdentityScopeSubclass());
CertificateFactory cf = CertificateFactory.getInstance("X.509");
X509Certificate[] cert = new X509Certificate[1];
cert[0] = (X509Certificate) cf.generateCertificate(certArray);
sub.setPublicKey(cert[0].getPublicKey());
CertificateImpl certImpl = new CertificateImpl(cert[0]);
sub.addCertificate(certImpl);
java.security.Certificate[] certs = sub.certificates();
assertEquals("Certificate not contained in the identity", certs[0], certImpl);
}
Aggregations