首页 > 解决方案 > 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;
}

谁有这个错误的解决方案?

标签: javaspring-bootencryptionoauth-2.0private-key

解决方案


推荐阅读