Пример #1
0
def check_signature(self, http_request, oauth_params, cert, signature):
  decoded_sig = base64.b64decode(signature);
  base_string = build_signature_base_string(http_request, oauth_params)
  # Pull the public key from the certificate
  publickey = keyfactory.parsePEMKey(cert, public=True)
  # Check the signature
  return publickey.hashAndVerify(decoded_sig, base_string)
Пример #2
0
def check_signature(self, http_request, oauth_params, cert, signature):
    decoded_sig = base64.b64decode(signature)
    base_string = build_signature_base_string(http_request, oauth_params)
    # Pull the public key from the certificate
    publickey = keyfactory.parsePEMKey(cert, public=True)
    # Check the signature
    return publickey.hashAndVerify(decoded_sig, base_string)
Пример #3
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
Пример #4
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
Пример #5
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 []
Пример #6
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 []