PIV Card and CAC Data
PIV cards are U.S. Government issued cards. SmartCardAPI comes with C# sample to read PIV card credentials in a .NET, Visual Studio software development environment.
No need to read through NIST specifications. Figuring out details about the PIV card edge, accessing CHUID data and certificates can easily take several engineering days. With SmartCardAPI this can be done in minutes.
If you just need quick access to expiration date, CHUID and FASCN you can get your project up and running with a few lines of C# or VB.NET managed code.
X509 certificate from a PIV card can be read, parsed and used for authentication, signing etc.
CAC Card Data
Write your own software to read DoD Common Access Card (CAC), NIST PIV and TSA TWIC cards
Or verify a card holder PIN to access PIN-protected PIV containers such es the PIV printed information.
Thanks to CardWerk SmartCard API (Professional) edition, reading the Card Holder Unique Identifier (CHUID), PIN validation via SPE and printed information or facial image data access is quite easy. A GetData() method gives you access to printed information, card capabilities, on-card X509 certificates and many more data containers.
All you need is SmartCard-API (Professional) and a few lines of code to read the CHUID. SmartCard API provides you with easy-to-use methods to extract data items such as GUID, FASCN or expiration date from raw BER encoded CHUID data.
A few lines more and you have access to the PIV card’s printed information according to NIST SP 800-73-3. You’ll have direct access to Name, Employee Affiliation, Expiration Date, Agency Card Serial Number and Issuer Identification data elements without having to dive into TLV encoded data containers. You’ll have easy access to those methods via CardModule.PIV – a card module implemented on top of SmartCardAPI.
The sample code can also be used to access the Commercial Identity Verification (CIV) Credential. This card is technically the same as a PIV-I card. The only difference is that it does not require the use of Federal identity vetting, issuance and activation policies required to issue a PIV-I credential for Federal agencies and contractors.
Our C# sample code for Visual Studio demonstrates how to select the CAC /PIV access control applet to verify a PIN required to read CAC Personal Instance data via easy-to-use methods residing in CardModule.CAC and CardModule.PIV. The sample works with any PC/SC compliant smartcard reader including all government approved SCR devices.
We have prepared sample code to demonstrate this. It is work in progress. By no means a complete PIV or CAC implementation. That’s what third-party middleware is for. However we think that this code can be very helpful to get some basic info off a US Government issued chip card. Therefore we wrapped it in HelloWorld-style sample code that is available as part of the SmartCardAPI SDK. Please also look for “pre-release” download making ” C# HelloPIV pre-release” sample code available whenever we have additional code available that is not yet part of the smartcard API SDK.
Key Features of HelloPIVCard Sample Code
- includes winscard C# wrapper class (managed access to Windows API functions such as SCardEstablishConext(), SCardConnect() , SCardTransmit() … )
- you don’t have to know anything about Windows API’s unmanaged WinAPI functions
- Reads Global Platform card production lifecycle data
- Reads CUID, displays PIV FIPS 201 compliant card
- Extracts and displays Expiration Date, GUID and FASCN
- Reads/displays Card capability container
- Reads/displays X509 certificates
- PIN VERIFY via standard or SPE enabled readers
- Easy access to printed Information data elemets
- Detects DoD CAC, Transitional CAC/PIV, TWIC cards
- DoD CAC: reads Personal Instance data (requires valid PIN)
- Card tracking: detects card insertion/removal
- Reader tracking: detects reader connection/removal
- Supports contact ISO7816 and contactless ISO14443A/B cards
- C# smartcard sample code, supports all .NET programming languages including Visual Basic.NET (VB.NET),Visual C#, Visual J#, and Managed C++.
- Microsoft Visual Studio 2013
- SmartCard-API (Professional) 188.8.131.522
- .NET Framework 4.0 or later
Buying a software license of the CardWerk SmartCard API (Professional) edition entitles you to redistribute the binary CardWerk SmartCard API (Professional) assembly to your customers at an incredible ROI.