PKCS15-CRYPT(1)

πŸ’– PKCS15-CRYPT(1) πŸ’–

okay so bestie, welcome to the OpenSC Tools corner of the manual-verse, this is pkcs15-crypt and she is that girl ✨


✨ NAME ✨

pkcs15-crypt β€” perform crypto operations using PKCS#15 smart cards πŸͺͺπŸ’…


🌸 SYNOPSIS 🌸

pkcs15-crypt [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

So like, the pkcs15-crypt utility is a lil command-line bestie you can use to do cryptographic operations β€” think computing digital signatures, or decrypting data β€” using keys that live on a PKCS#15 compliant smart card. she's got main character energy and she's carrying your keys πŸ”₯


πŸ‘‘ OPTIONS πŸ‘‘

  • --version β€” print the OpenSC package release version. just vibes, just the number πŸŽ€
  • --aid aid β€” specify the AID of the on-card PKCS#15 application to bind to. the aid has to be in hexadecimal form, no cap.
  • --decipher, -c β€” decrypt the contents of the file specified by the --input option. the result of the decryption operation gets written to the file specified by the --output option. if that option isn't given, the decrypted data is printed to standard output, showing non-printable characters using their hex notation xNN (peep --raw too).
  • *--input *file, -i file β€” specifies the input file to use. defaults to stdin if you don't specify it πŸ’œ
  • *--key *id, -k id β€” selects the ID of the key to use. pick your fighter πŸ”‘
  • *--output *file, -o file β€” any output will be sent to the specified file. defaults to stdout if you don't specify it.
  • *--pin *pin, -p pin β€” when the cryptographic operation requires a PIN to access the key, pkcs15-crypt will prompt the user for the PIN on the terminal. using this option lets you specify the PIN on the command line instead.
🚨 bestie listen. on most operating systems, the command line of a process can be displayed by any user using the ps(1) command. so it is a security risk to specify secret information such as PINs on the command line. fr fr. if you specify '-' as PIN, it will be read from STDIN β€” that's the move.
  • --pkcs1 β€” by default, pkcs15-crypt assumes that input data has been padded to the correct length (i.e. when computing an RSA signature using a 1024 bit key, the input must be padded to 128 bytes to match the modulus length). when giving the --pkcs1 option, however, pkcs15-crypt will perform the required padding using the algorithm outlined in the PKCS #1 standard version 1.5. she'll do the padding for you, iconic behavior ✨
  • --raw, -R β€” outputs raw 8 bit data. no hex glow-up, just the raw bytes πŸ’€
  • *--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.
  • --md5 --sha-1 --sha-224 --sha-256 --sha-384 --sha-512 β€” these options tell pkcs15-crypt that the input file is the result of the specified hash operation. by default, an MD5 hash is expected. again, the data must be in binary representation. (not ASCII, bestie, binary πŸ™ˆ)
  • --sign, -s β€” perform digital signature operation on the data read from a file specified using the --input option. by default, the contents of the file are assumed to be the result of an MD5 hash operation. note that pkcs15-crypt expects the data in binary representation, not ASCII.

the digital signature is stored, in binary representation, in the file specified by the --output option. if this option is not given, the signature is printed on standard output, displaying non-printable characters using their hex notation xNN (see also --raw).

  • --signature-format, --f β€” when signing with an ECDSA key, this option indicates to pkcs15-crypt the signature output format. possible values are 'rs' (default) β€” two concatenated integers (PKCS#11), 'sequence' or 'openssl' β€” DER encoded sequence of two integers (OpenSSL).
  • --wait, -w β€” causes pkcs15-crypt to wait for a card insertion. she'll just... sit there. patiently. waiting for you 🫢
  • --verbose, -v β€” causes pkcs15-crypt to be more verbose. specify this flag several times to enable debug output in the OpenSC library. the more -vs, the more she yaps πŸ—£οΈ

πŸ’œ SEE ALSO πŸ’œ

go read those too, they're the rest of the friend group 🌈


🌟 AUTHORS 🌟

pkcs15-crypt was written by Juha YrjΓΆlΓ€ <juha.yrjola@iki.fi>. legend behavior, we stan πŸ‘‘


okay that's the whole page babes, and just so you know who's signing off: this is the opensc version, dated 04/19/2026, and yeah it's still PKCS15-CRYPT(1) because some things are eternal πŸ’–βœ¨ go decrypt something, you got this πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from