use of java.security.cert.CertStoreSpi in project robovm by robovm.
the class CertStoreSpiTest method testCertStoreSpi01.
/**
* Test for <code>CertStoreSpi</code> constructor Assertion: constructs
* CertStoreSpi
*/
public void testCertStoreSpi01() throws InvalidAlgorithmParameterException, CertStoreException {
CertStoreSpi certStoreSpi = null;
//new
CertSelector certSelector = new tmpCertSelector();
// X509CertSelector();
//new X509CRLSelector();
CRLSelector crlSelector = new tmpCRLSelector();
try {
certStoreSpi = new MyCertStoreSpi(null);
fail("InvalidAlgorithmParameterException must be thrown");
} catch (InvalidAlgorithmParameterException e) {
}
certStoreSpi = new MyCertStoreSpi(new MyCertStoreParameters());
assertNull("Not null collection", certStoreSpi.engineGetCertificates(certSelector));
assertNull("Not null collection", certStoreSpi.engineGetCRLs(crlSelector));
}
use of java.security.cert.CertStoreSpi in project robovm by robovm.
the class myCertStore method testCertStore02.
/**
* Test for
* <code>CertStore</code> constructor
* Assertion: returns CertStore object
*/
public void testCertStore02() throws InvalidAlgorithmParameterException, CertStoreException {
if (!initParams()) {
return;
}
MyCertStoreParameters pp = new MyCertStoreParameters();
CertStoreSpi spi = new MyCertStoreSpi(pp);
CertStore certS = new myCertStore(spi, dProv, dType, pp);
assertEquals("Incorrect algorithm", certS.getType(), dType);
assertEquals("Incorrect provider", certS.getProvider(), dProv);
assertTrue("Incorrect parameters", certS.getCertStoreParameters() instanceof MyCertStoreParameters);
try {
certS.getCertificates(null);
fail("CertStoreException must be thrown");
} catch (CertStoreException e) {
}
certS = new myCertStore(null, null, null, null);
assertNull("Incorrect algorithm", certS.getType());
assertNull("Incorrect provider", certS.getProvider());
assertNull("Incorrect parameters", certS.getCertStoreParameters());
try {
certS.getCertificates(null);
fail("NullPointerException must be thrown");
} catch (NullPointerException e) {
}
}
Aggregations