3

使用 Android 的Base64,可以做到这一点:Base64.decode(privateKeyString, Base64.DEFAULT). 如果您使用的是 Apache 的 Commons Codec,则此功能不可用。如何使用 Commons Codec 获得相同的结果?

4

2 回答 2

4

Apache Commons CodecBase64类的 Javadoc 可以在这里找到:http ://commons.apache.org/proper/commons-codec/archives/1.9/apidocs/org/apache/commons/codec/binary/Base64.html

对于您的情况,您需要使用Base64.decodeBase64(String base64String)方法

于 2014-01-20T04:58:15.010 回答
0

删除base64字符串head.for example,"data:image/png;base64,iVBORw0....",删除字符串"data:image/png;base64,".then.it运行良好。我做的

于 2018-08-29T08:21:09.390 回答