def _sign(self, data):
<EOL>params = "<STR_LIT:&>".join(<EOL>"<STR_LIT:=>".join((key, cs_encode(value)))<EOL>for key, value in sorted(data.items())<EOL>)<EOL>digest = hmac.new(<EOL>self.secret.encode('<STR_LIT:utf-8>'),<EOL>msg=params.lower().encode('<STR_LIT:utf-8>'),<EOL>digestmod=hashlib.sha1).digest()<EOL>return base64.b64encode(digest).decode('<STR_LIT:utf-8>').strip()<EOL>
Compute a signature string according to the CloudStack
signature method (hmac/sha1).