hanabi_noir
hanabi_noir

Reputation: 327

Play Integrity API Decryption Key: Bad base-64, with Base64.DEFAULT

I have checked about this answer: java.lang.IllegalArgumentException: bad base-64

However, the String format is definitely different in my project.

val key = "XX0XXxXXXXXxX/XXXXXX0XXX00X/0XX0xXXXX0Xxx0="
val bytes = Base64.decode(key, Base64.DEFAULT)

I referred to the official document: https://developer.android.com/google/play/integrity/verdict, in which the Verification Key is decoded properly with the same method.

Please let me know if the key might be incorrect for some reasons.

Thank you.

Upvotes: 0

Views: 373

Answers (1)

hanabi_noir
hanabi_noir

Reputation: 327

The phrase I used to create the public.key contains an "@", which is not a legal Base64.

This might not be the main reason which it failed to decode, but it was solved after removing the "@".

Upvotes: 1

Related Questions