Affected Version: Suprema G-SDK 1.6.0 or above

Supported Devices: FaceStation F2 or BioStation 3

Overview

Are you using Suprema G-SDK and want to issue a smart card including a visual face?
Suprema G-SDK version 1.6.0 now supports issuing visual face Access On Card. (Suprema G-SDK Release Note: V1.6.0)

Users who do not want to save the biometric information to a database or the device can use Access On Card(AOC) or Secure Credential Card(SCC). If you don't know about AOC and SCC, please refer to the article below.

[BioStar 2] Issuing Smart Card / Access On Card & Secure Credential Card


Note the visual face is only supported by FaceStation F2 and BioStation 3.

Instructions to issue Visual Face On Card

To issue a Visual Face On Card, please follow the below steps.


Step 1: Set the smart card layout and the type of the card you are using

To issue a smart card, please set the smart card format first.
There are four types of cards supported for the AoC card and the SC card, MIFARE, iCLASS, DESFire, and iClass Seos.
Check the card configuration and set it to the device using SetConfig.
(Link: Card API -> Config -> SetConfig)

To make the device read and write the smart cards, you will have to set the device to allow the smart card type.
The useCardOperationMask allows the device to read a particular card type. Set the Mask according to the card type you are using.
(Link : System API -> Config -> useCardOperationMask)

Step 2: Format the card

  • The card needs to be formatted before being used as a smart card. The card information stored in the blocks will be deleted. Use the Erase function in the Card API.
    (Link : Card API -> Read/Write -> Erase)


Step 3: Normalize and Extract from the image


Step 4: Prepare the data you need to issue a smart card

  • AOC and SCC require different data.
    Please refer to the structure of the smartCardData and set the information according to the smart card type.
    (Link: Card API -> Card data -> smartCardData)

    Secure Credential Card
    Access On Card
    On Card
    - User ID
    - PIN, Biometric
    - Card ID(User can type manually)
    - User ID
    - PIN, Biometric
    - Card ID (Same as User ID)
    - Access Group information
    On Device
    - User ID
    - Access Group information
    - No information required


Step 5: Write the data on the card


Sample Code: How to issue a smart card, including a visual face?


-precautions-
The code below is based on the Demo code of Suprema G-SDK. Results may vary depending on the environment. Please refer to the process only.


import grpc
import logging
import connect_pb2
import card_pb2

from testEvent import TestEvent
from example.cli.input import pressEnter

from example.client.client import GatewayClient
from example.connect.connect import ConnectSvc
from example.event.event import EventSvc
from example.card.card import CardSvc
from example.face.face import FaceSvc
from example.system.system import SystemSvc
from example.access.access import AccessSvc

GATEWAY_CA_FILE = '../../../cert/gateway/ca.crt'
GATEWAY_IP = '192.168.40.61'
GATEWAY_PORT = 4000

DEVICE_IP = '192.168.40.20'
DEVICE_PORT = 51211
USE_SSL = False

CODE_MAP_FILE = '../../event/event_code.json'

def test():
channel = None
connectSvc = None
devID = 0

try:
client = GatewayClient(GATEWAY_IP, GATEWAY_PORT, GATEWAY_CA_FILE)
channel = client.getChannel()

connectSvc = ConnectSvc(channel)
connInfo = connect_pb2.ConnectInfo(IPAddr=DEVICE_IP, port=DEVICE_PORT, useSSL=USE_SSL)

devID = connectSvc.connect(connInfo)

eventSvc = EventSvc(channel)
eventSvc.initCodeMap(CODE_MAP_FILE)
testEvent = TestEvent(eventSvc)
testEvent.startMonitoring(devID)

cardSvc = CardSvc(channel)
systemSvc = SystemSvc(channel)
faceSvc = FaceSvc(channel)
accessSVc = AccessSvc(channel)

#Step 1: Check and Set the smart card layout and card type
system_config = cardSvc.getConfig(devID)
system_config = systemSvc.getConfig(devID)

#Step 2: Format the card
pressEnter('>> Try to erase the card data. And, press ENTER to end the test.\n')
print(f'>> Place a smart card on the device...', flush=True)
cardSvc.erase(devID)

#Step 3: Normalize and Extract from the image
pressEnter('>> Try to extract the template data. Press ENTER to start the test.\n')
file = open("testfaceimage.jpeg", 'rb')
imageData = file.read()
warpedimgData = faceSvc.normalize(devID, imageData) #F2/BS3 ONLY
templateData = faceSvc.extract(devID, warpedimgData, False)

#Step 4: Prepare the data you need to issue a smart card
pressEnter('>> Try to set the smartcard data. Press ENTER to start the test.\n')
smartCardHeader = card_pb2.SmartCardHeader()
smartCardHeader.type = card_pb2.CARD_TYPE_ACCESS
smartCardHeader.numOfFaceTemplate = 1
smartCardHeader.templateSize = 552

smartCredential = card_pb2.SmartCardCredential()
smartCredential.templates.extend([templateData])

#For access group, use pre-generated information.
pressEnter('>> Try to get access group information. Press ENTER to start.\n')
print(accessSVc.getList(devID))

accessOnData = card_pb2.AccessOnCardData()
accessOnData.accessGroupIDs.extend([4])
accessOnData.startTime = 978307200
accessOnData.endTime = 1924991940

pressEnter('>> Try to set smartcard data. Press ENTER to start.\n')
smartCardData = card_pb2.SmartCardData()
smartCardData.header.CopyFrom(smartCardHeader)
smartCardData.cardID = (20230301).to_bytes(32, byteorder="big")
smartCardData.credential.CopyFrom(smartCredential)
smartCardData.accessOnData.CopyFrom(accessOnData)

#Step 5: Write the data on the card
pressEnter('>> Try to set smartcard data. Press ENTER to start.\n Place a smart card on the device...')
cardSvc.write(devID, smartCardData)

# End Of the test
testEvent.stopMonitoring(devID)
connectSvc.disconnect([devID])
channel.close()

except grpc.RpcError as e:
print(f'Cannot finish the user test: {e}', flush=True)

if devID != 0:
connectSvc.disconnect([devID])
channel.close()


if __name__ == '__main__':
logging.basicConfig()
test()