opensc-explorer 1 OpenSC OpenSC Tools opensc opensc-explorer generic interactive utility for accessing smart card and similar security token functions opensc-explorer OPTIONS Description The opensc-explorer utility can be used interactively to perform miscellaneous operations such as exploring the contents of or sending arbitrary APDU commands to a smart card or similar security token. Options The following are the command-line options for opensc-explorer. There are additional interactive commands available once it is running. driver, driver Use the given card driver. The default is auto-detected. path, path Select the file referenced by the given path on startup. The default is the path to the standard master file, 3F00. If path is empty (e.g. opensc-explorer --mf ""), then no file is explicitly selected. num, num Use the given reader number. The default is 0, the first reader in the system. , Causes opensc-explorer to be more verbose. Specify this flag several times to enable debug output in the opensc library. , Wait for a card to be inserted Commands The following commands are supported at the opensc-explorer interactive prompt. apdu hex-data Send a custom APDU command hex-data. asn1 file-id Parse and print the ASN.1 encoded content of the file specified by file-id. cat [file-id] cat sfi:short-id Print the contents of the currently selected EF or the contents of a file specified by file-id or the short file id short-id. cd file-id Change to another DF specified by file-id change CHVid [[old-pin] new-pin] Change a PIN, where id is the PIN reference Examples: Change PIN: change CHV2 00:00:00:00:00:00 "foobar" Set PIN: change CHV2 "foobar" Change PIN with pinpad: change CHV2 create file-id size Create a new EF. file-id specifies the id number and size is the size of the new file. debug [level] Set OpenSC debug level to level. If level is omitted the current debug level will be shown. delete file-id Remove the EF or DF specified by file-id do_get hex-tag [output] Copy the internal card's 'tagged' data into the local file. The local file is specified by output while the tag of the card's data is specified by hex-tag. If output is omitted, the name of the output file will be derived from hex-tag. do_put hex-tag input Update internal card's 'tagged' data. hex-tag is the tag of the card's data. input is the filename of the source file or the literal data presented as a sequence of hexadecimal values or " enclosed string. erase Erase the card, if the card supports it. get file-id [output] Copy an EF to a local file. The local file is specified by output while the card file is specified by file-id. If output is omitted, the name of the output file will be derived from the full card path to file-id. info [file-id] Display attributes of a file specified by file-id. If file-id is not supplied, the attributes of the current file are printed. ls List all files in the current DF find [start-id [end-id]] Find all files in the current DF. Files are found by selecting all file identifiers in the range from start-fid to end-fid (by default from 0000 to FFFF). mkdir file-id size Create a DF. file-id specifies the id number and size is the size of the new file. put file-id input Copy a local file to the card. The local file is specified by input while the card file is specified by file-id. quit Exit the program. random count Generate random sequence of count bytes. rm file-id Remove the EF or DF specified by file-id update_binary file-id offs data Binary update of the file specified by file-id with the literal data data starting from offset specified by offs. data can be supplied as a sequence of the hex values or as a " enclosed string. update_record file-id rec-nr rec-offs data Update record specified by rec-nr of the file specified by file-id with the literal data data starting from offset specified by rec-offs. data can be supplied as a sequence of the hex values or as a " enclosed string. verify key-type key-id [key] Present a PIN or key to the card. Where key-type can be one of CHV, KEY or PRO. key-id is a number representing the key or PIN reference. key is the key or PIN to be verified in hex. If key is omitted, PIN will be verified with PIN-Pad. Example: verify CHV0 31:32:33:34:00:00:00:00 pace secret-type [secret] Perform PACE with the card. secret-type can be one of pin, can, puk or mrz. secret is the secret to be verified as string. If secret is omitted, the secret will be verified with the PIN-Pad. Example: pace can 123456 See also opensc-tool 1