The difficulty of parking a trailer near a locksmith's being what it is, you may prefer to deal with missing keys or an impossibly jammed lock at home. If you can't get in, it will be necessary to drill out the rivets. The only problem is that it is better not to enlarge the holes in the sheet metal. The choices are to use a drill (preferably) a little less than 1/8", or a slightly larger one and stop drilling the moment the head comes off. Then punch the remaining portion out. Of course, the smaller the bit, the more apt it is to break, especially the ones made in China. Hanson used to make alloy bits that were pretty tough, I don't know if they still do. 
Trailer door lock mechanism, photo 1

  It's fairly straightforward. There will be either a nut, (1) or a clip fastening the lock to the panel. Better to take the old one along. Especially if you want them all keyed the same, a locksmith's         is the best place to get them. In the case at right, the closest match had a cam, tab, whatever you want to call it, ("3" which rotates down to block the movement of "4") which was too long, and had to be ground shorter. Remember the old adage - "You can cut it shorter, but you can't cut it longer again". The black line leaves it a little too long, progressively smaller cuts size it exactly. 
Trailer door lock mechanism, photo 2

  A dial caliper can be had for $20 or so, not the quality for anything really technical, but useful for any number of things like this. This can reduce the time spent trial fitting, but even then, the final stages of fitting should be done in place.There is some play in the barrel, and as time passes everything will wear even looser, so a good, tight fit is desirable. Too tight might break the key. Too loose, and enough slack may develop to let the door work open on the road. This is another reason to do it yourself. Others are not usually too concerned with that kind of detail.
Measure trailer door locking tab

  right - Enlargement of "2". There will be at least two slightly different versions of the piece on the end in the bag of parts. These determine how far the key (and internal parts) can rotate. They also have a part in positioning the keyway, (5) vertical, horizontal, upside down, depending on where the one you choose is positioned on the rotating square protrusion. 
Trailer door lock mechanism, photo 3

  "5" is the opposite end of the same part shown above, right. "6" denotes one of the four slots that receive plastic inserts included in the package. Which of the slots inserts are placed in will determine the position(s) where the key can be removed. I want the doors locked any time the key is removed, so I use both inserts, at 180 degrees apart. This makes it impossible for the key to come out except in the locked position, provided they are positioned correctly. A little trial and error may be involved on that point. 
Trailer door lock mechanism, photo 4

  When tightening the nut that fastens the lock to the panel, be sure to hold the body of the lock with one wrench while tightening the nut with another. Otherwise the lock will rotate, and the flat sides of the body may round out the hole in the sheet metal.
Fasten door lock, photo 1

  It might be tempting to use this engaging tab as a template for the other(s), but there may be significant differences in fit between one door and another, so do that with suitable caution. Speaking of caution, it will certainly occur to you that a little grease inside the lock, on all contacting surfaces at right, and in the latch itself will make everything work much better. Women can be really unpleasant about that unless the excess is removed in detail.
Trailer door lock mechanism, photo 5

  Same thing as above, when tightening the screw that holds it all together. Some locks fit into places that cannot be accessed with a screwdriver, and a little bolt must be used instead.
Fasten door lock, photo 2