'Attempt to decrypt a credential.
:param credential: an encrypted credential string
:returns: a decrypted credential'

def decrypt(self, credential):

    key_utils = fernet_utils.FernetUtils(CONF.credential.key_repository, MAX_ACTIVE_KEYS)
    keys = key_utils.load_keys(use_null_key=True)
    fernet_keys = [fernet.Fernet(key) for key in keys]
    crypto = fernet.MultiFernet(fernet_keys)
    try:
        if isinstance(credential, six.text_type):
            credential = credential.encode('utf-8')
        return crypto.decrypt(credential).decode('utf-8')
    except (fernet.InvalidToken, TypeError, ValueError):
        msg = _('Credential    could    not    be    decrypted.    Please    contact    the    administrator')
        LOG.error(msg)
        raise exception.CredentialEncryptionError(msg)
