@Test public void testImportKeyImplThrowsNullPointerException1() throws Throwable { try { new JCESecurityModule().importKeyImpl((short) 100, "testJCESecurityModuleKeyType", ">".getBytes(), null, true); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.jpos.security.SecureDESKey.getKeyBytes()\" because \"secureDESKey\" is null", ex.getMessage(), "ex.getMessage()"); } } }
@Override public SecureDESKey importKeyImpl (short keyLength, String keyType, byte[] encryptedKey, SecureDESKey kek, boolean checkParity) throws SMException { Key clearKEY = jceHandler.decryptDESKey(keyLength, encryptedKey, decryptFromLMK(kek), checkParity); return encryptToLMK(keyLength, keyType, clearKEY); }
JCESecurityModule extends BaseSMAdapter<SecureDESKey> { @Override public SecureDESKey importKeyImpl (short keyLength, String keyType, byte[] encryptedKey, SecureDESKey kek, boolean checkParity) throws SMException { Key clearKEY = jceHandler.decryptDESKey(keyLength, encryptedKey, decryptFromLMK(kek), checkParity); return encryptToLMK(keyLength, keyType, clearKEY); } }
JCESecurityModule extends BaseSMAdapter<SecureDESKey> { @Override public SecureDESKey importKeyImpl (short keyLength, String keyType, byte[] encryptedKey, SecureDESKey kek, boolean checkParity) throws SMException { Key clearKEY = jceHandler.decryptDESKey(keyLength, encryptedKey, decryptFromLMK(kek), checkParity); return encryptToLMK(keyLength, keyType, clearKEY); } JCESecurityModule();  JCESecurityModule(String lmkFile);  JCESecurityModule(String lmkFile, String jceProviderClassName);  JCESecurityModule(Configuration cfg, Logger logger, String realm); }
JCESecurityModule extends BaseSMAdapter<SecureDESKey> { @Override public SecureDESKey importKeyImpl (short keyLength, String keyType, byte[] encryptedKey, SecureDESKey kek, boolean checkParity) throws SMException { Key clearKEY = jceHandler.decryptDESKey(keyLength, encryptedKey, decryptFromLMK(kek), checkParity); return encryptToLMK(keyLength, keyType, clearKEY); } JCESecurityModule();  JCESecurityModule(String lmkFile);  JCESecurityModule(String lmkFile, String jceProviderClassName);  JCESecurityModule(Configuration cfg, Logger logger, String realm); @Override void setConfiguration(Configuration cfg); @Override SecureDESKey generateKeyImpl(short keyLength, String keyType); @Override SecureDESKey importKeyImpl(short keyLength, String keyType, byte[] encryptedKey,
            SecureDESKey kek, boolean checkParity); @Override byte[] exportKeyImpl(SecureDESKey key, SecureDESKey kek); @Override EncryptedPIN encryptPINImpl(String pin, String accountNumber); @Override String decryptPINImpl(EncryptedPIN pinUnderLmk); @Override EncryptedPIN importPINImpl(EncryptedPIN pinUnderKd1, SecureDESKey kd1); @Override EncryptedPIN exportPINImpl(EncryptedPIN pinUnderLmk, SecureDESKey kd2,
            byte destinationPINBlockFormat); @Override EncryptedPIN generatePINImpl(String accountNumber, int pinLen, List<String> excludes); @Override boolean verifyPVVImpl(EncryptedPIN pinUnderKd1, SecureDESKey kd1, SecureDESKey pvkA,
                             SecureDESKey pvkB, int pvki, String pvv); @Override EncryptedPIN translatePINImpl(EncryptedPIN pinUnderKd1, SecureDESKey kd1,
            SecureDESKey kd2, byte destinationPINBlockFormat); @Override byte[] generateARPCImpl(MKDMethod mkdm, SKDMethod skdm, SecureDESKey imkac
            ,String accountNo, String accntSeqNo, byte[] arqc, byte[] atc, byte[] upn
            ,ARPCMethod arpcMethod, byte[] arc, byte[] propAuthData); @Override byte[] verifyARQCGenerateARPCImpl(MKDMethod mkdm, SKDMethod skdm, SecureDESKey imkac
            ,String accountNo, String accntSeqNo, byte[] arqc, byte[] atc, byte[] upn 
            ,byte[] transData, ARPCMethod arpcMethod, byte[] arc, byte[] propAuthData); @Override byte[] encryptDataImpl(CipherMode cipherMode, SecureDESKey kd
            ,byte[] data, byte[] iv); @Override byte[] decryptDataImpl(CipherMode cipherMode, SecureDESKey kd
            ,byte[] data, byte[] iv); String generateClearKeyComponent(short keyLength); @Override SecureDESKey translateKeySchemeImpl(SecureDESKey key, KeyScheme keyScheme); SecureDESKey formKEYfromThreeClearComponents(
            short keyLength,
            String keyType,
            String clearComponent1HexString,
            String clearComponent2HexString,
            String clearComponent3HexString); @Override SecureDESKey formKEYfromClearComponents(short keyLength, String keyType, String... components); @Override byte[] dataEncrypt(SecureDESKey bdk, byte[] clearText); @Override byte[] dataDecrypt(SecureDESKey bdk, byte[] cypherText); SecureDESKey importBDK(String clearComponent1HexString,
                                  String clearComponent2HexString,
                                  String clearComponent3HexString); EncryptedPIN exportPIN(EncryptedPIN pinUnderLmk, KeySerialNumber ksn, SecureDESKey bdk, boolean tdes,
             byte destinationPINBlockFormat); }
