Used phpseclib to read key created using openssl. Used jsencrypt on the client side to extract n and e from pem encoded public key.