I\'m currently working on an key-handling class in Java, specifically using a KeyStore. I\'m trying to generate a SecretKey with an AES instance, then place it inside of the
I found this as a non-accepted answer on stackoverflow:
The "Cannot store non-PrivateKeys" error message usually indicates you are trying to use secret symmetric keys with a JKS keystore type. The JKS keystore type only supports asymmetric (public/private) keys. You would have to create a new keystore of type JCEKS to support secret keys.
It is very hard to confirm this, although my memory tells me it is correct.