How long can you save egg yolks?

I am making a recipe that calls for egg whites. I often make key lime pie, which only uses the yolks. How long can I save the yolks for? Can I freeze them?

yes you can freeze them

You can cure them as well.

Two egg yolks and a tablespoon of water is a substitute for a whole egg. When I make white and chocolate cakes at work I do the white first, as the yolks aren’t used in them. Then I take the yolks and water and use them as part of the whole eggs required for the chocolate cakes.

I don’t typically keep eggs, so when I decide to bake something I have to go to the store, buy a dozen, and a month later throw 10 of them away. Is there some easy way for me to freeze them instead, and use a couple of those next time? Still in the shells, or do I break them into an ice tray first?