The legend associating Christmas candy canes with Jesus purports that the candy cane was first created as a symbol of Christ. The white is supposed to be symbolic of Christ's purity and immaculate conception, the red of his blood and promise of eternal life and the hardness of the candy itself as a symbol of firm and steadfast foundations in God. The shape of the candy is also purported by the legend to be symbolic, on the one hand resembling a J for Jesus, and on the other representing a shepherd's staff, intended to guide and help a lost flock.
The legend, which attributes the invention of the candy cane to an unnamed Indiana candymaker, is not supported by historical fact. Candy canes may have been created in Europe, according to Snopes, and no reliable evidence connects them with religion.
One of the few associations between the candy cane and religion is a Catholic priest's invention of the Keller Machine, which was used in the early 20th century to shape candy canes. However, there is no indication that the shape was religiously motivated in any way.
Nevertheless, the legend has gained traction within the church and secular media as an origin story behind the candy cane.