Click the shape tool. Set the stroke to 2 pixels for a one pixel border -if you only do one pixel it's soft and grey.
Make the shape white.
Then click the layers window. This will make a shape the size of the document.
Set the "mode" to multiply.
This gives you an exact, perfect border.