Support another key type

Signed-off-by: Michal Čihař <michal@cihar.com>
Share logic for checking key line validity

Signed-off-by: Michal Čihař <michal@cihar.com>