The app I am implementing will contains highly sensitive user data and as such we want to encrypt the data before saving it, both locally and online (on Gcloud Firestore). I'd like to do this using Envelope Encryption.
Currently I have a Python back-end deployed on Gcloud Run which has the credentials to connect to GCloud KMS. It offers a REST API that I want to use to encrypt the Data Encryption Key (DEK) using a GCloud KMS key as Key Encryption Key (KEK). Currently it can only encrypt simple strings usI do this from a separate back-end instead of from the app itself because as far as I know, there's no safe way to store GCloud Credentials inside the app. The GCloud KMS Client Library does not support Android. Another SO answer touches upon this.
On the Android side I use Tink to create a Data Encryption Key, and I can encrypt my data with it. The last step, and what I can't fully figure out, is how I can send the AEAD Key to my backend. This is what I've already considered:
Tink technically already has support for directly working with GCloud, but that would require my app to have GCloud Credentials which isn't secure as mentioned above.
I could use a JSONKeyWriter to write a JSON version of the key to a String using a ByteArrayOutputStream, and send this String to be encrypted using my back-end, but for some reason I can't yet explain that doesn't feel right to me.
So I'm a bit stuck. Is the second option still the correct one? Maybe there is another third option I have not yet considered. I don't think I'm the first ever to implement this but I can't seem to find any information on working this way.