rsa.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:gdata-python3 作者: dvska 项目源码 文件源码
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]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号