I have a JCEKS file that contains a secret entry. I'm supposed to use this secret entry from the key store and use that to perform an AES encryption using Python.
I was able to load the KeyStore file in Python using the pyjks library in Python.
I'm able to view my secret entries by trying the following -
import jks
key_store = jks.KeyStore.load("path/to/keystore", "keystorepass")
key_store.entries
which return the following value
{
'mysecretentry': <jks.jks.SecretKeyEntry at 0x7fd676e65130>
}
But I'm not sure how to access this key so that I can use this as my key in AES encryption
from Crypto.Cipher import AES
cipher = AES.new(mysecretentry, AES.MODE_CBC, iv)