MCPcopy Create free account
hub / github.com/aws/aws-cli / RSASigner

Class RSASigner

awscli/customizations/cloudfront.py:303–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301
302
303class RSASigner:
304 def __init__(self, private_key):
305 key_bytes = private_key.encode('utf8')
306 self.priv_key = RSA.new_private_key_from_pem_data(key_bytes)
307
308 def sign(self, message):
309 return self.priv_key.sign(
310 RSASignatureAlgorithm.PKCS1_5_SHA1,
311 hashlib.sha1(message).digest()
312 )

Callers 1

_run_mainMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected