I would like to import into AndroidKeyStore a key. So, I can generate it by openssl in following way
openssl rsa -text -in privateKey2048.pem
openssl pkcs8 -topk8 -inform PEM -in ./privateKey2048.pem -outform DER -out private2048.der -nocrypt
then I can convert it from private2048.der into hex format, which can be converted in byteArray in android app. But it's not clear for me, How to import this byteArray into AndroidKeyStore?
So in general, my question is how import into KeyStore key which exist as a String or byteArray?
ps: I know that it is possible to generate a keyPair by keyPairGenerator.generateKeyPair(), but I would like to import my key, for example generated by openssl and then hard-coded in application.