If you have access to the opposite side of the nailer, you can also use Tee-nuts. The bolt goes through the angle iron, most of the way through the nailer, and screws into the tee-nut.
If you countersink the mounting location of the nut, it will be flush on the back side. Use whatever type of fastener you want. No extra bolt length sticking out.
If you don't have access to the opposite side from the angle iron, I like timber screws or good quality lag bolts. Pre-drill the wood first, however. I like to get either the larges diameter screw I can find, or just use a lot of coated deck screws.
Michael
Edit: this assumes the nailer is covered/buried later on... basically not accessible.
