Add checking mismatch between Cipher instance algorithm and key type.
Modified files
main/com.licel.jcardsim.crypto.SymmetricCipherImpl.java
Add private method checkAlgorithmCompatibility(key). It is called in selectCipherEngine(key) and throw exception with 0x6F00 if cipher algorithm and key type are not compatible.
test/com/licel/jcardsim.crypto.SymmetrcCipherImplTest.java
Add test cases for testing cipher AES and key DES mismatched and testing cipher DES and key AES mismatched.
Fix issue #94
Add checking mismatch between Cipher instance algorithm and key type.
Modified files
main/com.licel.jcardsim.crypto.SymmetricCipherImpl.java Add private method checkAlgorithmCompatibility(key). It is called in selectCipherEngine(key) and throw exception with 0x6F00 if cipher algorithm and key type are not compatible.
test/com/licel/jcardsim.crypto.SymmetrcCipherImplTest.java Add test cases for testing cipher AES and key DES mismatched and testing cipher DES and key AES mismatched.