use of java.security.KeyFactorySpi in project robovm by robovm.
the class KeyFactorySpiTest method testKeyFactorySpi.
/**
* Test for <code>KeyFactorySpi</code> constructor
* Assertion: constructs KeyFactorySpi
*/
public void testKeyFactorySpi() {
MyKeyFactorySpi keyFSpi = new MyKeyFactorySpi();
assertTrue(keyFSpi instanceof KeyFactorySpi);
KeySpec ks = new MyKeySpec();
KeySpec kss = new MyKeySpec();
try {
keyFSpi.engineGeneratePrivate(ks);
keyFSpi.engineGeneratePublic(ks);
keyFSpi.engineGetKeySpec(null, java.lang.Class.class);
keyFSpi.engineTranslateKey(null);
} catch (Exception e) {
fail("Unexpected exception");
}
}
use of java.security.KeyFactorySpi in project j2objc by google.
the class KeyFactorySpiTest method testKeyFactorySpi.
/**
* Test for <code>KeyFactorySpi</code> constructor
* Assertion: constructs KeyFactorySpi
*/
public void testKeyFactorySpi() {
MyKeyFactorySpi keyFSpi = new MyKeyFactorySpi();
assertTrue(keyFSpi instanceof KeyFactorySpi);
KeySpec ks = new MyKeySpec();
KeySpec kss = new MyKeySpec();
try {
keyFSpi.engineGeneratePrivate(ks);
keyFSpi.engineGeneratePublic(ks);
keyFSpi.engineGetKeySpec(null, java.lang.Class.class);
keyFSpi.engineTranslateKey(null);
} catch (Exception e) {
fail("Unexpected exception");
}
}
use of java.security.KeyFactorySpi in project robovm by robovm.
the class KeyFactory2Test method test_constructor.
public void test_constructor() throws Exception {
KeyFactorySpi kfs = new KeyFactorySpiStub();
new KeyFactoryStub(null, null, null);
Provider[] providers = Security.getProviders("KeyFactory.DSA");
if (providers != null) {
for (int i = 0; i < providers.length; i++) {
KeyFactoryStub kf = new KeyFactoryStub(kfs, providers[i], "algorithm name");
assertEquals("algorithm name", kf.getAlgorithm());
assertEquals(providers[i], kf.getProvider());
}
} else {
fail("No providers support KeyFactory.DSA");
}
}
Aggregations