Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:smartcard_api [2017/12/15 14:40]
yjjung
en:smartcard_api [2021/09/14 14:37] (current)
mark
Line 21: Line 21:
 <WRAP group 100%> <WRAP group 100%>
 ^Value ​ ^Description ​ ^Used Format ^ ^Value ​ ^Description ​ ^Used Format ^
-|0x00 |Unknown card  | +|0x00 |Unknown card  ​| ​ | 
-|0x01 |CSN card  | +|0x01 |CSN card  ​| ​ | 
-|0x02 |Secure card  | +|0x02 |Secure card  ​| ​ | 
-|0x03 |Access card  |+|0x03 |Access card  ​| ​ | 
 +|0x06 |QR Code  |  |
 |0x0A |Wiegand card  | BS2WiegandConfig.format (This format is used when BS2WiegandConfig.CSNIndex and BS2WiegandConfig.CardMask is set as 0 | |0x0A |Wiegand card  | BS2WiegandConfig.format (This format is used when BS2WiegandConfig.CSNIndex and BS2WiegandConfig.CardMask is set as 0 |
 |0x1A |Wiegand card  | BS2WiegandMultiConfig.formats[0] | |0x1A |Wiegand card  | BS2WiegandMultiConfig.formats[0] |
Line 44: Line 45:
 </​WRAP>​ </​WRAP>​
 **2. //size//** \\  **2. //size//** \\ 
-The size of card template. \\ \\ +This is the size of the data buffer. This field needs to be filled with a fixed value as '​32'​.\\ \\ 
 **3. //data//** \\  **3. //data//** \\ 
 The data of card template. \\  The data of card template. \\ 
-In case of Secure Credential Card(SCC), users need to have card information which includes Card ID(24byte), issueCount(4byte) and TimeStamp(4byte). \\+In case of Secure Credential Card(SCC), users need to have card information which includes Card ID(24byte), issueCount(4byte) and TimeStamp(4byte). ​Also, cardObjs array of BS2UserBlob structure should be filled for SCC cards and the user should be updated after SCC issuing.  ​\\ 
 +\\ 
 + 
 + 
 +<WRAP tip 70%> 
 +**Tip**\\ 
 +<wrap em> You can use any value as long as the data and the cardObj in [[user management api#​BS2UserBlob|BS2UserBlob]] match. </​wrap>​ \\ 
 +TimeStamp or issueCount is an operational flag for better management but there'​s no validation check for TimeStamp or issueCount on the device.\\ 
 +</​WRAP>​ 
 ==== BS2SmartCardHeader ==== ==== BS2SmartCardHeader ====
 <code cpp> <code cpp>
Line 58: Line 68:
     uint16_t issueCount;     uint16_t issueCount;
     uint8_t duressMask;     uint8_t duressMask;
-    uint8_t reserved[5]; +    ​uint8_t cardAuthMode;​ 
-} BS2SmartCardHeader; ​ +    uint8_t useAlphanumericID;​ 
 +    uint8_t cardAuthModeEx;​ 
 +    uint8_t numOfFaceTemplate;​ 
 +    ​uint8_t reserved[1]; 
 +} BS2SmartCardHeader;​
 </​code>​ </​code>​
 **1. //​hdrCRC//​** \\  **1. //​hdrCRC//​** \\ 
-Value of card header checksum. \\ \\ +Value of card header checksum. ​(cardCRC - reserved) ​\\ \\ 
 **2. //​cardCRC//​** \\  **2. //​cardCRC//​** \\ 
-Value of card data checksum. \\ \\ +Value of card data checksum. ​(BS2SmartCardHeader.cardType - BS2SmartCardData.accessOnData) ​\\ \\ 
 **3. //​cardType//​** \\  **3. //​cardType//​** \\ 
 Code of card types. \\  Code of card types. \\ 
 <WRAP group 50%> <WRAP group 50%>
 ^Value ​ ^Description ​ ^ ^Value ​ ^Description ​ ^
-|0 |Unknown card  | +|0x00 |Unknown card  | 
-|1 |CSN card  | +|0x01 |CSN card  | 
-|2 |Secure card  | +|0x02 |Secure card  | 
-|3 |Access card  | +|0x03 |Access card  | 
-||Wiegand card  |+|0x0A |Wiegand card  ​
 +|0x0B |Config ​card ​ |
 </​WRAP>​ </​WRAP>​
 **4. //​numOfTemplate//​** \\  **4. //​numOfTemplate//​** \\ 
 Number of templates. \\ \\  Number of templates. \\ \\ 
 +<WRAP important>​
 +Based on AoC structure, template data is stored in [[smartcard_api#​BS2SmartCardCredentials]]. \\
 +Here you can store either fingerprint or face template. Both fingerprint and face templates can not be stored together. \\
 +Thus, you have to set numOfFacetemplate = 0 if you want to store fingerprint template data.
 +</​WRAP>​
 +
 +
 **5. //​templateSize//​** \\  **5. //​templateSize//​** \\ 
 Size of the template. A normal fingerprint template is a fixed 384 byte. \\ Size of the template. A normal fingerprint template is a fixed 384 byte. \\
Line 85: Line 107:
 **7. //​duressMask//​** \\  **7. //​duressMask//​** \\ 
 Mask for whether there is a duress finger. \\  Mask for whether there is a duress finger. \\ 
 +**8. //​cardAuthMode//​** \\ 
 +''​Other devices''​ Card authentication mode. \\ 
 +''​FaceStation F2''​ Please use **cardAuthModeEx** instead \\ 
 +<WRAP group 50%>
 +^Value ​ ^Description ​ ^
 +|2 |Card only   |
 +|3 |Card + Fingerprint ​  |
 +|4 |Card + PIN  |
 +|5 |Card + Fingerprint or PIN   |
 +|6 |Card + Fingerprint + PIN    |
 +|254 |Cannot use  |
 +|255 |Not defined(System defined mode)  |
 +</​WRAP>​
 +**9. //​useAlphanumericID//​** \\ 
 +Flag of usage of Alphanumeric ID \\ 
 +**10. //​cardAuthModeEx//​** \\ 
 +''​Other devices''​ Please use **cardAuthMode** instead \\ 
 +[+ V2.7.1] ''​FaceStation F2''​ Card authentication mode \\ 
 +<WRAP group 60%>
 +^Value ​ ^Level 1  ^Level 2  ^Level 3  ^
 +|21  |Card  |      |   |
 +|22  |Card  |Face  |   |
 +|23  |Card  |Fingerprint ​ |   |
 +|24  |Card  |PIN  |   |
 +|25  |Card  |Face or Fingerprint ​ |   |
 +|26  |Card  |Face or PIN  |   |
 +|27  |Card  |Fingerprint or PIN  |   |
 +|28  |Card  |Face or Fingerprint or PIN  |   |
 +|29  |Card  |Face  |Fingerprint ​ |
 +|30  |Card  |Face  |PIN  |
 +|31  |Card  |Fingerprint ​ |Face  |
 +|32  |Card  |Fingerprint ​ |PIN  |
 +|33  |Card  |Face or Fingerprint ​ |PIN  |
 +|34  |Card  |Face  |Fingerprint or PIN  |
 +|35  |Card  |Fingerprint ​ |Face or PIN  |
 +|254 |Cannot use  |  |  |
 +|255 |Not defined(System defined mode)  |  |  |
 +</​WRAP>​
 +**11. //​numOfFaceTemplate//​** \\ 
 +Number of face templates. \\
 +Basic size of template is different between fingerprint and face(Fingerprint:​384,​ Face:552). \\
 +You can consider the total size of templateData in [[smartcard_api#​BS2SmartCardCredentials]]. ​
 +<WRAP important>​
 +Based on AoC structure, template data is stored in [[smartcard_api#​BS2SmartCardCredentials]]. \\
 +Here you can store either fingerprint or face template. Both fingerprint and face templates can not be stored together. \\
 +Thus, you have to set numOftemplate = 0 if you want to store face template data.
 +</​WRAP>​
 +**12. //​reserved//​** \\ 
 +Reserved \\ 
 +
  
 ==== BS2SmartCardCredentials ==== ==== BS2SmartCardCredentials ====
Line 117: Line 189:
 typedef struct { typedef struct {
     BS2SmartCardHeader header;     BS2SmartCardHeader header;
-    ​union { +    uint8_t cardID[BS2_CARD_DATA_SIZE];​
-        ​uint8_t cardID[BS2_CARD_DATA_SIZE]+
-        struct { +
-            uint8_t secureCredentialCardID[BS2_CARD_DATA_SIZE - 8]; +
-            uint32_t issueCount;​ +
-            uint32_t issueTimeStamp;​ +
-        };+
     BS2SmartCardCredentials credentials;​     BS2SmartCardCredentials credentials;​
     BS2AccessOnCardData accessOnData;​     BS2AccessOnCardData accessOnData;​
-    }; 
 } BS2SmartCardData; ​   ​ } BS2SmartCardData; ​   ​
 </​code>​ </​code>​
Line 132: Line 197:
 Smart card header. \\ \\  Smart card header. \\ \\ 
 **2. //​cardID//​** \\  **2. //​cardID//​** \\ 
-Card ID that will be used on the card. Access on Cards will need to use the 32 byte array for the card ID. \\ \\  +Card ID that will be used on the card. \\ 
-**3. //​secureCredentialCardID//​** \\  +Access on Cards will need to use the 32 byte array for the card ID. \\ 
-Card ID that will be used on the card and device. ​Secure Credential Cards will need to use a 24 byte array for the card ID. \\ \\  +Secure Credential Cards will need to use a 24 byte array for the card ID. \\ 
-**4. //​issueCount//​** \\  +In case of Secure Credential Card(SCC), users need to have card information which includes Card ID(24byte), ​issueCount(4byte) and TimeStamp(4byte). \\ 
-The count on how many times the card was issued. This needs to be correctly entered same as the 'issueCount' field from the BS2SmartCardHeader\\ \\  +Also, cardObjs array of BS2UserBlob structure should be filled for SCC cards and the user should be updated after SCC issuing. \\ \\ 
-**5. //​issueTimeStamp//​** \\  +**3. //​credentials//​** \\ 
-The time when the card was issued. The unit is in Unix timestamp. \\ \\  +
-**6. //​credentials//​** \\ +
 Authentication data area where the PIN or fingerprint template is stored. \\ \\  Authentication data area where the PIN or fingerprint template is stored. \\ \\ 
-**7. //​accessOnData//​** \\ +**4. //​accessOnData//​** \\ 
 Data area the AOC card uses, which carries the access group information.\\ ​ Data area the AOC card uses, which carries the access group information.\\ ​
  
 ==== BS2Card ==== ==== BS2Card ====
 <code cpp> <code cpp>
-typedef struct +typedef struct {
-{+
     uint8_t isSmartCard;​     uint8_t isSmartCard;​
-    union +    union {
-    ​{+
         BS2CSNCard card;         BS2CSNCard card;
         BS2SmartCardData smartCard;         BS2SmartCardData smartCard;