Esempio n. 1
0
def build_rsa_signature(self, http_request, oauth_params, cert):
    base_string = build_signature_base_string(http_request, oauth_params)
    # Pull the private key from the certificate
    privatekey = keyfactory.parsePrivateKey(cert)
    # Sign using the key
    signed = privatekey.hashAndSign(base_string)
    return binascii.b2a_base64(signed)[:-1]
Esempio n. 2
0
def build_rsa_signature(self, http_request, oauth_params, cert):
  base_string = build_signature_base_string(http_request, oauth_params)
  # Pull the private key from the certificate
  privatekey = keyfactory.parsePrivateKey(cert)
  # Sign using the key
  signed = privatekey.hashAndSign(base_string)
  return binascii.b2a_base64(signed)[:-1]
Esempio n. 3
0
    def build_signature(self, oauth_request, consumer, token):
        key, base_string = self.build_signature_base_string(oauth_request, consumer, token)

        # Fetch the private key cert based on the request
        cert = self._fetch_private_cert(oauth_request)

        # Pull the private key from the certificate
        privatekey = keyfactory.parsePrivateKey(cert)

        # Convert base_string to bytes
        # base_string_bytes = cryptomath.createByteArraySequence(base_string)

        # Sign using the key
        signed = privatekey.hashAndSign(base_string)

        return binascii.b2a_base64(signed)[:-1]
Esempio n. 4
0
    def build_signature(self, oauth_request, consumer, token):
        key, base_string = self.build_signature_base_string(
            oauth_request, consumer, token)

        # Fetch the private key cert based on the request
        cert = self._fetch_private_cert(oauth_request)

        # Pull the private key from the certificate
        privatekey = keyfactory.parsePrivateKey(cert)

        # Convert base_string to bytes
        #base_string_bytes = cryptomath.createByteArraySequence(base_string)

        # Sign using the key
        signed = privatekey.hashAndSign(base_string)

        return binascii.b2a_base64(signed)[:-1]