public static Optional < Key > buildRSAPublicKey ( final String keyType , final BigInteger modulus , final BigInteger exponent ) { try { return of ( KeyFactory . getInstance ( keyType ) . generatePublic ( new RSAPublicKeySpec ( modulus , exponent ) ) ) ; } catch ( final NoSuchAlgorithmException | InvalidKeySpecException ex ) { LOGGER . error ( "Error generating RSA Key from JWKS entry" , ex ) ; } return empty ( ) ; }
Build an RSA public key .