If you don't have M2Crypto installed you can use the following openssl commands to generate the pin (on OS X OpenSSL 0.9.8y 5 Feb 2013):
openssl x509 -in certificate.cer -inform DER -outform DER -noout -pubkey | openssl rsa -pubin -outform DER | openssl sha1 -hex