Use a whole ham with the bone left in. Bake it, then let it stand at room temperature for about 30 minutes to cool the outside. Prepare the Madère sauce and let it cook while the ham bakes.
Blend flour, salt, and butter as for pastry. Add 2 eggs and sufficient water to make a dough. Roll on a floured surface to a thickness of about ⅛ inch and large enough to encase the ham.
Trim fat from ham. Carve ham the French way. That is, put ham flat, as it was baked. Cut wedge at shank end and then cut slices off the top of the ham at an angle. Put slices back in place.
Cut a piece of foil to fit over slices. Hold the slices in place with the foil and turn ham top side down onto rolled pastry. Leave foil and bring sides of dough up around the ham. Let the shank bone stick out of dough. Trim the dough to fit. Mix yolk and 1tablespoon water. Coat all edges of dough to be sealed with egg-water mixture. Seal. Lift ham, turn it over, and place sealed edges down on a buttered cooky sheet.
Take some of the trimmed dough and with your hands make a rope of dough about 1 yard long and ¼ inch thick. (Make in 2 pieces and it will be easier to handle.) Arrange this on top of the crust to make a frame above where you believe the cut slices to be. Coat crust and rope with egg-water mixture.
Roll some of the trimmed dough pieces to ⅛-inch thickness. With a biscuit cutter, cut out 2-inch circles. Then, using the back of a French chopping knife or a butcher knife, rotate the knife from one position and make marks on the dough to look like a fan, or like a sea shell. Arrange these fans attractively over the dough within the rope frame. Coat with egg-water mixture.
Now make a knob with which to lift the dough lid: Roll dough trimmings to 1/16 inch thick. Cut four 3-inch circles of dough. Coat both sides heavily with flour. Stack these up, then lift them up and push your middle finger up through the middle of the stack, making a kind of balloon about ¾ inch across the top. Squeeze it tight around the bottom with your forefinger and thumb. Then, with a sharp, thin knife, cut a cross in the dough balloon, cutting through all 4 layers of dough, thus making a flower with 16 pie-shaped petals, big petals on the outside and smaller ones at the center. Cut off the dough at the base of the flower. Make a hole in the middle of the lid. Brush crust and base of knob with egg-water mixture and then insert the bottom of the flower knob in the crust. Push the bottom petals down on the dough and open petals. Touch the tips of the petals with egg-water mixture. Give the rest of the crust another coating of egg-water mixture. Bake in a preheated 400-degree oven for about 1 hour. Do not let it get too brown.
Take ham from oven. Put on serving plate. With a very sharp, thin, knife, cut out the dough at the inside edge of the rope at an angle so that the crust can be replaced and not fall through. Carefully lift out the dough lid, using a spatula: insert spatula under the dough lid and foil, and then use the foil to help lift the lid without breaking it.
Once lid is removed, discard foil. Spoon over Madeira sauce to glaze the ham. Replace lid. Lift off lid and serve the ham at the table. Remainder of sauce is served separately.