use of java.security.cert.CRL in project j2objc by google.
the class IosCertificateFactory method engineGenerateCRLs.
@Override
public Collection<? extends CRL> engineGenerateCRLs(InputStream inStream) throws CRLException {
List<CRL> result = new ArrayList<CRL>();
CRL crl;
while ((crl = engineGenerateCRL(inStream)) != null) {
result.add(crl);
}
return result;
}
use of java.security.cert.CRL in project j2objc by google.
the class CertificateFactorySpiTest method testCertificateFactorySpi02.
/**
* Test for <code>CertificateFactorySpi</code> constructor
* Assertion: constructs CertificateFactorySpi
*/
public void testCertificateFactorySpi02() throws CertificateException, CRLException {
CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
MyCertificateFactorySpi.putMode(true);
ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
DataInputStream dis = new DataInputStream(bais);
try {
certFactorySpi.engineGenerateCertPath(bais);
fail("CertificateException must be thrown");
} catch (CertificateException e) {
}
certFactorySpi.engineGenerateCertPath(dis);
try {
certFactorySpi.engineGenerateCertPath(bais, "aa");
fail("CertificateException must be thrown");
} catch (CertificateException e) {
}
try {
certFactorySpi.engineGenerateCertPath(dis, "");
fail("IllegalArgumentException must be thrown");
} catch (IllegalArgumentException e) {
}
certFactorySpi.engineGenerateCertPath(dis, "ss");
try {
certFactorySpi.engineGenerateCertificate(bais);
fail("CertificateException must be thrown");
} catch (CertificateException e) {
}
try {
certFactorySpi.engineGenerateCertificates(null);
fail("CertificateException must be thrown");
} catch (CertificateException e) {
}
Certificate cert = certFactorySpi.engineGenerateCertificate(dis);
assertNull("Result must be null", cert);
Collection<? extends Certificate> col = certFactorySpi.engineGenerateCertificates(dis);
assertNull("Result must be null", col);
try {
certFactorySpi.engineGenerateCRL(bais);
fail("CRLException must be thrown");
} catch (CRLException e) {
}
try {
certFactorySpi.engineGenerateCRLs(null);
fail("CRLException must be thrown");
} catch (CRLException e) {
}
CRL crl = certFactorySpi.engineGenerateCRL(dis);
assertNull("Result must be null", crl);
Collection<? extends CRL> colcrl = certFactorySpi.engineGenerateCRLs(dis);
assertNull("Result must be null", colcrl);
List<Certificate> list = null;
try {
certFactorySpi.engineGenerateCertPath(list);
fail("NullPointerException must be thrown");
} catch (NullPointerException e) {
}
Iterator<String> enc = certFactorySpi.engineGetCertPathEncodings();
assertTrue("Incorrect Iterator", enc.hasNext());
}
use of java.security.cert.CRL in project j2objc by google.
the class CRLTest method testIsRevoked.
/**
* Test for <code>isRevoked()</code> method
*/
public final void testIsRevoked() {
CRL crl = new MyCRL("TEST_TYPE");
crl.isRevoked(null);
}
use of java.security.cert.CRL in project j2objc by google.
the class CRLTest method testConstructor.
//
// Tests
//
/**
* Test for <code>CRL(String type)</code> constructor<br>
*/
public final void testConstructor() {
for (int i = 0; i < validValues.length; i++) {
CRL crl = new MyCRL(validValues[i]);
assertEquals(validValues[i], crl.getType());
}
for (int i = 0; i < invalidValues.length; i++) {
CRL crl = new MyCRL(invalidValues[i]);
assertEquals(invalidValues[i], crl.getType());
}
try {
CRL crl = new MyCRL(null);
} catch (Exception e) {
fail("Unexpected exception for NULL parameter");
}
}
use of java.security.cert.CRL in project j2objc by google.
the class CRLTest method testGetType01.
/**
* Test #1 for <code>getType()</code> method<br>
* Assertion: returns <code>CRL</code> type
*/
public final void testGetType01() {
CRL crl = new MyCRL("TEST_TYPE");
assertEquals("TEST_TYPE", crl.getType());
}
Aggregations