'Create a "thumbprint" of the current key repository.
Because key files are renamed, this produces a hash of the contents of
the key files, ignoring their filenames.
The resulting signature can be used, for example, to ensure that you
have a unique set of keys after you perform a key rotation (taking a
static set of keys, and simply shuffling them, would fail such a test).'

@property
def key_repository_signature(self):

    key_utils = fernet_utils.FernetUtils(CONF.fernet_tokens.key_repository, CONF.fernet_tokens.max_active_keys, 'fernet_tokens')
    keys = key_utils.load_keys()
    keys.sort()
    signature = hashlib.sha1()
    for key in keys:
        signature.update(key.encode('utf-8'))
    return signature.hexdigest()
