IllegalArgumentException:当前仅支持私钥数据

时间:2018-10-09 08:57:54

标签: java spring-boot encryption oauth-2.0 private-key

我通过这种方法收到此错误:

@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;
}

有人对此错误有解决方案吗?

0 个答案:

没有答案