Combine the sugar and cornstarch in a heavy bottom sauce pan. Whisk in the milk, and set over medium heat, whisking regularly, until the milk begins to steam.
Whisk the egg yolks in a large heat proof bowl. Once the milk is steaming, slowly pour the milk mixture into the egg yolks, whisking constantly. This must be done slowly, and you must be whisking constantly, or you will scramble your eggs with the hot milk mixture. Once all of the steaming milk has been whisked in, pour it all back into the sauce pan.
Continue to heat the mixture over medium heat, whisking constantly, until it comes to a boil. You can stop whisking for a few seconds at a time to see if bubbles are rising to the surface.
Once the mixture has come to a boil, it will thicken up and should coat the back of a spoon. If you dip a spoon in it, you should be able to draw a line through the custard without it filling in right away.
Place the peanut butter and vanilla in a heat proof mixing bowl. Place a mesh strainer over the top, and pour the custard mixture through the strainer. This will remove any lumps or bits of cooked egg that may have formed while the custard was cooking.
Stir the hot custard until the peanut butter is completely incorporated.
Place a sheet of plastic wrap directly on top of the pastry cream to prevent a skin from forming. Cool in the refrigerator for 3-4 hours, or overnight. If it seems too thick when you want to use it, simply run a whisk through it to loosen it up a little.
Peanut Butter Pastry Cream can be prepared up to 3 days in advance, and must be refrigerated.
