Click Digital Signature from the Tools -> Macro menu.

Click Add open the Select Certificate window.

Click on your PFX file, then OK to sign.

Click OK and your OpenOffice macro is now digitally signed!