private void testKeyPairGenerationWithOIDs()
throws Exception
{
KeyPairGenerator kpGen = KeyPairGenerator.getInstance("ECDSA", "BC");
kpGen.initialize(new ECGenParameterSpec(X9ObjectIdentifiers.prime192v1.getId()));
kpGen.initialize(new ECGenParameterSpec(TeleTrusTObjectIdentifiers.brainpoolP160r1.getId()));
kpGen.initialize(new ECGenParameterSpec(SECObjectIdentifiers.secp128r1.getId()));
try
{
kpGen.initialize(new ECGenParameterSpec("1.1"));
fail("non-existant curve OID failed");
}
catch (InvalidAlgorithmParameterException e)
{
if (!"unknown curve OID: 1.1".equals(e.getMessage()))
{
fail("OID message check failed");
}
}
try
{
kpGen.initialize(new ECGenParameterSpec("flibble"));
fail("non-existant curve name failed");
}
catch (InvalidAlgorithmParameterException e)
{