GSA/gsa-icam-card-builder

Name: gsa-icam-card-builder

Owner: U.S. General Services Administration

Description: ICAM Test Card Signer and Data Populator

Created: 2017-08-09 18:53:06.0

Updated: 2018-05-22 20:26:48.0

Pushed: 2018-05-22 20:36:46.0

Homepage:

Size: 38168

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

gsa-icam-card-builder

The GSA-ICAM-Card-Builder signs CHUID and CBEFF containers and updates Security Object containers for FIPS 201-2 PIV and PIV-I cards. This software was originally derived from the GSA PKCS7 signing tool. The original work was unable to:

  1. Updated X.509 certificates that conform to FIPS 201-2

  2. Create a detached CMS

  3. Create a content type of id-PIV-BiometricObject or id-PIV-CHUIDSecurityObject

  4. Create a Version 3 CMS

  5. Create a card container object

  6. Include pivFASC-N or entryUUID in the Signed Attributes section

  7. Include support for signing with a .p12 key file versus a PIV card

    In addition:

  8. the original CBEFFs on ICAM test cards are expired and need to be updated. Facial image CBEFF headers indicated the wrong Image Data Type (1 versus 0).

  9. Since we need to place these new objects on a card, there was no way to populate a card.

Currently, this project includes tools to handle all of the above except the card data populator.

Getting Started
JDK Releases Prior to 1.8.0_141

Due to a change in the bytecode verifier in Java 8, the bytecode verifier rejects the ContentSigningTool class. It has been fixed in JDK 1.8.0_141. Oracle since a lot of code broke. If using an earlier JDK, insert the “-noverify” option on the startup scripts mentioned below to get around the issue. The risk is that the bytecode isn't being verified.

Extracting the tools

To use the tools, unzip the ZIP file GSA-PIV-Signer-vX.x.x.zip containing the scripts, signing application, libraries, configuration files and artifacts.

In conjunction with the signing tool, we created the objects for eight new ICAM test cards, which are referred to as Gen 3:

|Card Number|Description| |:–:|:————————| | 25 | FIPS 201-2 Missing Discovery Object | | 26 | FIPS 201-2 Discovery Object Present, PIV Application PIN only | | 27 | FIPS 201-2 Discovery Object Present, PIV Application primary | | 28 | FIPS 202-2 Discovery Object Present, Global PIN primary | | 37 | Golden FIPS 201-2 PIV PPS F=512 D=64 | | 38 | Security Object Hash Mismatch | | 39 | Golden FIPS 201-2 Fed PIV-I | | 40 | Deprecated | | 41 | Re-keyed Card (same FASC-N different certs) | | 42 | Expired OCSP Response Signer Certificate | | 43 | Revoked OCSP Response Signer Certificate, pkix-ocsp-nocheck present | | 44 | Revoked OCSP Response Signer Certificate, no id-pkix-ocsp-nocheck present | | 44 | Invalid Signature in OCSP Response Signer Certificate | | 46 | Golden FIPS 201-2 PIV (replaced Card 1) | | 47 | Golden FIPS 201-2 PIV SAN Order | | 48 | Golden FIPS 201-2 T=1 PPS Non-zero PPS LEN Value | | 49 | FIPS 201-2 Facial Image CBEFF Expired | | 50 | FIPS 201-2 Facial Image CBEFF Expires before CHUID | | 51 | FIPS 201-2 Fingerprint CBEFF Expired | | 52 | FIPS 201-2 Fingerprint CBEFF Expires before CHUID | | 53 | FIPS 201-2 Large Card Auth Cert (2160 bytes) | | 54 | Golden FIPS 201-2 NFI PIV-I (Replaces Card 2) | | 55 | FIPS 201-2 PIV Missing Security Object |

The artifacts used to create these cards are included beneath the cards directory. The objects in each card's subdirectory can be encoded directly on to a PIV card. It may be necessary to precede the object files with a container- specific TLV as described in SP 800-73-4's data model. This system does not current supply a method for doing this if your card data populator doesn't handle if for you.

This project consists of two main processes:

  1. Create certificates to encode on ICAM Test cards
  2. Adjust and sign CHUID, CBEFF, and Security Object containers to comply with SP 800-73-4
Certificate Generation

The certutils directory contains a bash script, mkcert.sh that uses command line options to select an OpenSSL .cnf file that can request and sign private keys for any of the four certificates on a PIV or PIV-I card. A batch-mode utility,

But it's easier to use the makeall.sh script which invokes mkcert.sh to create the certificates for all of the Gen 3 ICAM Test cards in one shot.
Each certificate for each Gen 3 ICAM Test card is defined by its own OpenSSL .cnf file.

Content Signing

Next, it's time to create the CHUID and CBEFF objects, which also updates the Security Object as described below.

Usage

Change directory to the directory created by the GSA-PIV-Signer-vX.x.x ZIP file and run the following command:

java -classpath lib -jar GSA-ICAM-Card-Builder.jar gov.gsa.icamcardbuilder.app.Gui

The scripts start-signer.bat and start-signer.sh will do this for you.

Where the Files are Created

Generally, you should stage your CBEFF containers and Security Object files in a working directory. The application will write new files into the directory of the CBEFF and/or Security Object files respectively. It's most convenient if your contentFile and securityObjectFile are in the same working directory. The reference implementation does not use a working directory, writing directly to directories that can be used to create the cards. The reference implementation's content signer properties files contain paths to objects based on being run from the top level directory of the project.

Content Signer Property Files

To make it easy to test and run, the “File” menu includes a “Open Config” menu item that enables you to easily load a properties file that contains the following setup on a per-container basis. Below are some examples from the reference implementation.

Future releases will expand on the Discovery Object for supporting VCI and OCC.

Other properties files can be created and used to sign fingerprint or iris CBEFFs. The intent is to create property files for each biometric object on each ICAM card.

Re-sign your signed objects

Next, use the start-signer.sh or start-signer.bat script to start up the GSA PIV Signer tool. Use the File -> Open menu option to choose a properties file from the config directory. The contents of that file will be rendered in the text fields of the GUI. Next, click the Sign button.

Prior to writing a new container to disk, the existing file is appended with a time stamp and moved to a backup directory beneath the directory containing the file being re-signed. The newly-created file is then written to disk using its original name.

If you plan to update multiple biometrics on the same card, remember that the Security Object file is being updated as you sign each biometric. When it's time to write the containers to the card, be sure that you load all newly-signed biometric containers as well as the new security object at the same time. Otherwise, the containers on the card will get out of sync, and you'll encounter errors that the hashes on the security object don't match the container hashes.

Future Additions and Enhancements

Work remaining to be done if we want this to be really close to perfect:

  1. Add a data populator function
  2. Add a Verify button and the functionality behind it.
  3. Write a user guide.
  4. Create an installer.

See the list of issues for more information.

Source code

A source code ZIP file is provided. It includes all of the source as well as the artifacts needed to build, debug, and run this tool from with Eclipse. You can either clone the GitHub directory, you can download the appropriate “GSA-ICAM-Card-Builder-devel-vM.m.b” ZIP file and unzip it. Then use Eclipse to import the file into a new Java project.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.