Sample: skeleton

This sample FM is very simple and small and can be used as an empty skeleton to start your FM development.

Make a copy of this FM source and modify it for your own needs.

The other sample FMs are large and complex and are intended to illustrate the various programming techniques used in FM development. You can use them as a reference and copy and paste code fragments into your own FM but it is unlikely that you would want to start your own FM development by taking a copy of the pinenc or wrapcomp FMs.

The ‘e’ FM provides a simple message echo service. The message communication method selected is the random access style. It also opens a session on the Embedded cryptoki to illustrate embedded slot mapping.

skeleton has code samples for the following functionality:

>Registering a random access message handler

>Parsing request messages and performing integer endian conversions

>Constructing and returning a response message

The FM implements one custom command

There is no need to specify a command code as it is implicit.

Description

The skeleton test application is used to exercise the skeleton sample FM.

skeleton Test Application

 skeleton[-h] [-?] -s<slotnum> -t <text>
-s<slotnum> use slot slotnum - (default 1) e.g. -s3
-t<text> text to echo

e.g. skeleton -s6 -t “My message”

To access the slot number and determine if the HSM supports FMs:

1.Launch lunacm and execute the command slot list

slot list

2.Record the slot number for the device.

3.Exit lunacm.

4.For Luna PCIe HSM, use ctfm q command to list available FM-capable HSMs.
For Luna Network HSM, use hsm fm status command.