This makes the behavior more consistent with key objects and will reject some corrupted pubkeys (e.g. zero length).