be less strict about issuer validation in metadata
refactor metadata.c