use of org.jpos.security.SecureDESKey in project jPOS by jpos.
the class JCESecurityModuleTest method testImportPINImplThrowsNullPointerException2.
@Test
public void testImportPINImplThrowsNullPointerException2() throws Throwable {
try {
new JCESecurityModule().importPINImpl(null, 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 testTranslatePINImplThrowsNullPointerException.
@Test
public void testTranslatePINImplThrowsNullPointerException() throws Throwable {
try {
new JCESecurityModule().translatePINImpl(new EncryptedPIN("testString".getBytes(), (byte) 0, "testJCESecurityModuleAccountNumber"), 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 testTranslatePINImplThrowsNullPointerException2.
@Test
public void testTranslatePINImplThrowsNullPointerException2() throws Throwable {
byte[] keyBytes = new byte[0];
try {
new JCESecurityModule().translatePINImpl(null, 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 translateKeySchemeImpl_Same.
@Test
public void translateKeySchemeImpl_Same() throws Throwable {
SecureDESKey conv = jcesecmod.translateKeySchemeImpl(zpk, KeyScheme.U);
assertEquals(zpk.getKeyLength(), conv.getKeyLength());
assertEquals(zpk.getKeyType(), conv.getKeyType());
Assert.assertArrayEquals(zpk.getKeyCheckValue(), conv.getKeyCheckValue());
Assert.assertEquals(KeyScheme.U, zpk.getScheme());
Assert.assertEquals(zpk.getVariant(), zpk.getVariant());
}
use of org.jpos.security.SecureDESKey in project jPOS by jpos.
the class JCESecurityModuleTest method testImportKeyImplThrowsNullPointerException.
@Test
public void testImportKeyImplThrowsNullPointerException() throws Throwable {
byte[] encryptedKey = new byte[2];
try {
new JCESecurityModule().importKeyImpl((short) 100, "testJCESecurityModuleKeyType", encryptedKey, new SecureDESKey((short) 100, "testJCESecurityModuleKeyType", "testJCESecurityModuleKeyHexString1", "testJCESecurityModuleKeyCheckValueHexString1"), true);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations