AWS encryption with Android Studio

0

In trying to implement "encrypting and decrypting strings" under Android Studio, I find that the call to:

KmsMasterKeyProvider keyProvider = KmsMasterKeyProvider.builder().buildStrict(keyArn);

crashes without an exception being thrown. The String keyArn is: "arn:aws:kms:us-west-2:834308876806:key/ce951986-5be9-4255-b60f-xxxxxxxxxxxx" and the library jar was obtained from: https://mvnrepository.com/artifact/com.amazonaws/aws-encryption-sdk-java/2.4.0

Any suggestions would be most welcome! Thanks in advance. Bob

Update: added "aws-java-sdk-kms-1.12.338" from: https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-kms/1.12.338

using: "import com.amazonaws.encryptionsdk.kmssdkv2.KmsMasterKeyProvider;"

Now has keyProvider but crashes on:

final CryptoResult<byte[], KmsMasterKey> encryptResult = crypto.encryptData(keyProvider, EXAMPLE_DATA, encryptionContext);

Still no exception thrown.

Aucune réponse

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions