java - IllegalArgumentException:目前仅支持私钥数据
问题描述
我通过这种方法得到这个错误:
@Bean
public JwtAccessTokenConverter accessTokenConverter() {
JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
Resource resource = new ClassPathResource("publickey.txt");
String publicKey = null;
try {
publicKey = IOUtils.toString(resource.getInputStream());
} catch (final IOException e) {
throw new RuntimeException(e);
}
converter.setSigningKey(publicKey);
converter.setVerifierKey(publicKey);
return converter;
}
谁有这个错误的解决方案?
解决方案
推荐阅读
- python - 用redis或mongodb存储用户信息
- reactjs - React Native Navigation - '无法读取未定义的属性'调度''
- python-2.7 - venv 上没有名为 sip 的模块
- python - 如何从colab驱动器中的垃圾箱中删除文件
- linux - Mesa-18.1.6 'c 编译器无法创建可执行文件'
- .net - 验证提供商端时无法从 dotnet 核心中的 Pact Brocker 获取 PACT
- git - Git中的Azure DevOps在图中蓝色和灰色点是什么意思
- mysql - 无法在 EC2 实例上启动 mysql,我不断收到 apparmor 错误
- animation - 这里缺少 JavaFX 动画的哪些方面?
- javascript - 尝试对弹簧控制器的 jquery 发布请求