Exemplo n.º 1
0
    def check_signature(self, oauth_request, consumer, token, signature):
        decoded_sig = base64.b64decode(signature)

        key, base_string = self.build_signature_base_string(
            oauth_request, consumer, token)

        # Fetch the public key cert based on the request
        cert = self._fetch_public_cert(oauth_request)

        # Pull the public key from the certificate
        publickey = keyfactory.parsePEMKey(cert, public=True)

        # Check the signature
        ok = publickey.hashAndVerify(decoded_sig, base_string)

        return ok
Exemplo n.º 2
0
  def check_signature(self, oauth_request, consumer, token, signature):
    decoded_sig = base64.b64decode(signature);

    key, base_string = self.build_signature_base_string(oauth_request,
                                                        consumer,
                                                        token)

    # Fetch the public key cert based on the request
    cert = self._fetch_public_cert(oauth_request)

    # Pull the public key from the certificate
    publickey = keyfactory.parsePEMKey(cert, public=True)

    # Check the signature
    ok = publickey.hashAndVerify(decoded_sig, base_string)

    return ok
Exemplo n.º 3
0
 def __init__(self, rsa_key, token_string=None, scopes=None):
   self.rsa_key = keyfactory.parsePEMKey(rsa_key)
   self.token_string = token_string or ''
   self.scopes = scopes or []