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

299 Views Asked by At

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.

1

There are 1 best solutions below

1
On

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 "@".