In this paper, we address the issue of optimal transmitter design to achieve physical layer security for a multiple-input single-output (MISO) cognitive radio network (CRN), in which a secondary user transmitter (SU-Tx) sends confidential information to a SU receiver (SU-Rx) on the same frequency band with a primary user (PU) in the presence of an eavesdropper receiver (ED-Rx). It is assumed that all the channel state information (CSI) of the secondary, primary and eavesdropper channels is not perfectly known at the SU-Tx. The optimal transmitter design, under the restriction of Gaussian signaling without preprocessing of information, involves a nonconvex semiinfinite optimization problem which maximizes the rate of the secondary link while avoiding harmful interference to the PU and keeping the eavesdropper totally ignorant of the messages sent regardless of the uncertainties in the CSI. We propose two approaches to solve this challenging optimization problem. The first one relates the original problem to a sequence of semiinfinite capacity-achieving transmitter design problems in an auxiliary CRN without any eavesdropper, which can then be solved through transformations and using convex semidefinite programs (SDPs). The second approach explores the hidden convexity of the problem and hence transforms it into a single SDP, which significantly reduces the computational complexity. Furthermore, a few heuristic beamforming solutions for the ease of implementation are also introduced. Finally, simulation results are presented to evaluate the performance of the proposed optimal and suboptimal solutions.