There is no method for KMS encryption in Android AWS SDK. On the server side we use KMSEncryptionMaterialsProvider
to create AmazonS3EncryptionClient
object, but this class is not available in Android SDK. I tried using the Java SDK in my Android project but it threw an exception
Code:
KMSEncryptionMaterialsProvider materialProvider = new KMSEncryptionMaterialsProvider(kms_cmk_id);
encryptionClient = new AmazonS3EncryptionClient(new ProfileCredentialsProvider(), materialProvider,
new CryptoConfiguration())
.withRegion(Region.getRegion(Regions.US_WEST_2));
Exception
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.management.MBeanServerFactory" on path: DexPathList