The process for taking a certificate or a public key and turning it into integers is a surprisingly tough task as first glance. There's a long chain of decoding and encoding to various format that this page will describe.
$ CERTIFICATE_PATH=/path/to/file.cer
$ OUTPUT_PUBLIC_KEY_PATH=public_key.pem
$ openssl x509 -pubkey -noout -in $CERTIFICATE_PATH > $OUTPUT_PUBLIC_KEY_PATH