JCESecurityModule extends BaseSMAdapter<SecureDESKey> { @Override public SecureDESKey importKeyImpl (short keyLength, String keyType, byte[] encryptedKey, SecureDESKey kek, boolean checkParity) throws SMException { Key clearKEY = jceHandler.decryptDESKey(keyLength, encryptedKey, decryptFromLMK(kek), checkParity); return encryptToLMK(keyLength, keyType, clearKEY); } JCESecurityModule();  JCESecurityModule(String lmkFile);  JCESecurityModule(String lmkFile, String jceProviderClassName);  JCESecurityModule(Configuration cfg, Logger logger, String realm); @Override void setConfiguration(Configuration cfg); @Override SecureDESKey generateKeyImpl(short keyLength, String keyType); @Override SecureDESKey importKeyImpl(short keyLength, String keyType, byte[] encryptedKey,
            SecureDESKey kek, boolean checkParity); @Override byte[] exportKeyImpl(SecureDESKey key, SecureDESKey kek); @Override EncryptedPIN encryptPINImpl(String pin, String accountNumber); @Override String decryptPINImpl(EncryptedPIN pinUnderLmk); @Override EncryptedPIN importPINImpl(EncryptedPIN pinUnderKd1, SecureDESKey kd1); @Override EncryptedPIN exportPINImpl(EncryptedPIN pinUnderLmk, SecureDESKey kd2,
            byte destinationPINBlockFormat); @Override EncryptedPIN generatePINImpl(String accountNumber, int pinLen, List<String> excludes); @Override boolean verifyPVVImpl(EncryptedPIN pinUnderKd1, SecureDESKey kd1, SecureDESKey pvkA,
                             SecureDESKey pvkB, int pvki, String pvv); @Override EncryptedPIN translatePINImpl(EncryptedPIN pinUnderKd1, SecureDESKey kd1,
            SecureDESKey kd2, byte destinationPINBlockFormat); @Override byte[] generateARPCImpl(MKDMethod mkdm, SKDMethod skdm, SecureDESKey imkac
            ,String accountNo, String accntSeqNo, byte[] arqc, byte[] atc, byte[] upn
            ,ARPCMethod arpcMethod, byte[] arc, byte[] propAuthData); @Override byte[] verifyARQCGenerateARPCImpl(MKDMethod mkdm, SKDMethod skdm, SecureDESKey imkac
            ,String accountNo, String accntSeqNo, byte[] arqc, byte[] atc, byte[] upn 
            ,byte[] transData, ARPCMethod arpcMethod, byte[] arc, byte[] propAuthData); @Override byte[] encryptDataImpl(CipherMode cipherMode, SecureDESKey kd
            ,byte[] data, byte[] iv); @Override byte[] decryptDataImpl(CipherMode cipherMode, SecureDESKey kd
            ,byte[] data, byte[] iv); String generateClearKeyComponent(short keyLength); @Override SecureDESKey translateKeySchemeImpl(SecureDESKey key, KeyScheme keyScheme); SecureDESKey formKEYfromThreeClearComponents(
            short keyLength,
            String keyType,
            String clearComponent1HexString,
            String clearComponent2HexString,
            String clearComponent3HexString); @Override SecureDESKey formKEYfromClearComponents(short keyLength, String keyType, String... components); @Override byte[] dataEncrypt(SecureDESKey bdk, byte[] clearText); @Override byte[] dataDecrypt(SecureDESKey bdk, byte[] cypherText); SecureDESKey importBDK(String clearComponent1HexString,
                                  String clearComponent2HexString,
                                  String clearComponent3HexString); EncryptedPIN exportPIN(EncryptedPIN pinUnderLmk, KeySerialNumber ksn, SecureDESKey bdk, boolean tdes,
             byte destinationPINBlockFormat);  }