java.security.cert.CertificateFactorySpi Java Examples

The following examples show how to use java.security.cert.CertificateFactorySpi. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CertificateFactorySpiTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Test for <code>engineGenerateCertPath(InputStream)</code> method.
 * Assertion: Generates a <code>CertPath</code> object and initializes it
 * with the data read from the <code>InputStream</code>
 */
public void testEngineGenerateCertPathLjava_io_InputStream01() {
    CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();

    MyCertificateFactorySpi.putMode(true);
    ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
    DataInputStream dis = new DataInputStream(bais);

    try {
        assertNull(certFactorySpi.engineGenerateCertPath(dis));
    } catch (CertificateException e) {
        fail("Unexpected CertificateException " + e.getMessage());
    }
}
 
Example #2
Source File: CertificateFactorySpiTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
public void testAbstractMethods() {
    CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi();
    ByteArrayInputStream bais = new ByteArrayInputStream(new byte[3]);
    DataInputStream dis = new DataInputStream(bais);

    try {
        certFactorySpi.engineGenerateCRL(dis);
        certFactorySpi.engineGenerateCRLs(dis);
        certFactorySpi.engineGenerateCertificate(dis);
        certFactorySpi.engineGenerateCertificates(dis);
    } catch (Exception e) {
        fail("Unexpected exception " + e.getMessage());
    }
}
 
Example #3
Source File: CertificateFactory1Test.java    From j2objc with Apache License 2.0 4 votes vote down vote up
public myCertificateFactory(CertificateFactorySpi spi, Provider prov,
        String type) {
    super(spi, prov, type);
}