In order to use BouncyCastle crypto libraries you have to add cldc_classes.zip and/or cldc_crypto.zip to your project using Project settings | Libraries and Resources | Add jar. The zip files are part of lcrypto-j2me-(version).zip:

 lcrypto-j2me-(version)/zips/cldc_classes.zip
 lcrypto-j2me-(version)/zips/cldc_crypto.zip

Also make sure you have installed the latest updates of NetBeans Mobility Pack from the update center - Tools | Update Center.

Source: NetBeans User FAQ