[英]Kotlin Console Application: Base64.decode(iv, Base64.DEFAULT) gives Unresolved reference: decode
[英]Play Integrity API Decryption Key: Bad base-64, with Base64.DEFAULT
我檢查了這個答案: java.lang.IllegalArgumentException: bad base-64
但是,String 格式在我的項目中肯定是不同的。
val key = "XX0XXxXXXXXxX/XXXXXX0XXX00X/0XX0xXXXX0Xxx0="
val bytes = Base64.decode(key, Base64.DEFAULT)
我參考了官方文檔: https://developer.android.com/google/play/integrity/verdict ,其中Verification Key用同樣的方法正確解碼。
如果由於某些原因密鑰可能不正確,請告訴我。
謝謝你。
我用來創建 public.key 的短語包含一個“@”,這不是合法的 Base64。
這可能不是解碼失敗的主要原因,但去掉“@”后就解決了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.