title: How to read a RSA public key in PEM + PKCS#1 format
body: <p>I have a RSA public key in PEM format + PKCS#1(I guess):</p>
  
  <pre><code>-----BEGIN RSA PUBLIC KEY-----
  MIGJAoGBAJNrHWRFgWLqgzSmLBq2G89exgi/Jk1NWhbFB9gHc9MLORmP3BOCJS9k
  onzT/+Dk1hdZf00JGgZeuJGoXK9PX3CIKQKRQRHpi5e1vmOCrmHN5VMOxGO4d+zn
  JDEbNHODZR4HzsSdpQ9SGMSx7raJJedEIbr0IP6DgnWgiA7R1mUdAgMBAAE=
  -----END RSA PUBLIC KEY-----
  </code></pre>
  
  <p>I want to get the SHA1 digest of its ASN1 encoded version in Python. The first step should be to read this key, but I failed to do it in PyCrypto:</p>
  
  <pre><code>&gt;&gt; from Crypto.PublicKey import RSA
  &gt;&gt; RSA.importKey(my_key)
  ValueError: RSA key format is not supported
  </code></pre>
  
  <p>The <a href="https://www.dlitz.net/software/pycrypto/api/current/Crypto.PublicKey.RSA-module.html">documentation of PyCrypto</a> says PEM + PKCS#1 is supported, so I'm confused.
  I've also tried M2Crypto, but it turns out that M2Crypto does not support PKCS#1 but only X.509.</p>