I am trying to create a keystore using JCE and till now I have created the X509Certificate and keystore but when I wanna run it I will face this error:
Exception in thread "main" java.io.IOException: exception decrypting data - java.security.InvalidKeyException: Illegal key size
at org.bouncycastle.jce.provider.JDKPKCS12KeyStore.cryptData(Unknown Source)
at org.bouncycastle.jce.provider.JDKPKCS12KeyStore.engineStore(Unknown Source)
and this is my code:
this is my function to create the keystore:
in this program I want to just store my self signed certificate + private key into the keysotre.
I will be thankful if any one tell me what the error and tell me how to remove it.