Skip to content

Command Line Interface

Martin Paljak edited this page Jun 14, 2018 · 1 revision

Running

  • Download latest build from Jenkins
  • java -jar fdsm.jar
    • Handy alias for shell users: alias fidesmo="java -jar $PWD/fdsm.jar"
  • the command line interface is not unlike that of GlobalPlatformPro for the following
    • --install with --applet --create and --params
      • just remember to use or add --upload
    • --uninstall
    • --store-data

Specifying appId and appKey

  • $FIDESMO_APP_ID and/or $FIDESMO_APP_KEY can be set in the environment
    • reduce necessary arguments when working on a project via ~/.profile or use with OnDir
  • command line --app-id and --app-key overrides environment

Delivering services

fidesmo -deliver [<appId>/]<serviceId> [--app-id <appId>]

  • The application from what a service is delivered, is selected via this order:
    1. $FIDESMO_APP_ID
    2. argument of --app-id
    3. argument of --deliver (e.g. fidesmo --deliver d7d13e65/get for Samtrafiken POC)

Uploading applets

fidesmo -upload <applet.cap>

  • See #1 and #2
  • Metadata of the applet (JavaCard version, GlobalPlatform version, targeted platform) is figured out automagically from CAP content
    • This also means that recipe verification will fail until fixed (GlobalPlatform version handling / capabilities / export file checking)

Automatic recipe generation

To support installation and deletion from the command line, this utility mimics gradle-fidesmo by creating temporary recipes. It should clean up after itself, but if it fails, --cleanup can be used to automatically remove all recipes that match UUID pattern.

Installing applets

fidesmo -install <applet.cap> [-create <AID>] [-params <HEX>]

  • If a CAP file contains more than one applet, specify it with --applet
  • To specify the instance AID to be different from applet AID, specify it with --create
  • Installation parameters for the applet can be specified with --params
  • To upload the applet CAP before installation, specify --upload

Uninstalling applets

fidesmo -uninstall <applet.cap>

  • CAP and all related applets are removed from the card

Personalizing applets securely

fidesmo -applet <AID> -store-data <HEX>

  • --store-data (more precisely, /ccm/storedata implementation) expects a DGI-encoded payload
  • multiple --store-data parameters can be specified

Options

$ fidesmo
# fdsm v18.06.15-1-g9e99586
Option                        Description                   
------                        -----------                   
-?, -h, --help                Shows this help               
--app-id <String: HEX>        Specify application ID        
--app-key <String: HEX>       Specify application key       
--applet <String: AID>        Specify applet                
--cleanup                     Clean up stale recipes        
--create <String: AID>        Applet instance AID           
--deliver <String>            Deliver service               
--flush-applets               Flush all applets from Fidesmo
--install <File: CAP file>    Install CAP to card           
--list-applets                List applets at Fidesmo       
--list-recipes                List recipes at Fidesmo       
--params <String: HEX>        Installation paremeters       
--store-data <String: HEX>    STORE DATA to applet          
--trace-apdu                  Trace APDU-s                  
--trace-rpc                   Trace Fidesmo API             
--uninstall <File: CAP file>  Uninstall CAP from card       
--upload [File: CAP file]     Upload CAP to Fidesmo