Java 中使用 Base64.decodeBase64() 方法解码私钥
在 Java 代码中使用 PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKey)); 这行代码时,Base64.decodeBase64 方法来自 Apache Commons Codec 库的 Base64 类。因此,需要引入该库的命名空间。
可以使用以下语句导入:
import org.apache.commons.codec.binary.Base64;
原文地址: https://www.cveoy.top/t/topic/nMEv 著作权归作者所有。请勿转载和采集!