Methods and systems for flexibly loading an application, e.g., a software
application, and associated data from an application provider (101) onto
a tamper resistant module (TRM) (103) having an I/O buffer (115) and a
memory (119). A method embodiment of the invention comprises determining
(501) the size of the TRM's I/O buffer (115), segmenting (503) the
application to be loaded and its associated data into a plurality of
segments, with each segment adapted to be stored in the I/O buffer (115)
and the size of each segment being a function of the determined size of
the I/O buffer (115), separately transmitting (505) each segment to the
tamper resistant module (103), and storing (603) each separately
transmitted segment in a selected one of one or more available spaces of
the TRM's memory (119), said spaces selected depending upon the size of
each segment and upon which of said available spaces has the smallest
available area in the TRM's memory (119) in which the segment can be
stored.