def decode_receipt(receipt):
 with statsd.timer('services.decode'):
  if settings.SIGNING_SERVER_ACTIVE:
   verifier = certs.ReceiptVerifier(valid_issuers=settings.SIGNING_VALID_ISSUERS)
   try:
    result = verifier.verify(receipt)
   except ExpiredSignatureError:
    return jwt.decode(receipt.split('~')[1], verify=False)
   if (not result):
    raise VerificationError()
   return jwt.decode(receipt.split('~')[1], verify=False)
  else:
   key = jwt.rsa_load(settings.WEBAPPS_RECEIPT_KEY)
   raw = jwt.decode(receipt, key, algorithms=settings.SUPPORTED_JWT_ALGORITHMS)
 return raw

def decode_receipt ( receipt ) : with statsd . timer ( 'services.decode' ) : if settings . SIGNING_SERVER_ACTIVE : verifier = certs . ReceiptVerifier ( valid_issuers = settings . SIGNING_VALID_ISSUERS ) try : result = verifier . verify ( receipt ) except ExpiredSignatureError : return jwt . decode ( receipt . split ( '~' ) [ 1 ] , verify = False ) if ( not result ) : raise VerificationError ( ) return jwt . decode ( receipt . split ( '~' ) [ 1 ] , verify = False ) else : key = jwt . rsa_load ( settings . WEBAPPS_RECEIPT_KEY ) raw = jwt . decode ( receipt , key , algorithms = settings . SUPPORTED_JWT_ALGORITHMS ) return raw
cracks the receipt using the private key .