Beer isn't typically fermented in the keg. It's in a huge vat and the keg is filled. Even homebrewed beer is not fermented in the keg. You ferment the beer, put it in the keg and pressurize it.
It is done but rare. You produce the wort, pitch in the keg, and seal when it hits the correct gravity to carbonate. Usually done with brews meant to be yeasty and usually low alcohol (poor storage). The Campaign for Real Ale advocates a primary ferment and then secondary ferment in the keg for a similar effect. But again, it's for quality and historical accuracy, not shelf life.
http://www.camra.org.uk/homeKegs aren't meant for storage. Kegs are meant to be an efficient way to dispense beer at bars where hundreds of bottles every hour would be a waste. The shelf life of kegs is poor, very poor if you don't have a CO2 system.
Beer is preserved two ways: hops and alcohol. The more of each the longer the shelf life. If you want to store beer, I would recommend buying a few cases of Sierra Nevada Winter Ale. Worst case you sore them and drink when you replace next year (this beer is actually better with a year's age).
Other beers I would (and have) aged:
Sierra Nevada Torpedo
Sierra Neevada Bigfoot
Summit Winter
Stone (almost any 7% or above IPA from Stone will work)
Burton Bridge Empire Pale Ale (improves much with age)
JW Lee's Harvest Ale (best beer I have found for aging)
Anchor Old Foghorn
Thomas Hardy's Ale
Hair of the Dog Adam's Beer
The pattern here is IPAs and barleywines. Other good agers are Russian Imperial Stouts, Trappists, soured beers, and (in general) the high gravity Belgian ales.