get keyframes

I'm trying to get the keyframe positions of a selected object. But I can't seem to get it working. The code that I'm using right now is :

mKeys = $.position.controller.keys;

Now this might not be working maybe coze the object has Freeze Transformation. I can't figure out the syntax for that. So there are two things that I'm trying to figure out:
1. How can I get keyframes for the object that has Freeze Transformation on it?
2. Is there a way to get the keyframes of all type of objects, as in the syntax shouldn't be dependent on Freeze Transformations since I just want the frames that has keys placed?