2021
01-12
01-12
java读取证书公钥的实现
方式1:使用javax.security.cert.X509Certificate进行解析URLurl=Demo.class.getClassLoader().getResource("C000024.crt");//证书路径System.out.println("公钥所在路径:"+url.getFile());X509Certificatecert=X509Certificate.getInstance(newFileInputStream(url.getFile()));PublicKeypublicKey=cert.getPublicKey();BASE64Encoderbase64Encoder=newBASE64Encoder();StringpublicKeyString=base64Encoder.enc...
继续阅读 >