use of org.jpos.security.SecureDESKey in project jPOS by jpos.
the class JCESecurityModuleTest method testExportPINImplThrowsNullPointerException.
@Test
public void testExportPINImplThrowsNullPointerException() throws Throwable {
try {
new JCESecurityModule().exportPINImpl(null, new SecureDESKey(), (byte) 0);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.security.SecureDESKey in project jPOS by jpos.
the class JCESecurityModuleTest method testTranslatePINImplThrowsNullPointerException1.
@Test
public void testTranslatePINImplThrowsNullPointerException1() throws Throwable {
byte[] keyBytes = new byte[0];
try {
new JCESecurityModule().translatePINImpl(new EncryptedPIN(), new SecureDESKey((short) 100, "testJCESecurityModuleKeyType", keyBytes, "testString".getBytes()), new SecureDESKey(), (byte) 0);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.security.SecureDESKey in project jPOS by jpos.
the class JCESecurityModuleTest method testExportKeyImplThrowsNullPointerException1.
@Test
public void testExportKeyImplThrowsNullPointerException1() throws Throwable {
try {
new JCESecurityModule().exportKeyImpl(new SecureDESKey((short) 100, "testJCESecurityModuleKeyType", "testJCESecurityModuleKeyHexString1", "testJCESecurityModuleKeyCheckValueHexString1"), new SecureDESKey());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.security.SecureDESKey in project jPOS by jpos.
the class JCESecurityModuleTest method testCalculatePVVImpl1.
@Test
public void testCalculatePVVImpl1() throws Throwable {
// pvk and zpk are same type
SecureDESKey pvk = tpk;
int pvki = 0;
String pvv = jcesecmod.calculatePVV(pinUnderLMK, pvk, null, pvki);
String expected = "1226";
assertEquals(expected, pvv);
}
use of org.jpos.security.SecureDESKey in project jPOS by jpos.
the class JCESecurityModuleTest method testExportKeyImplThrowsNullPointerException.
@Test
public void testExportKeyImplThrowsNullPointerException() throws Throwable {
try {
new JCESecurityModule().exportKeyImpl(null, new SecureDESKey((short) 100, "testJCESecurityModuleKeyType", "testJCESecurityModuleKeyHexString1", "testJCESecurityModuleKeyCheckValueHexString1"));
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations