![Creating the Hardware Chooser](/images/new-backgrounds/49550/4955023x1.webp)
The Session Chooser
Creating the Hardware Chooser
A hardware chooser is a list of
If you wish, the hardware chooser can contain several HW_TABLE_ENTRYs, possibly supplied by different manufacturers, that all correspond to the same AM in the software chooser. If more than one hardware method can be matched to a single software method, then the hardware method listed first in the hardware chooser is associated with that software method. This association is normally created at link time. This offers applications the option to ensure a certain level of security by requiring specific hardware. However, the list can be modified at run time by creating the hardware chooser at run time, and specifying the order of the HW_TABLE_ENTRYs at that time.
If the hardware corresponding to the first method is not available, then
HW_TABLE_ENTRY *HARDWARE_CHOOSER[] = { &HW_INTEL_RANDOM, (HW_TABLE_ENTRY *)NULL_PTR
};
Creating the Session Chooser
Once you have declared the software and hardware choosers, you can call B_CreateSessionChooser to associate a hardware method (for example, HW_INTEL_RANDOM) with a software method (AM_HW_RANDOM) so that when a software method is called, it turns to the hardware. In this example, HW_INTEL_RANDOM will be called when AM_HW_RANDOM is referenced.
if ((status = B_CreateSessionChooser
(SOFTWARE_CHOOSER, &CHOOSER, (POINTER *)HARDWARE_CHOOSER, (ITEM *)NULL_PTR, NULL_PTR, &oemTagList)) != 0)
break;
The session chooser you have created should be passed in as the chooser when you
8 | R S A B S A F E C r y p t o - C I n t e l H a r d w a r e U s e r ’s G u i d e |