Well, yes, generally you can.  It can be court ordered and requested by your spouse.  Otherwise, your boyfriend can request a filiation proceeding in Family Court to determine parentage and have a court order stating same.  That may be the way to go.  Good luck.