WESTCOS-TOOL(1)

πŸ’– WESTCOS-TOOL πŸ’–

okay bestie, welcome to westcos-tool from the OpenSC Tools fam β€” she's the little utility that lets you poke at data structures on westcos smart cards πŸŽ€


✨ NAME ✨

westcos-tool β€” a utility for manipulating data structures on westcos smart cards πŸ’…


🌸 SYNOPSIS 🌸

westcos-tool [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, the westcos-tool utility is here to manipulate the westcos data structures on 2 Ko smart cards / tokens ✨. You can create PINs, keys and certificates and store them right on the card / token. And for the operations that need it, user PIN authentication gets performed β€” no shortcuts, no sneaking 🫢


πŸ‘‘ OPTIONS πŸ‘‘

  • --change-pin, -n β€” changes a PIN stored on the card. You will need user authentication for this one, periodt πŸ”
  • --certificate file, -t file β€” writes the certificate file (in PEM format, obviously πŸ’…) to the card. User authentication is required for this operation.
  • --finalize, -f β€” finalizes the card. Once it's finalized, the default key is invalidated, so the PIN and PUK cannot be changed anymore without user authentication. no take-backsies fr fr
⚠️ Warning bestie: un-finalized cards are insecure because the PIN can be changed without user authentication β€” knowing the default key is literally enough 😭 please finalize your cards.
  • --generate-key, -g β€” generates a private key on the card. The card must not have been finalized, and a PIN must be installed (i.e. the file for the PIN must have been created β€” see option -i). By default the key length is 2048 bits. User authentication is required for this operation πŸ”₯
  • --help, -h β€” prints the help message on screen. your little safety net 🫢
  • --install-pin, -i β€” installs the PIN file on the card. You must provide a PIN value with -x β€” no PIN, no install, sorry bestie πŸ’€
  • --key-length length, -l length β€” changes the length of the private key. Use it with -g. match made in heaven πŸ’–
  • --overwrite-key, -o β€” overwrites the key if there's already a key sitting on the card. out with the old ✨
  • --pin-value pin, -x pin --puk-value puk, -y puk β€” these options let you specify the PIN/PUK values right on the command line. If the value is set to env:VARIABLE, then the value of the specified environment variable is used instead. By default, the code is prompted on the command line if it's needed.
😬 note that on most operating systems, any user can display the command line of any process on the system using utilities such as ps(1). So on an unsecured system, please prefer passing the codes via an environment variable. protect your codes, protect your peace πŸ™ˆ
  • --read-file filename, -j filename β€” reads the file filename from the card. The file gets written on disk with name filename. User authentication is required for this operation.
  • --reader arg, -r arg β€” number of the reader to use. By default, the first reader with a present card is used. If arg is an ATR, the reader with a matching card will be chosen πŸ‘‘
  • --unblock-pin, -u β€” unblocks a PIN stored on the card. Knowledge of the PIN Unblock Key (PUK) is required for this operation πŸ”“
  • --verbose -v β€” causes westcos-tool to be more verbose. Specify this flag several times to enable debug output in the OpenSC library. the way that more -v equals more lore πŸ’…
  • --wait, -w β€” waits for a card to be inserted. patiently, like a main character 🧚
  • --write-file filename, -k filename β€” puts the file with name filename from disk to the card. On the card, the file is written in filename. User authentication is required for this operation 🌈

πŸŽ€ AUTHORS πŸŽ€

westcos-tool was written by Francois Leblanc <francois.leblanc@cev-sa.com>. iconic behavior, honestly πŸ’œ


okay that's the whole page, bestie 🫢 this is opensc, dated 04/19/2026 β€” go forth and manage your westcos cards responsibly, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from