def in_app_purchase signature, receipt_data, base64_encoded_public_key
public_key = OpenSSL::PKey::RSA.new(base64_encoded_public_key)
if public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(signature), receipt_data)
# Success
else
# Failure
end
end