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 π--aidaid β 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--inputoption. the result of the decryption operation gets written to the file specified by the--outputoption. if that option isn't given, the decrypted data is printed to standard output, showing non-printable characters using their hex notationxNN(peep--rawtoo).- *
--input*file,-ifile β specifies the input file to use. defaults tostdinif you don't specify it π - *
--key*id,-kid β selects the ID of the key to use. pick your fighter π - *
--output*file,-ofile β any output will be sent to the specified file. defaults tostdoutif you don't specify it. - *
--pin*pin,-ppin β when the cryptographic operation requires a PIN to access the key,pkcs15-cryptwill 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 theps(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 fromSTDINβ that's the move.
--pkcs1β by default,pkcs15-cryptassumes 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--pkcs1option, however,pkcs15-cryptwill 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,-rarg β 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 tellpkcs15-cryptthat 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--inputoption. by default, the contents of the file are assumed to be the result of an MD5 hash operation. note thatpkcs15-cryptexpects 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 topkcs15-cryptthe 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β causespkcs15-cryptto wait for a card insertion. she'll just... sit there. patiently. waiting for you π«Ά--verbose,-vβ causespkcs15-cryptto 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
- fedora 43: opensc 0.27.1-2.fc43 Β· LGPL-2.1-or-later AND BSD-3-Clause
- fedora 44: opensc 0.27.1-2.fc44 Β· LGPL-2.1-or-later AND BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms