byte[] key = Files.readAllBytes(Paths.get("public.key"));
因为是jar包,不能读取文件。故利用Spring的StreamUtils里的copyToByteArray方法读取
byte[] key = StreamUtils.copyToByteArray(new ClassPathResource("public.key").getInputStream());
byte[] key = Files.readAllBytes(Paths.get("public.key"));
因为是jar包,不能读取文件。故利用Spring的StreamUtils里的copyToByteArray方法读取
byte[] key = StreamUtils.copyToByteArray(new ClassPathResource("public.key").getInputStream());