Der encoding: in PublicKeyVisitor, restore the use of dynamic_pointer_cast.