例如: ``` public static PublicKey loadPublicFromFile(String filename) throws IOException, NoSuchProviderException, NoSuchAlgorithmException, InvalidKeySpecException { FileReader fr = new FileReader(filename); PemObject spki = new PemReader(fr).readPemObject(); fr.close(); Provider p = Security.getProvider(BouncyCastleProvider.PROVIDER_NAME); return KeyFactory.getInstance(Const.EC_VALUE, BouncyCastleProvider.PROVIDER_NAME).generatePublic(new X509EncodedKeySpec(spki.getContent())); } ``` Description Resource Path Location Type Resource leak: '<unassigned Closeable value>' is never closed SM2Util.java /java-gm/src/main/java/twgc/gm/sm2 line 241 Java Problem 2. SM2的密钥基于证书文件,没有提供基于hash to Byte 的转化方法,因此和JS(sm-crypto)的互操作比较困的
例如:
Description Resource Path Location Type Resource leak: '' is never closed SM2Util.java /java-gm/src/main/java/twgc/gm/sm2 line 241 Java Problem