'Test signature validation with a v3 ec2 credential.'

def test_ec2_credential_signature_validate(self):

    (blob, ref) = unit.new_ec2_credential(user_id=self.user['id'], project_id=self.project_id)
    r = self.post('/credentials', body={'credential': ref})
    self.assertValidCredentialResponse(r, ref)
    access = blob['access'].encode('utf-8')
    self.assertEqual(hashlib.sha256(access).hexdigest(), r.result['credential']['id'])
    cred_blob = json.loads(r.result['credential']['blob'])
    self.assertEqual(blob, cred_blob)
    self._validate_signature(access=cred_blob['access'], secret=cred_blob['secret'])
