Generate your first Face Certificate
Getting started with functional eID
Now that you are familiar with generating foundational eID SensePrints, it is time to learn how to allow verification of foundational eID holders using their face without having their face.
Prerequisites for Face Certificate Generation
To generate a Face Certificate, you must have:
SensePrint - You cannot generate a certificate for a particular pupose without having the foundational eID - i.e. the SensePrint
User's Face - Any key generation operation using a SensePrint is impossible without the user's face.
Purpose ID - A Face Certificate contains a public key derived from a user's face as pertaining to a specific purpose. As an example, the purpose ID could simply be a unique identifier associated to a particular verifier - i.e. the verifier's ID / web site etc.
eID attributes subset (optional) - A Face Certificate can also contain a subset of attributes from the foundational eID as requested by a particular verifier. When included, these are typically encrypted using a specified public key so that only an authorized verifier can read them. The attributes are included as a JSON string. If the SensePrint doesn't contain any of the requested attributes, they are ignored.
Public Key (optional) - When included, the requested attributes JSON string is encrypted using this key.
The server must be configured with a private key as detailed in the Configuration section.
Generating Secp256k1 Key Pairs (for eID attribute encryption) - optional
While most programming languages will provide libraries to generate key pairs, to get you started, you can use the the OpenSSL command line tool. To install OpenSSL:
Windows - FireDaemon provides binary installers for your convenience.
Linux - You can install OpenSSL on linux by using the following commands:
sudo apt update sudo apt install openssl
Within OpenSSL installed, from the command line, you can first generate a keypair:
The keypair is now stored in a file called secp256k1-key.pem
.
To print the Base64 encoded public key that the API will accept:
Later, during certificate verification, you will also need the private key. You can get this from the same file using:
Using the API end-point
As before, on the Swagger Docs page authorize using the API Key you setup earlier.
Expand the /generate-face-certificate
section and then click the Try it out
button as shown below:
As before, after clicking the Try it out
button, the following JSON text will become editable:
attribute_encryption_secp256k1_public_key_base64
specifies a base64 encoded public key on the Secp256k1 curve. When this key is specified, the server will encrypt the requested_attributes
JSON string with this key.
check_live_face_before_creation
will check if the face in face_base_64
is live (no spoofing detected) before creating a Face Certificate.
expiration_date_utc
is a UTC time stamp of when the Face Ceritificate will expire.
face_base_64
is an image of the eID holder's face represented as a Base64 string. Most programming libraries will provide a way to convert a file to Base64, but for a quick demonstration, you can use this page to convert an image to a Base64 string.
liveness_tolerance
is only used when check_live_face_before_creation
is set to true and determines the strictness of the liveness algorithm.
os
is also used only when check_live_face_before_creation
is set to true and finetunes the liveness check. It indicates the operating system the image was captured on. Valid values are ANDROID
/ IOS
/ DESKTOP
.
password
should be specified when the senseprint_base_64
was generated with a password.
purpose_id
specifies the purpose of the Face Certificate. It can also be simply a verifiers ID (UUID).
senseprint_base_64
is a base 64 encoded raw SensePrint from which a public key will be generated fo the specified purpose.
requested_attributes
when specified, will include the attributes in the Face Certificate. Only matched attribute names will be included. When a attribute_encryption_secp256k1_public_key_base64
is specified, the attributes JSON string will be encypted with the specified public key. If a key is not specified, then the attributes will be included as plain-text JSON.
user_subject_name
is the subject name of the use for whom the cerificate is being generated. If the certificate will be stored in a public registry, it is recommended that the subject name is pseudonymized or hashed.
verifiers_auth_key
should be specified when a SensePrint was generated with it specified during generation as well.
Understanding a certificate
If all goes well, you should see a response like the following:
This is the JSON representation of you certificate (with line breaks represented as \n
. You could use a language of your choice to save the string to a file. In this example, we use Python:
Now you will have a file called example.pem
which contains your certificate.
Certificate Structure
You can run an OpenSSL command to view the contents of your certificate:
Depending on whether you supplied a verifiers_auth_key
or not, the certificate will contain either an X.509v3 extension of 1.2.702.0.1012.1.1.0.0
(for plain text attributes) or 1.2.702.0.1012.1.1.1.0
(for encrypted attributes).
Below we show a certificate where the verifiers_auth_key
was not specified and eID attributes are unencrypted - correspondingly the 1.2.702.0.1012.1.1.0.0
extension is included in the certificate:
The meaning of 1.2.702.0.1012.1.1.0.0
(for plain text attributes) or 1.2.702.0.1012.1.1.1.0
(for encrypted attributes) can be seen at the following URLs:
1.2.702.0.1012.1.1.0.0
(unencrypted)- http://www.oid-info.com/cgi-bin/display?oid=1.2.702.0.1012.1.1.0.01.2.702.0.1012.1.1.1.0
(encrypted) - http://www.oid-info.com/cgi-bin/display?oid=1.2.702.0.1012.1.1.1.0
These are globally registered object IDs that are expanded below.
Unencrypted attributes as JSON object identifier:
{iso(1) member-body(2) sg(702) snraoid(0) seventh-sense(1012) sensecrypt(1) user-attributes(1) plain-text(0) json(0)}
Encrypted attributes as JSON object identifier:
{iso(1) member-body(2) sg(702) snraoid(0) seventh-sense(1012) sensecrypt(1) user-attributes(1) encrypted(1) json(0)}
Depending on whether eID attributes were requested, and whether an encryption key was specified, your certificate will contain either no extension, or one of 1.2.702.0.1012.1.1.0.0
(unencrypted), or 1.2.702.0.1012.1.1.1.0
(encrypted).
Last updated