From 29a27dd6d77595e9f9f428813d31961d53f7570c Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 12 Apr 2018 23:50:19 +0200 Subject: [PATCH] pkcs11-tool: Add examples section to the manual page --- doc/tools/pkcs11-tool.1.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/tools/pkcs11-tool.1.xml b/doc/tools/pkcs11-tool.1.xml index 8db0e84a..6a1c5596 100644 --- a/doc/tools/pkcs11-tool.1.xml +++ b/doc/tools/pkcs11-tool.1.xml @@ -559,4 +559,26 @@ + + + Examples + + To list all certificates on the smart card: + pkcs11-tool --list-objects --type cert + + To read the certificate with ID KEY_ID + in DER format from smart card: + pkcs11-tool --read-object --id KEY_ID --type cert --outfile cert.der + + To convert the certificate in DER formato to PEM format, use OpenSSL + tools: + openssl x509 -inform DER -in cert.der -outform PEM > cert.pem + + To sign some data stored in file data + using the private key with ID ID and + using the RSA-PKCS mechanism: + pkcs11-tool --sign --id ID --mechanism RSA-PKCS --input-file data --output-file data.sig + + +