google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.66k stars 6k forks source link

Add support for AndroidKeystore Symmetric Keys with AESCipherDataSource and AESCipherDataSink #4193

Open CodyDunlap opened 6 years ago

CodyDunlap commented 6 years ago

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

AquilesCanta commented 6 years ago

@erdemguven, would you mind taking a look at this?

erdemguven commented 6 years ago

I'll look into this.

shubhamvashisht commented 1 year ago

Any hope for this to be considered?