The present invention discloses a nitrogen-doped carbon material encapsulated cobalt catalyst and a method of using the catalyst to prepare secondary amine compounds. The preparation method of the catalyst comprises the following steps: 1) silica sol is added into a 2-methylimidazole solution and dispersed uniformly to obtain liquid sol, a stirring is conducted while adding cobalt nitrate liquid into the liquid sol, a stirring reaction is conducted for 3-10 h, and after the reaction is completed, centrifuging, filtering, washing and drying are conducted to obtain ZIF-67@SiO<2> materials; 2) under nitrogen protection, the ZIF-67@SiO<2> materials are calcined at 400-1,200 DEG C for 6-10 h, the calcined materials are soaked with hydrofluoric acid solution, the soaked calcined materials are water washed to neutral, the washed calcined materials are dried to obtain CN@Co materials. The method of using the catalyst to prepare the secondary amine compounds is as follows: in an organic solvent, nitro-compounds, formic acids, carbonyl compounds and the CN@Co materials are added, nitrogen is ventilated to replace oxygen in the reaction system, and the reaction is conducted at 90-220 DEG C for 15-18 hours in an air isolation condition to obtain the secondary amine compounds. The catalyst can be used in the preparation of the secondary amine compounds, reduces the requirements and costs of the reaction to devices and is relatively high in reaction selectivity and yield.