keyring: detach keyring parsing/serialization

for later usage in exports/imports