title: Comparing signed data and signature in Android Market responses using Ruby on Rails
body: <p>I'm wondering does anyone have links to any literature on how to approach this problem.</p>
  
  <p>I receive two sets of data from the Android Market; "Signed Data", a JSON representation of the purchase, and "Signature", a Base64 encoded, encrypted representation of the signed data.</p>
  
  <p>I think the point is to use the public key to encrypt the signed data and compare it to the signature?</p>
  
  <p>My strategy so far has been as follows:</p>
  
  <p>1) Base64 decode the public key and use OpenSSL::PKey::RSA.new to create a public key object</p>
  
  <p>2) Base64 decode the signature returned from Android</p>
  
  <p>3) Encrypt the signed data using the public key and compare with the signature</p>
  
  <p>What is the correct way to do this in Ruby?</p>