(request, secret, alg='sha256')
| 1481 | |
| 1482 | @staticmethod |
| 1483 | def rsa(request, secret, alg='sha256'): |
| 1484 | algorithms = { |
| 1485 | "sha256": hashes.SHA256(), |
| 1486 | "sha384": hashes.SHA384(), |
| 1487 | "sha512": hashes.SHA512(), |
| 1488 | } |
| 1489 | algorithm = algorithms[alg] |
| 1490 | priv_key = load_pem_private_key(Exchange.encode(secret), None, backends.default_backend()) |
| 1491 | return Exchange.binary_to_base64(priv_key.sign(Exchange.encode(request), padding.PKCS1v15(), algorithm)) |
| 1492 | |
| 1493 | @staticmethod |
| 1494 | def eth_abi_encode(types, args): |