MongoDB Realm Encryption with Android Keystore System?

I’ve been trying to securely encrypt the data inside my local MongoDB Realm, but I’m having troubles, because I’m not sure how should I safely store the key inside the Android Keystore System, and pass that generated key as a bytearray to the MongoDB configuration?

As far as I know, we are not able to retrieve the bytearray of a generated key from the Android Keystore. So how are we supposed to safely and securely generate the encryption key and encrypt our local MongoDB Realm?

I’ve been searching for a solution for days, but haven’t been able to find any article/guide on this one.
I would appreciate any help! Thank you!