'Extract the signature from the request.
This can be a get/post variable or for v4 also in a header called
\'Authorization\'.
- params[\'Signature\'] == version 0,1,2,3
- params[\'X-Amz-Signature\'] == version 4
- header \'Authorization\' == version 4'

def _get_signature(self, req):

    sig = (req.params.get('Signature') or req.params.get('X-Amz-Signature'))
    if ((sig is None) and ('Authorization' in req.headers)):
        auth_str = req.headers['Authorization']
        sig = auth_str.partition('Signature=')[2].split(',')[0]
    return sig
