beatty / applepay_crypto_demo

109 stars 18 forks source link

Security exception error while trying to decrypt. #8

Open AppleDecryptorRJ opened 9 years ago

AppleDecryptorRJ commented 9 years ago

Hello,

I've been trying to decrypt the apple pay token with beatty/applepay_crypto_demo program.

I loaded the message.json file, the .p12 file and the .cer files in the appropriate parts of the code, but I got an exception message as in,

Exception in thread "main" java.io.IOException: error constructing MAC: java.lang.SecurityException: JCE cannot authenticate the provider BC at org.bouncycastle.jce.provider.JDKPKCS12KeyStore.engineLoad(JDKPKCS12KeyStore.java:716) at java.security.KeyStore.load(Unknown Source) at Main.loadPrivateKey(Main.java:178) at Main.main(Main.java:116)

when I tried and followed some online helper forums, now its throwing another exception,

Exception in thread "main" java.io.IOException: exception unwrapping private key - java.security.InvalidKeyException: Illegal key size at org.bouncycastle.jce.provider.JDKPKCS12KeyStore.unwrapKey(Unknown Source) at org.bouncycastle.jce.provider.JDKPKCS12KeyStore.engineLoad(Unknown Source) at java.security.KeyStore.load(Unknown Source) at Main.loadPrivateKey(Main.java:158) at Main.main(Main.java:110)

I'm really led out of this place here. Its really important to get this thing working. Am I doing something wrong here?? can someone help me out of this situation please. Its really important, any thoughts would be appreciated. Thanks in advance.

xslim commented 9 years ago

You need to install 256 key security.

follow this link http://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters

AppleDecryptorRJ commented 9 years ago

Thank you, I got that working already!