Some more EC pubkey parsing refactoring

Fix a bug in pk_rsa() and pk_ec() along the way
5 files changed