I'm attempting to implement offline playback, using ExoPlayer 2 CacheDataSource with an AesCipherDataSource and an AesCipherDataSink. The content is stored offline in a service that runs in the background. Currently the only way I have found to provide a key is by generating it myself using SecureRandom and providing the bytes to the AesCipherDataSink constructor. In order to securely and dynamically generate secret keys for use in both the AesCipherDataSink during caching and the AesCipherDataSource during playback, I'd like to be able to use the AndroidKeystore. As designed, the AndroidKeystore will not provide the key material for use inside of the app. Can you implement a way for us to use a keystore along with keyalias and any protection parameters require to retrieve the key from the keystore and then use that during encryption and decryption?
I'm attempting to implement offline playback, using ExoPlayer 2 CacheDataSource with an AesCipherDataSource and an AesCipherDataSink. The content is stored offline in a service that runs in the background. Currently the only way I have found to provide a key is by generating it myself using SecureRandom and providing the bytes to the AesCipherDataSink constructor. In order to securely and dynamically generate secret keys for use in both the AesCipherDataSink during caching and the AesCipherDataSource during playback, I'd like to be able to use the AndroidKeystore. As designed, the AndroidKeystore will not provide the key material for use inside of the app. Can you implement a way for us to use a keystore along with keyalias and any protection parameters require to retrieve the key from the keystore and then use that during encryption and decryption?
I'm currently using ExoPlayer 2.7.3