if (!DEFSupported) {
fail(NotSupportMsg);
return;
}
KeyAgreementSpi spi = new MyKeyAgreementSpi();
KeyAgreement keyA = new myKeyAgreement(spi, defaultProvider,
defaultAlgorithm);
assertEquals("Incorrect algorithm", keyA.getAlgorithm(),
defaultAlgorithm);
assertEquals("Incorrect provider", keyA.getProvider(), defaultProvider);
assertNull("Incorrect result", keyA.doPhase(null, true));
assertEquals("Incorrect result", keyA.generateSecret().length, 0);
keyA = new myKeyAgreement(null, null, null);
assertNull("Algorithm must be null", keyA.getAlgorithm());
assertNull("Provider must be null", keyA.getProvider());
try {
keyA.doPhase(null, true);
fail("NullPointerException must be thrown");
} catch (NullPointerException e) {
}
}