title: Verify RSA signature with public key in PEM format in Haskell
body: <p>If I have a payload, signature, and a public key (all in bytestring or similar format), how can I verify the signature?</p>
  
  <p>All of the <code>PublicKey</code> types I see on Hackage seem to represent keys purely via numbers, for instance: </p>
  
  <pre class="lang-hs prettyprint-override"><code>PublicKey    
  
  public_size :: Int  -- size of key in bytes
  
  public_n :: Integer -- public p*q
  
  public_e :: Integer -- public exponant e
  </code></pre>
  
  <p>How can I get a <code>PublicKey</code> from a PEM file, or simply perform verification directly from the PEM file?</p>
  
  <p>[EDIT from the feedback that no solution attempt was made] - I looked around for solutions, but haven't been able to find anything at all on hoogle that satisfies any type signature I'd expect, like <code>ByteString -&gt; PublicKey</code>. I don't want to reimplement this from scratch, as what I'm doing now is just calling out to a python script that performs all of the verification. It would be nice if I didn't need to call out to python though, but can't seem to find any existing code. </p>