pkcs11-tools | manage objects on PKCS # 11 crypotographic tokens | TLS library
kandi X-RAY | pkcs11-tools Summary
kandi X-RAY | pkcs11-tools Summary
To build the source code, simply execute (with appropriate privileges). To list the methods available on a PKCS#11 token, use p11slotinfo, that will return the list of available mechanisms, together with allowed APIs. To list the objects sitting on the token at slot with index 0, use p11ls. objects are listed together with their attributes;.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pkcs11-tools
pkcs11-tools Key Features
pkcs11-tools Examples and Code Snippets
$ ./configure
$ make install
$ p11slotinfo -l /usr/local/opt/softhsm/lib/softhsm/libsofthsm2.so
PKCS#11 module slot list:
Slot index: 0
----------------
Description : SoftHSM slot ID 0x14a93125
Token Label : first token
Manufacturer: SoftHSM project
Community Discussions
Trending Discussions on pkcs11-tools
QUESTION
I am trying to extract the following from a PIV Smartcard:
- Subject Common Name
- Certificate Subject Alt Name / Microsoft Principal Name
I am using RedHat 6 (eventually 7) and CoolKey as my PKCS11 module.
I need a way to extract this information via code without requiring the smartcard pin, be it from shell commands or a smartcard library. Currently I can get the Common Name by using the shell command 'pkcs11-tools --module -T' so the Subject Alt Name is truly what I am after, but I would like to find a better way to get the Common Name if available.
I know this information is available without entering the pin as I can view it all in the included Smartcard Manager on RHEL (esc). I have a certificate chain of root, intermediate, and subordinate if that matters.
My thoughts are I have to extract the certificate from the card, verify that certificate with my local CAs, and then decrypt it. I have spent days reading documentation on APDUs, smartcards, and openssl and have gotten nowhere.
edit view of RHEL smart card manager:
This is what the smart card viewer shows when you open the card and view the details. The Microsoft Principal Name is what I'm looking to extract from the card, as well as the "common name" which is displayed in the Hierarchy portion as well as other spots, shown by the red text.
I actually have since switched to using pkcs15-tool, as pkcs11-tool cutoff longer common names (you can see this in the title bar of the screenshot, same issue). Output of: 'pkcs15-tool --list-info'
...ANSWER
Answered 2020-Sep-10 at 18:52I was able to get the common name and UPN/Certificate Alt Name by using Java bouncycastle and the iaik pkcs11 wrapper.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pkcs11-tools
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page