Spring Security supports supplying an RSA public key in its OAuth 2.0 APIs.
Local keys, though, are often distributed in files or as a PEM-encoded configuration property. It would be nice to have some support for converting an encoded RSA key into the appropriate JCA instance, e.g. RSAPublicKey.
One way to do this would be by using the Converter interface:
public class RSAPublicKeyConverter implements Converter<String, RSAPublicKey> {
public RSAPublicKey converter(String value) {
// ...
}
}
Which then users could use directly or could be registered with a ConversionService.
Spring Security supports supplying an RSA public key in its OAuth 2.0 APIs.
Local keys, though, are often distributed in files or as a PEM-encoded configuration property. It would be nice to have some support for converting an encoded RSA key into the appropriate JCA instance, e.g.
RSAPublicKey.One way to do this would be by using the
Converterinterface:Which then users could use directly or could be registered with a
ConversionService.