This repository was archived by the owner on Mar 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
资源泄漏的问题比较多 #76
Copy link
Copy link
Open
Labels
questionFurther information is requestedFurther information is requested
Description
例如:
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: '' is never closed SM2Util.java /java-gm/src/main/java/twgc/gm/sm2 line 241 Java Problem
- SM2的密钥基于证书文件,没有提供基于hash to Byte 的转化方法,因此和JS(sm-crypto)的互操作比较困的
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested