using keyfile stored in attributes