Set up a bowl with a fine-mesh sieve on top to strain and cool the pastry cream once cooked.
In another bowl, whisk together cornstarch and sugar. Add the eggs and whisk until smooth.
In a saucepan, heat the milk, salt, and vanilla extract over medium-high heat until just below boiling, stirring to prevent sticking.
Gradually add 1/3 of the hot milk to the egg mixture, whisking constantly to avoid cooking the eggs. Pour the egg-milk mixture back into the remaining hot milk. Whisk over medium heat until thickened, just to a boil.
Remove from heat and pour through the sieve into a bowl.
Add the dark chocolate and stir until melted. Then add the butter, one tablespoon at a time, stirring until smooth.
Let the pastry cream cool for 10 minutes, then pour into the prepared crust. Press plastic wrap directly onto the surface to prevent a skin from forming. Chill for at least 4 hours, ideally overnight.