When passing an InputStream that begins -----BEGIN PUBLIC KEY-----, RsaKeyConverters.x509 will convert this into a public key.

It might be nice to be able to do the same with certificates in the same method. For example, if it begins -----BEGIN CERTIFICATE-----, then the method could alternatively do:

X509Certificate certificate = (X509Certificate) certificateFactory.generateCertificate(source);
return (RSAPublicKey) certificate.getPublicKey();