Prévia do material em texto
i
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
Datablink Management API
Technical document
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
ii
DOCUMENT INFORMATION
Revision Date Comment
1.0.0 08/10/2019 First release
1.1.0 12/08/2020 Added chapter 1.5
1.2.0 05/10/2020 Updated requirements
1.2.1 10/09/2021 Linux compatibility update
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
iii
Contents
1. Introduction ........................................................................................................................................1
1.1 Components ............................................................................................................................ 1
1.1.1 Datablink Management API ................................................................................. 1
1.1.2 Datablink Management Mobile 200 API .............................................................. 1
1.2 What is Datablink Management API? ..................................................................................... 2
1.3 What is Datablink Management Mobile 200 API .................................................................... 2
1.4 Datablink authenticators ........................................................................................................ 3
1.4.1 Mobile 50 ............................................................................................................. 3
1.4.2 Mobile 200 ........................................................................................................... 3
1.4.3 Device 200 ............................................................................................................ 5
1.5 Blinking Server ...................................................................................................................... 13
1.5.1 Blinking Server Requirements ............................................................................ 14
1.5.2 Blinking Server Usage ......................................................................................... 14
1.5.3 Blinking Server API ............................................................................................. 16
2 Architecture ..................................................................................................................................... 19
2.1 Datablink Management API architecture ............................................................................. 19
2.2 Datablink Management Mobile200 API architecture ........................................................... 20
3 Installation ....................................................................................................................................... 21
3.1 Requirements ........................................................................................................................ 21
3.2 Files ....................................................................................................................................... 22
3.3 Windows deployment ........................................................................................................... 23
3.3.1 For 64 bits aplication .......................................................................................... 23
3.3.2 For 32 bits aplication .......................................................................................... 24
3.3.3 Using a 32 bits machine ..................................................................................... 24
3.3.4 Wrapper register ................................................................................................ 24
3.4 Linux deployment ................................................................................................................. 25
3.4.1 Java development .............................................................................................. 26
3.4.2 32 bits machines ................................................................................................ 27
4 Flows ................................................................................................................................................ 28
4.1 Datablink Management API .................................................................................................. 28
4.1.1 State diagram for an authentication blob ......................................................... 28
4.1.2 Tokens keys files ................................................................................................ 29
4.1.3 Tokens management ......................................................................................... 30
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
iv
4.1.4 Management global parameters ....................................................................... 35
4.1.5 Authentication and signing ................................................................................ 37
4.2 Datablink Management Mobile 200 API ............................................................................... 43
4.2.1 State diagram for a Mobile 200 management blob .......................................... 43
4.2.2 Activation ........................................................................................................... 43
4.2.3 Block mobile token ............................................................................................ 49
4.2.4 Unblock mobile token ........................................................................................ 51
4.2.5 Synchronize mobile token ................................................................................. 54
4.2.6 Read mobile token information ......................................................................... 57
4.2.7 Migrate mobile token ........................................................................................ 58
4.2.8 Create transactions ............................................................................................ 60
4.2.9 Change mobile token configuration .................................................................. 63
5 Functions .......................................................................................................................................... 64
5.1 Datablink Management API .................................................................................................. 64
5.1.1 Key files .............................................................................................................. 64
5.1.2 Tokens management ......................................................................................... 68
5.1.3 Management global parameters ....................................................................... 91
5.1.4 Token status ..................................................................................................... 105
5.1.5 Authentication and signing .............................................................................. 117
5.1.6 Synchronism ..................................................................................................... 152
5.1.7 Functions utilities ............................................................................................. 161
5.1.8 HSM functions .................................................................................................. 1645.2 Datablink Management Mobile 200 API ............................................................................. 173
5.2.1 Management functions .................................................................................... 173
5.2.2 Communication functions ................................................................................ 238
6 Structs and objects ......................................................................................................................... 291
6.1 Datablink Management API ................................................................................................ 291
6.1.1 Token information ........................................................................................... 291
6.1.2 Global parameters ........................................................................................... 292
6.2 Datablink Management Mobile 200 API ............................................................................. 293
7 Constants and communication patterns ........................................................................................ 294
7.1 Datablink Management API ................................................................................................ 294
7.2 Datablink Management Mobile 200 API ............................................................................. 295
8 Error codes ..................................................................................................................................... 296
8.1 Datablink Management API ................................................................................................ 296
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
v
8.2 Datablink Management Mobile 200 API ............................................................................. 301
9 Support........................................................................................................................................... 307
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
vi
Figures
Figure 1 - Datablink Mgmt API ................................................................................................... 1
Figure 2 - Datablink Mgmt Mobile 200 API ................................................................................ 1
Figure 3 - Mobile 50 logo ........................................................................................................... 3
Figure 4 - Mobile 200 logo ......................................................................................................... 3
Figure 5- Mobile 200 screens ..................................................................................................... 3
Figure 6 - Activation screen ....................................................................................................... 4
Figure 7 - PIN register screen ..................................................................................................... 4
Figure 8 - Main screen ............................................................................................................... 4
Figure 9 - Device 200 logo .......................................................................................................... 5
Figure 10 - Device 200 ................................................................................................................ 5
Figure 11 - Scroll through signature values ............................................................................... 6
Figure 12 - Internet banking example ........................................................................................ 7
Figure 13 - Inter-bank transactions............................................................................................ 8
Figure 14 - Payment transaction ................................................................................................ 8
Figure 15 - Loan transaction ...................................................................................................... 8
Figure 16 - Device 200 back ..................................................................................................... 12
Figure 17 - Device 200 display ................................................................................................. 12
Figure 18 - Device 200 perspective .......................................................................................... 13
Figure 19 - Device 200 custom ................................................................................................. 13
Figure 20 – Blinking Server Java ............................................................................................... 14
Figure 21 - Blinking Server Nodejs ........................................................................................... 15
Figure 22 - Blinking Server running .......................................................................................... 18
Figure 23 - Datablink Management API Architecture .............................................................. 19
Figure 24 - Datablink Management Mobile200 API Architecture ........................................... 20
Figure 25 – Symbolic links created........................................................................................... 26
Figure 26 - Verify ldconfig ........................................................................................................ 26
Figure 27 - State diagram for an authentication blob ............................................................. 28
Figure 28 - Decrypt Key Files .................................................................................................... 29
Figure 29 - Activates / Deactivates an authentication blob .................................................... 30
Figure 30 - Block / Unblock an authentication blob ................................................................ 31
Figure 31 - Token expiration .................................................................................................... 32
Figure 32 - Generates management command ....................................................................... 33
Figure 33 - Generate Mobile 200 management blob .............................................................. 34
Figure 34 - Reading the global parameters.............................................................................. 35
Figure 35 - Writing global parameters ..................................................................................... 36
Figure 36 - Checking OTP ......................................................................................................... 37
Figure 37 - Defining mobile DNA ............................................................................................. 38
Figure 38 - Signature process ................................................................................................... 39
Figure 39 - Mobile signature .................................................................................................... 41
Figure 40 - Generating OTP ...................................................................................................... 42
Figure 41 - State diagram for a Mobile 200 management blob .............................................. 43
Figure 42 - Activating mobile token typing credentials ........................................................... 45
Figure 43 - Activating mobile token using QR code ................................................................. 48
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733597https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733598
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733599
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733600
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733601
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733602
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733603
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733604
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733605
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733606
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733612
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733613
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733614
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733615
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733626
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733629
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733631
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733638
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733639
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
vii
Figure 44 - Blocking mobile token ........................................................................................... 49
Figure 45 - Blocking mobile token by PIN errors ..................................................................... 51
Figure 46 - Unblocking mobile token ....................................................................................... 53
Figure 47 - Synchronizing mobile token .................................................................................. 54
Figure 48 - Synchronizing mobile token by time ..................................................................... 56
Figure 49 - Reading mobile blob information .......................................................................... 57
Figure 50 - Migrate mobile token ............................................................................................ 59
Figure 51 - Creating transaction using Push ............................................................................ 61
Figure 52 - Creating transaction using QR code ...................................................................... 62
Figure 53 - Changing mobile token configuration ................................................................... 63
Figure 54 - Key file line ............................................................................................................. 64
Figure 55 - Datablink Support ................................................................................................ 307
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733640
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733643
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733645
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733646
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733647
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733648
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733649
https://wgt-my.sharepoint.com/personal/eduardo_ferreira_watchguard_com/Documents/Eduardo/Releases/Mgmt_SDK_6.3.1/Documents%20-%20nao%20vai%20no%20pacote/SDK_6.3.1/Datablink_Management_API_EN_v6.3.1.docx#_Toc83733651
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
viii
Tables
Table 1 – Supported browsers ................................................................................................. 10
Table 2 - Blinking Server request function ............................................................................... 16
Table 3 - Blinking Server request example .............................................................................. 17
Table 4 - Blinking Server javascript function example .............................................................17
Table 5 - DatablinkDecryptKeyFile Signature .......................................................................... 65
Table 6 - Token models ............................................................................................................ 65
Table 7 - DatablinkDecryptKeyFile C++ Sample Code .............................................................. 66
Table 8 - DatablinkDecryptKeyFile Java Sample Code ............................................................. 67
Table 9 - DatablinkDecryptKeyFile C# Sample Code ................................................................ 67
Table 10 - DatablinkActivateToken Signature ......................................................................... 68
Table 11 - DatablinkActivateToken C++ Sample Code ............................................................. 69
Table 12 - DatablinkActivateToken Java Sample Code ............................................................ 69
Table 13 - DatablinkActivateToken C# Sample Code ............................................................... 70
Table 14 - DatablinkBlockToken Signature .............................................................................. 70
Table 15 - DatablinkBlockToken C++ Sample Code ................................................................. 71
Table 16 - DatablinkBlockToken Java Sample Code ................................................................. 72
Table 17 - DatablinkBlockToken C# Sample Code ................................................................... 72
Table 18 - DatablinkTokenExpiration Signature ...................................................................... 73
Table 19 - DatablinkTokenExpiration C++ Sample Code - Using months ............................... 74
Table 20 - DatablinkTokenExpiration C++ Sample Code - Using a specific date ..................... 75
Table 21- DatablinkTokenExpiration Java Sample Code - Using months ................................ 75
Table 22 - DatablinkTokenExpiration Java Sample Code - Using a specific date ..................... 76
Table 23 - DatablinkTokenExpiration C# Sample Code - Using Months .................................. 76
Table 24 - DatablinkTokenExpiration C# Sample Code - Using a specific date ....................... 77
Table 25 - DatablinkGenMgmtCmd Signature ......................................................................... 78
Table 26 - DatablinkGenMgmtCmd C++ Sample Code ............................................................ 79
Table 27 - DatablinkGenMgmtCmd Java Sample Code ........................................................... 80
Table 28 - DatablinkGenMgmtCmd C# Sample Code .............................................................. 80
Table 29 – DatablinkGenMobile200MgmtAPIBlob .................................................................. 81
Table 30 – DatablinkGenMobile200MgmtAPIBlob C++ Sample Code ..................................... 82
Table 31 – DatablinkGenMobile200MgmtAPIBlob Java Sample Code .................................... 83
Table 32 – DatablinkGenMobile200MgmtAPIBlob C# Sample Code ....................................... 83
Table 33 - DatablinkTokenModel Signature ............................................................................ 84
Table 34 - Token Model ........................................................................................................... 84
Table 35 - DatablinkTokenModel C++ Sample Code................................................................ 85
Table 36 - DatablinkTokenModel Java Sample Code ............................................................... 85
Table 37 - DatablinkTokenModel C# Sample Code.................................................................. 86
Table 38 - DatablinkDefineMobileDNA Signature ................................................................... 87
Table 39 - DatablinkDefineMobileDNA C++ Sample Code....................................................... 87
Table 40 - DatablinkDefineMobileDNA Java Sample Code ...................................................... 88
Table 41 - DatablinkDefineMobileDNA C# Sample Code......................................................... 88
Table 42 - DatablinkChangeOTPSize Signature ........................................................................ 89
Table 43 - DatablinkChangeOTPSize C++ Sample Code ........................................................... 90
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
ix
Table 44 - DatablinkChangeOTPSize Java Sample Code .......................................................... 90
Table 45 - DatablinkChangeOTPSize C# Sample Code ............................................................. 91
Table 46 - DatablinkReadDevice200Parms Signature ............................................................. 91
Table 47 - DatablinkReadDevice200Parms C++ Sample Code ................................................. 92
Table 48 - DatablinkReadDevice200Parms Java Sample Code ................................................ 93
Table 49 - DatablinkReadDevice200Parms C# Sample Code ................................................... 93
Table 50 - DatablinkReadMobile50Parms Signature ............................................................... 94
Table 51 - DatablinkReadMobile50Parms C++ Sample Code .................................................. 94
Table 52 - DatablinkReadMobile50Parms Java Sample Code ................................................. 95
Table 53 - DatablinkReadMobile50Parms C# Sample Code .................................................... 95
Table 54 - DatablinkReadMobile200Parms Signature ............................................................. 96
Table 55 - DatablinkReadMobile200Parms C++ Sample Code ................................................ 96
Table 56 - DatablinkReadMobile200Parms Java Sample Code ............................................... 97
Table 57 - DatablinkReadMobile200Parms C# Sample Code .................................................. 97
Table 58 - DatablinkWriteParmsDevice200 Signature............................................................. 98
Table 59 - DatablinkWriteParmsDevice200 C++ Sample Code ................................................ 99
Table 60 - DatablinkWriteParmsDevice200 Java Sample Code ............................................... 99
Table 61 - DatablinkWriteParmsDevice200 C# Sample Code ................................................ 100
Table 62 - DatablinkWriteParmsMobile50 Signature ............................................................ 100
Table 63 - DatablinkWriteParmsMobile50 C++ Sample Code ............................................... 101
Table 64 - DatablinkWriteParmsMobile50 Java Sample Code .............................................. 101
Table 65 - DatablinkWriteParmsMobile50 C# Sample Code ................................................. 102
Table 66 - DatablinkWriteParmsMobile200 Signature .......................................................... 102
Table 67 - DatablinkWriteParmsMobile200 C++ Sample Code ............................................. 103
Table 68 - DatablinkWriteParmsMobile200 Java Sample Code ............................................ 104
Table 69 - DatablinkWriteParmsMobile200 C# Sample Code ............................................... 104
Table 70 - DatablinkReadDevice200Info Signature ............................................................... 105
Table 71 - DatablinkReadDevice200Info C++ Sample Code .................................................. 106
Table 72 - DatablinkReadDevice200Info Java Sample Code .................................................. 107
Table 73 - DatablinkReadDevice200Info C# Sample Code .................................................... 108
Table 74 - DatablinkReadMobile50Info Signature................................................................. 109
Table 75 - DatablinkReadMobile50Info C++ Sample Code .................................................... 110
Table 76 - DatablinkReadMobile50Info Java Sample Code ................................................... 111
Table 77 - DatablinkReadMobile50Info C# Sample Code ...................................................... 112
Table 78 - DatablinkReadMobile200Info Signature ............................................................... 113
Table 79 - DatablinkReadMobile200Info C++ Sample Code .................................................. 114
Table 80 - DatablinkReadMobile200Info Java Sample Code ................................................. 115
Table 81 - DatablinkReadMobile200Info C# Sample Code .................................................... 116
Table 82 - DatablinkCheckOTP Signature .............................................................................. 117
Table 83 - DatablinkCheckOTP C++ Sample Code .................................................................. 118
Table 84 - DatablinkCheckOTP Java Sample Code ................................................................. 118
Table 85 - DatablinkCheckOTP C# Sample Code .................................................................... 119
Table 86 - DatablinkCheckOTPMSChapV2 Signature ............................................................. 120
Table 87 - DatablinkCheckOTPMSChapV2 C++ Sample Code ................................................ 121
Table 88 - DatablinkCheckOTPMSChapV2 Java Sample Code ............................................... 122
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
x
Table 89 - DatablinkCheckOTPMSChapV2 C# Sample Code .................................................. 123
Table 90 - DatablinkGenSigningCmd Signature ..................................................................... 124
Table 91 - DatablinkGenSigningCmd C++ Sample Code ........................................................ 126
Table 92 - DatablinkGenSigningCmd Java Sample Code ........................................................ 127
Table 93 - DatablinkGenSigningCmd C# Sample Code .......................................................... 127
Table 94 - DatablinkGenDeviceSigningCmd Signature .......................................................... 128
Table 95 - DatablinkGenDeviceSigningCmd C++ Sample Code.............................................. 130
Table 96 - DatablinkGenDeviceSigningCmd Java Sample Code ............................................. 131
Table 97 - DatablinkGenDeviceSigningCmd C# Sample Code ............................................... 131
Table 98 - DatablinkCheckSignature Signature ...................................................................... 132
Table 99 - DatablinkCheckSignature C++ Sample Code ......................................................... 133
Table 100 - DatablinkCheckSignature Java Sample Code ...................................................... 133
Table 101 - DatablinkCheckSignature C# Sample Code ......................................................... 134
Table 102 - DatablinkCheckMobileSignature Signature ........................................................ 135
Table 103 - DatablinkCheckMobileSignature C++ Sample Code ........................................... 135
Table 104 - DatablinkCheckMobileSignature Java Sample Code ........................................... 136
Table 105 - DatablinkCheckMobileSignature C# Sample Code ............................................. 136
Table 106 - DatablinkCheckDeviceSignature Signature ......................................................... 137
Table 107 - DatablinkCheckDeviceSignature C++ Sample Code ............................................ 138
Table 108 - DatablinkCheckDeviceSignature Java Sample Code ........................................... 138
Table 109 - DatablinkCheckDeviceSignature C# Sample Code .............................................. 139
Table 110 - DatablinkGenOTP Signature ............................................................................... 139
Table 111 - DatablinkGenOTP C++ Sample Code ................................................................... 140
Table 112 - DatablinkGenOTP Java Sample Code .................................................................. 140
Table 113 - DatablinkGenOTP C# Sample Code ..................................................................... 141
Table 114 - DatablinkChallengeGen C++ Sample Code ......................................................... 141
Table 115 - DatablinkChallengeGen C++ Sample Code ......................................................... 142
Table 116 - DatablinkChallengeGen Java Sample Code ......................................................... 143
Table 117 - DatablinkChallengeGen C# Sample Code ........................................................... 143
Table 118 - DatablinkChallengeResponseCmdGen Signature ............................................... 144
Table 119 - DatablinkChallengeResponseCmdGen C++ Sample Code .................................. 145
Table 120 - DatablinkChallengeResponseCmdGen Java Sample Code .................................. 146
Table 121 - DatablinkChallengeResponseCmdGen C# Sample Code .................................... 146
Table 122 - DatablinkSetChallenge Signature ........................................................................ 147
Table 123 - DatablinkSetChallenge C++ Sample Code ........................................................... 148
Table 124 - DatablinkSetChallenge Java Sample Code .......................................................... 148
Table 125 - DatablinkSetChallenge C# Sample Code ............................................................. 149
Table 126 - DatablinkCheckResponse Signature ................................................................... 149
Table 127 - DatablinkCheckResponse C++ Sample Code ....................................................... 150
Table 128 - DatablinkCheckResponse Java Sample Code ...................................................... 151
Table 129 - DatablinkCheckResponse C# Sample Code ......................................................... 151
Table 130 - DatablinkOpenTokenWindow Signature ............................................................ 152
Table 131 - DatablinkOpenTokenWindow C++ Sample Code ................................................ 153
Table 132 - DatablinkOpenTokenWindow Java Sample Code ............................................... 153
Table 133 - DatablinkOpenTokenWindow C# Sample Code .................................................. 154
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
xi
Table 134 - DatablinkSyncToken Signature ........................................................................... 154
Table 135 - DatablinkSyncToken C++ Sample Code ............................................................... 155
Table 136 - DatablinkSyncToken Java Sample Code .............................................................. 155
Table 137 - DatablinkSyncToken C# Sample Code ................................................................. 156
Table 138 - DatablinkSyncCheckOTP Signature ..................................................................... 156
Table 139 - DatablinkSyncCheckOTP C++ Sample Code ........................................................ 157
Table 140 - DatablinkSyncCheckOTP Java Sample Code ....................................................... 158
Table 141 - DatablinkSyncCheckOTP C# Sample Code .......................................................... 158
Table 142- DatablinkResetTimeDrift Signature .................................................................... 159
Table 143 - DatablinkResetTimeDrift C++ Sample Code ........................................................ 160
Table 144 - DatablinkResetTimeDrift Java Sample Code ....................................................... 160
Table 145 - DatablinkResetTimeDrift C# Sample Code .......................................................... 161
Table 146 - DatablinkMgmtAPIVersion Signature ................................................................. 161
Table 147 - DatablinkMgmtAPIVersion Java / C# Return ...................................................... 162
Table 148 - DatablinkMgmtAPIVersion C++ Sample Code .................................................... 162
Table 149 - DatablinkMgmtAPIVersion Java Sample Code .................................................... 162
Table 150 - DatablinkMgmtAPIVersion C# Sample Code ...................................................... 162
Table 151 - DatablinkErrorMessage Signature ...................................................................... 163
Table 152 - DatablinkErrorMessage Java / C# Return ........................................................... 163
Table 153 - DatablinkErrorMessage C++ Sample Code ......................................................... 163
Table 154 - DatablinkErrorMessage Java Sample Code ......................................................... 164
Table 155 - DatablinkErrorMessage C# Sample Code ........................................................... 164
Table 156 - DatablinkReadParmsHSM Signature ................................................................... 164
Table 157 - DatablinkReadParmsHSM C++ Sample Code ...................................................... 165
Table 158 - DatablinkReadParmsHSM Java Sample Code ..................................................... 166
Table 159 - DatablinkReadParmsHSM C# Sample Code ........................................................ 166
Table 160 - DatablinkWriteParmsHSM C++ Sample Code ..................................................... 167
Table 161 - DatablinkWriteParmsHSM C++ Sample Code ..................................................... 168
Table 162 - DatablinkWriteParmsHSM Java Sample Code .................................................... 168
Table 163 - DatablinkWriteParmsHSM C# Sample Code ....................................................... 169
Table 164 - DatablinkEnableHSM Signature .......................................................................... 169
Table 165 - DatablinkEnableHSM C++ Sample Code ............................................................. 170
Table 166 - DatablinkEnableHSM Java Sample Code ............................................................ 170
Table 167 - DatablinkEnableHSM C# Sample Code ............................................................... 171
Table 168 - DatablinkBlobConversionHSM Signature ........................................................... 171
Table 169 - DatablinkBlobConversionHSM C++ Sample Code ............................................... 172
Table 170 - DatablinkBlobConversionHSM Java Sample Code .............................................. 173
Table 171 - DatablinkBlobConversionHSM C# Sample Code ................................................. 173
Table 172 - DatablinkActivate Signature ............................................................................... 174
Table 173 - DatablinkActivate C++ Sample Code ................................................................... 175
Table 174 - DatablinkActivate Java Sample Code .................................................................. 176
Table 175 - DatablinkActivate C# Sample Code ..................................................................... 176
Table 176 - DatablinkBlock Signature .................................................................................... 177
Table 177 - DatablinkBlock C++ Sample Code ....................................................................... 178
Table 178 - DatablinkBlock Java Sample Code ...................................................................... 179
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
xii
Table 179 - DatablinkBlock C# Sample Code ......................................................................... 179
Table 180 - DatablinkBlockByPIN Signature .......................................................................... 180
Table 181 - DatablinkBlockByPIN C++ Sample Code .............................................................. 181
Table 182 - DatablinkBlockByPIN Java Sample Code ............................................................. 181
Table 183 - DatablinkBlockByPIN C# Sample Code ................................................................ 182
Table 184 - DatablinkErrorMessage Signature ...................................................................... 182
Table 185 - DatablinkErrorMessage Java / C# Return ........................................................... 183
Table 186 - DatablinkErrorMessage C++ Sample Code ......................................................... 183
Table 187 - DatablinkErrorMessage Java Sample Code ......................................................... 183
Table 188 - DatablinkErrorMessage C# Sample Code ........................................................... 183
Table 189 - DatablinkGenActivationCredentialsQRCode Signature ...................................... 184
Table 190 - DatablinkGenActivationCredentialsQRCode C++ Sample Code ......................... 185
Table 191 - DatablinkGenActivationCredentialsQRCode Java Sample Code ......................... 185
Table 192 - DatablinkGenActivationCredentialsQRCode C# Sample Code ........................... 186
Table 193 - DatablinkGenActivationCredentialsQRCodeDefault Signature .......................... 186
Table 194 - DatablinkGenActivationCredentialsQRCodeDefault C++ Sample Code ............. 187
Table 195 - DatablinkGenActivationCredentialsQRCodeDefault Java Sample Code ............. 188
Table 196 - DatablinkGenActivationCredentialsQRCodeDefault C# Sample Code ............... 188
Table 197 - DatablinkGenerateAuthorizationQRCodeCommand Signature ......................... 189
Table 198 - iTransactionData valid parameters ..................................................................... 190
Table 199 - iCharset possible values ...................................................................................... 190
Table 200- DatablinkGenerateAuthorizationQRCodeCommand C++ Sample Code - Using one
mobile blob ............................................................................................................................ 191
Table 201 - DatablinkGenerateAuthorizationQRCodeCommand C++ Sample Code - Using two
mobile blobs ........................................................................................................................... 192
Table 202 - DatablinkGenerateAuthorizationQRCodeCommand Java Sample Code - Using one
mobile blob ............................................................................................................................ 193
Table 203 - DatablinkGenerateAuthorizationQRCodeCommand Java Sample Code - Using two
mobile blobs ........................................................................................................................... 194
Table 204 - DatablinkGenerateAuthorizationQRCodeCommand C# Sample Code - Using one
mobile blobs ........................................................................................................................... 195
Table 205 - DatablinkGenerateAuthorizationQRCodeCommand C# Sample Code - Using two
mobile blobs ...........................................................................................................................196
Table 206 - DatablinkGenerateChallengeResponseQRCodeCommand Signature ................ 197
Table 207 - iCharset possible values ...................................................................................... 198
Table 208 - DatablinkGenerateChallengeResponseQRCodeCommand C++ Sample Code -
Using one mobile blobs .......................................................................................................... 199
Table 209 - DatablinkGenerateChallengeResponseQRCodeCommand C++ Sample Code -
Using two mobile blobs ......................................................................................................... 200
Table 210 - DatablinkGenerateChallengeResponseQRCodeCommand Java Sample Code -
Using one mobile blobs .......................................................................................................... 201
Table 211 - DatablinkGenerateChallengeResponseQRCodeCommand Java Sample Code -
Using two mobile blobs ......................................................................................................... 202
Table 212 - DatablinkGenerateChallengeResponseQRCodeCommand C# Sample Code - Using
one mobile blobs ................................................................................................................... 203
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
xiii
Table 213 - DatablinkGenerateChallengeResponseQRCodeCommand C# Sample Code - Using
two mobile blobs ................................................................................................................... 204
Table 214 - DatablinkGenerateSignatureQRCodeCommand Signature ................................ 205
Table 215 - iTransactionData valid parameters ..................................................................... 206
Table 216 - iCharset possible values ...................................................................................... 206
Table 217 - DatablinkGenerateSignatureQRCodeCommand C++ Sample Code - Using one
mobile blobs ........................................................................................................................... 207
Table 218 - DatablinkGenerateSignatureQRCodeCommand C++ Sample Code - Using two
mobile blobs ........................................................................................................................... 208
Table 219 - DatablinkGenerateSignatureQRCodeCommand Java Sample Code - Using one
mobile blobs ........................................................................................................................... 209
Table 220 - DatablinkGenerateSignatureQRCodeCommand Java Sample Code - Using two
mobile blobs ........................................................................................................................... 210
Table 221 - DatablinkGenerateSignatureQRCodeCommand C# Sample Code - Using one
mobile blobs ........................................................................................................................... 211
Table 222 - DatablinkGenerateSignatureQRCodeCommand C# Sample Code - Using two
mobile blobs ........................................................................................................................... 212
Table 223 - DatablinkGenerateAuthenticationPushCommand Signature ............................. 213
Table 224 - iCharset valid parameters ................................................................................... 213
Table 225 - DatablinkGenerateAuthenticationPushCommand C++ Sample Code ................ 214
Table 226 - DatablinkGenerateAuthenticationPushCommand Java Sample Code ............... 215
Table 227 - DatablinkGenerateAuthenticationPushCommand C# Sample Code .................. 215
Table 228 - DatablinkGenerateAuthorizationPushCommand Signature ............................... 216
Table 229 - iTransactionData valid parameters ..................................................................... 217
Table 230 - iCharset possible values ...................................................................................... 217
Table 231 - DatablinkGenerateAuthorizationPushCommand C++ Sample Code .................. 218
Table 232 - DatablinkGenerateAuthorizationPushCommand Java Sample Code ................. 219
Table 233 - DatablinkGenerateAuthorizationPushCommand C# Sample Code .................... 220
Table 234 - DatablinkGenerateChallengeResponsePushCommand Signature ..................... 221
Table 235 - iCharset possible values ...................................................................................... 222
Table 236 - DatablinkGenerateChallengeResponsePushCommand C++ Sample Code ......... 223
Table 237 - DatablinkGenerateChallengeResponsePushCommand Java Sample Code ........ 224
Table 238 - DatablinkGenerateChallengeResponsePushCommand C# Sample Code ........... 224
Table 239 - DatablinkGenerateSignaturePushCommand Signature ..................................... 225
Table 240 - iTransactionData valid parameters ..................................................................... 226
Table 241 - iCharset possible values ...................................................................................... 226
Table 242 - DatablinkGenerateSignaturePushCommand C++ Sample Code ......................... 227
Table 243 - DatablinkGenerateSignaturePushCommand Java Sample Code ........................ 228
Table 244 - DatablinkGenerateSignaturePushCommand C# Sample Code ........................... 229
Table 245 - DatablinkMigrate Signature ................................................................................ 230
Table 246 - DatablinkMigrate C++ Sample Code ................................................................... 231
Table 247 - DatablinkMigrate Java Sample Code .................................................................. 232
Table 248 - DatablinkMigrate C# Sample Code ..................................................................... 232
Table 249 - DatablinkReadInfoMobile Signature ................................................................... 233
Table 250 - DatablinkReadInfoMobile C++ Sample Code ...................................................... 234
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
xiv
Table 251 - DatablinkReadInfoMobile Java Sample Code ..................................................... 235
Table 252 - DatablinkReadInfoMobile C# Sample Code ........................................................ 236
Table 253 - DatablinkMob200APIVersion Signature ............................................................. 237
Table 254 - DatablinkMob200APIVersion Java / C# Return .................................................. 237
Table 255 - DatablinkMob200APIVersion C++ Sample Code ................................................. 237
Table 256 - DatablinkMob200APIVersion Java Sample Code ................................................ 238
Table 257 - DatablinkMob200APIVersion C# Sample Code................................................... 238
Table 258 - DatablinkActivateMobileStep1 Signature ........................................................... 238
Table 259 - DatablinkActivateMobileStep1 C++ Sample Code .............................................. 241
Table 260 - DatablinkActivateMobileStep1 Java Sample Code ............................................. 242
Table 261 - DatablinkActivateMobileStep1 C# Sample Code ................................................ 243
Table 262 - DatablinkActivateMobileStep2 Signature ........................................................... 244
Table 263 - DatablinkActivateMobileStep2 C++ Sample Code ..............................................247
Table 264 - DatablinkActivateMobileStep2 Java Sample Code ............................................. 249
Table 265 - DatablinkActivateMobileStep2 C# Sample Code ................................................ 250
Table 266 - DatablinkBlockMobile Signature ......................................................................... 251
Table 267 - DatablinkBlockMobile C++ Sample Code ............................................................ 253
Table 268 - DatablinkBlockMobile Java Sample Code ........................................................... 254
Table 269 - DatablinkBlockMobile C# Sample Code .............................................................. 255
Table 270 - DatablinkCreateDataConfig Signature ................................................................ 256
Table 271 - DatablinkCreateDataConfig C++ Sample Code ................................................... 257
Table 272 - DatablinkCreateDataConfig Java Sample Code .................................................. 258
Table 273 - DatablinkCreateDataConfig C# Sample Code ..................................................... 259
Table 274 - DatablinkCreatePackCommunication Signature ................................................. 259
Table 275 - iAPIMobVersion Blob versions ............................................................................ 260
Table 276 - DatablinkCreatePackCommunication C++ Sample Code .................................... 261
Table 277 - DatablinkCreatePackCommunication Java Sample Code ................................... 262
Table 278 - DatablinkCreatePackCommunication C# Sample Code ...................................... 262
Table 279 - DatablinkCreateCommunicationPackMsg Signature .......................................... 263
Table 280 - DatablinkCreateCommunicationPackMsg C++ Sample Code ............................. 264
Table 281 - DatablinkCreateCommunicationPackMsg Java Sample Code ............................ 264
Table 282 - DatablinkCreateCommunicationPackMsg C# Sample Code ............................... 265
Table 283 - DatablinkExtractDataCommunication Signature ................................................ 265
Table 284 - iAPIMobVersion Blob versions ............................................................................ 266
Table 285 - DatablinkExtractDataCommunication C++ Sample Code ................................... 267
Table 286 - DatablinkExtractDataCommunication Java Sample Code .................................. 268
Table 287 - DatablinkExtractDataCommunication C# Sample Code ..................................... 268
Table 288 - DatablinkGenGenericPacketResponse Signature ............................................... 269
Table 289 - DatablinkGenGenericPacketResponse C++ Sample Code .................................. 270
Table 290 - DatablinkGenGenericPacketResponse Java Sample Code .................................. 270
Table 291 - DatablinkGenGenericPacketResponse C# Sample Code .................................... 271
Table 292 - DatablinkMigrateMobile Signature .................................................................... 271
Table 293 - DatablinkMigrateMobile C++ Sample Code ........................................................ 274
Table 294 - DatablinkMigrateMobile Java Sample Code ....................................................... 275
Table 295 - DatablinkMigrateMobile C# Sample Code .......................................................... 276
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
xv
Table 296 - DatablinkSyncByTime Signature ......................................................................... 277
Table 297 - DatablinkSyncByTime C++ Sample Code............................................................. 278
Table 298 - DatablinkSyncByTime Java Sample Code ............................................................ 278
Table 299 - DatablinkSyncByTime C# Sample Code............................................................... 279
Table 300 - DatablinkSyncMobile Signature .......................................................................... 279
Table 301 - DatablinkSyncMobile C++ Sample Code ............................................................. 282
Table 302 - DatablinkSyncMobile Java Sample Code ............................................................ 283
Table 303 - DatablinkSyncMobile C# Sample Code ............................................................... 284
Table 304 - DatablinkUnblockMobile Signature .................................................................... 285
Table 305 - DatablinkUnblockMobile C++ Sample Code ....................................................... 288
Table 306 - DatablinkUnblockMobile Java Sample Code ...................................................... 289
Table 307 - DatablinkUnblockMobile C# Sample Code ......................................................... 290
Table 308 - Datablink Management API C++ Structs Mobile200 Info ................................... 291
Table 309 - Datablink Management API C++ Structs Mobile50 Info ..................................... 291
Table 310 - Datablink Management API C++ Structs Device200 Info .................................... 292
Table 311 - C++ Structs Mobile200 Parms ............................................................................. 292
Table 312 - Datablink Management API C++ Structs Mobile50 Parms ................................. 292
Table 313 - Datablink Management API C++ Structs Device200 Parms ................................ 293
Table 314 - Datablink Management Mobile 200 API C++ Structs Mobile Info ...................... 293
Table 315 - Datablink Management API Constants and Communication patterns ............... 295
Table 316 - Datablink Management Mobile 200 API Constants and Communication patterns
................................................................................................................................................ 295
Table 317 - Datablink Management API Error Codes ............................................................ 301
Table 318 - Datablink Management Mobile 200 API Error Codes ......................................... 306
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
1
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
1. Introduction
This document aims to explain what the Datablink Management API is, its components,
architectures, supported products, how to install, sequence diagrams, functions and
structures.
1.1 Components
Below are found the solution components.
1.1.1 Datablink Management API
API to Develop and Integrate Advanced Authentication, Strong
Authentication, and Transaction Signing into Applications.
Datablink Management API is a set of tools and libraries for
application development, containing several functions in different
programming languages (C++, C#, Java), enabling token
management, authentication, and transaction signing.
1.1.2 Datablink Management Mobile 200 API
API to Develop and Integrate Datablink Mobile 200 or Datablink
Mobile 200 Embedded with Datablink Management API.
Datablink Mobile Management API is a set of tools and libraries
for application development, containing several functions in
different programming languages (C++, C#, Java), enabling
Mobile200 management and communication.
Figure 1 - Datablink Mgmt API
Figure 2 - Datablink Mgmt
Mobile 200 API
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
2
1.2 What is Datablink Management API?
Datablink ManagementAPI is a secure authentication engine that solves the issues related
to integration of secure authentication across multiple platforms using authentication
solutions offered by Datablink.
Issues with authentication solutions management.
Managing authentication methods in Internet Banking, eCommerce environments and
across multi-channel applications - Internet, Phone, Mobile, ATMs, etc. - is an ongoing
challenge for banks and large corporations.
The majority of solutions are proprietary, which restricts integration across operating
systems and applications and makes it difficult to standardize user authentication. In many
cases, the way a user authenticates into an application in one environment may be
completely different from other environments, making it confusing and creating different
access security levels for that user.
As a result, malicious users could take advantage of the less protected channels to gain
unauthorized access to other users’ profile and confidential data.
So how do we guarantee the security of the authentication servers, encrypt user data, and
ensure that unauthorized individuals, including internal personnel, cannot gain access to
privileged information? Using strong or advanced authentication, that are provided by
Datablink Management API.
1.3 What is Datablink Management Mobile 200 API
The Datablink Management Mobile200 API is a library that manages the mobile application
and enables the secure communication between the backend server application and the
mobile app (Mobile 200 or application based on Mobile 200 Embedded) using a proprietary
protocol.
The server application must implement at least the functionalities responsible to activate
and synchronize the mobile application to generate one-time passwords (OTPs) and to avoid
differences between the time on server and the mobile app.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
3
1.4 Datablink authenticators
Below are present the Datablink authenticators.
1.4.1 Mobile 50
Datablink Mobile 50 allows for a time-based OTP that can be used in
any application. The OTP can be sent by email or through any other
preferred method. The Mobile 50 solution stands as a convenient,
simple answer for backup needs and eventual users.
1.4.2 Mobile 200
Datablink Mobile 200 is a complete and secure software token
solution for Strong Authentication, Advanced Authentication, and
Transaction Signing for smartphones, allowing mobility with
security.
• Authenticate using challenge-response method by
Push or QRCode.
• Authenticate using a time-based dynamic password
(OTP).
• Sign transactions, making sure they are not tampered
with (e.g., Man-in-the-Middle and Man-in-the-Browser
attacks).
• Re-sync your Mobile 200 internal clock quickly;
without the use of a helpdesk and without changing the
clock on your mobile device.
• Transfer your token in a secure an unattended
manner to another device.
• Available for Apple devices (iPhone, iPad, etc.) and
Android.
Figure 3 - Mobile 50 logo
Figure 4 - Mobile 200 logo
Figure 5- Mobile 200 screens
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
4
1.4.2.1 Mobile 200 activation
To start using the Mobile 200 token, you need to activate it. To initiate the activation
process, just run the application on your mobile phone. The activation process will require
three pieces of information:
Server URL: Indicates the web server where the Datablink Mobile
Management Plugin is running. This URL is also used every time it is
necessary to sync clocks or to migrate the token to another mobile
device. The URL should always start with "https://". Optionally, the
URL information could be stored in the software to be distributed,
thus simplifying the activation.
ID: An 8-digit sequence that identifies the Mobile 200 to be activated.
This identifier is provided by the organization with which you will be
authenticating your device.
Password: A 6-digit sequence that is used only once to activate the
Mobile 200. This one-time password is also provided by the
organization with which you will be authenticating your device.
When you click on "Activate" Mobile 200 will try to connect to the
web server filled in Server URL field. If the web server validation is
successful, the user credentials and token data are loaded into the
mobile device. The next step will be to define a PIN, a password
that will be used to control the token access from the mobile
device. The use of a PIN is optional.
Once activated, Mobile 200 is ready to use on your mobile device,
just like a regular hardware token. Please refer to your Mobile 200
manual for more information about the product.
Figure 6 - Activation screen
Figure 7 - PIN register screen
Figure 8 - Main screen
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
5
1.4.3 Device 200
Datablink Device 200 is an electronic device that allows a user to
perform various forms of advanced authentication including
challenge-response, strong authentication with a time-based
dynamic password, and electronic transaction signing using open
and known algorithms (OATH). This variety of authentication
methods enables integration into existing infrastructures.
Datablink Device 200 uses patented* screen-reading technology to capture transaction data
from virtually any type of screen (CRT monitor, LCD, LED, Plasma, projection, etc.) simply by
pressing a button on the unit which activates a built-in sensor on the back of the device.
*Patents:
Datablink™ U.S. Pat No. 6,466,145
INPI PI 0700657-8
The transaction data is presented in the token's display, so the
user can confirm that all values are correct. After the user scrolls
through the values, a password is generated by the token, the
eSignature, which is calculated using:
Internal 160-bit key that is unique per token
• Time (GMT as a reference)
• Transaction values
Figure 9 - Device 200 logo
Figure 10 - Device 200
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
6
The use of those three factors confirms that:
• Only the person holding the token will be able to finish the transaction
• The dynamic signature must be used immediately, eliminating the possibility of password
interception for future use
• The transaction data, if tampered with, will be detected and invalidated
• There will be no denial of the transaction by the user
Figure 11 - Scroll through signature values
Easy to Use, Secure for the Customer and the Corporation
There are several solutions on the market that use tokens to electronically sign transactions.
However, those solutions require that the user manually re-type all values into the token,
making usage complicated, limited, not at all user-friendly, and susceptible to typing errors.
Additionally, other tokens are typically much larger, since they need to accommodate a
numeric keyboard.
With the Datablink Device 200 token, all the user needs to do is keep the button pressed for
a few seconds, and point the token sensor at a computer screen - or projection, ATM, etc.
After a few seconds, the data is captured and the transaction is presented to the user in the
token display.
With the first button,the user can scroll through the transaction data or advanced
authentication in the token display, until he reaches the eSignature. If the data is correct, all
the user needs to do is type in the numbers shown in the display.
Another button can be used to generate a time-based, dynamic one-time-password (OTP),
for situations where it is necessary to just authenticate the user. For those situations, a
simple touch of the button is enough.
Simple, practical, and secure.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
7
1.4.3.1 Screen Reading technology
The patented* process developed by Datablink consists of reading and capturing the
transaction data from virtually any type of screen (CRT monitor, LCD, LED, Plasma,
projection, etc.).
*Patents:
Datablink™ U.S. Pat No. 6,466,145
INPI PI 0700657-8
This is achieved by activating a special sensor built into the back of token that differentiates
White from black and translates those colors to bits; those bits are shown in an average
frequency of 60hz.
Figure 12 - Internet banking example
Based on the transaction data to be read, the colors will be translated to represent bits 1
and 0. Since this is a ciphered communication protocol using a specific protocol key that is
unique to each token, transaction signing commands and as token management functions
are dynamically generated according to the specific token for each specific transaction.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
8
1.4.3.2 Electronic transaction signature
The electronic transaction signature consists of reading the values involved in a specific
transaction using a patented technology.
When the tokens are programmed, several transaction types can be defined. The way the
token is programmed determines how the data should be read and presented in the token's
display, according to the transaction code that will be read together with its data.
The transaction values, and optionally the internal GMT time, feed into a mathematic
algorithm that generates the electronic transaction signature, represented by a 4–10 digit
number.
It is possible to program the token to define the transaction types, the values to be read,
and the format with which the values are presented on the token display, including use of
formatting for monetary values, time, timesteps, signature sizes, and many other features.
Some examples:
Figure 13 - Inter-bank transactions
Figure 14 - Payment transaction
Figure 15 - Loan transaction
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
9
In addition to signing transaction values, the screen-reading system also enables commands
to be sent to the token.
The following commands are available, but can be disabled in the token during its
programming phase, and will follow the Datablink Device 200 Programming Specs defined
by the corporation:
• INTERNAL CLOCK SYNC: Sends the current GMT time to the token, updating its internal clock.
Since this is a security related command, it is sent only to the specific token it is meant to adjust.
If someone with a different token tries to read this command, it will fail, since only that specific
token is able to decrypt the command.
• SHOW INTERNAL GMT TIME: The internal token time is displayed.
• SHOW SERIAL NUMBER: The token's serial number, which is normally shown on its external label,
is displayed; this can be used if the label is lost or cannot be read.
1.4.3.3 Communication protocol
Datablink developed the communication protocol between the image and the token to
provide fast and secure communication between the screen and the token sensor. It was
released only after an extensive study to ensure the protocol is flexible, compact, and
secure. It is essentially a bit sequence representing exactly what should be presented by the
targeted token.
This protocol has the following features:
• Each frame, or complete cycle of information to be sent to the token, is represented by a '1' and
'0' bit sequence. This string is generated by the Datablink Management API and can be presented
in a manner the company finds most convenient for the user to read.
• Every frame containing data will be encrypted using an encryption key that is unique to the token.
This key is completely different of the internal key used for challengeresponse, OTP, and
eSignature generation. Consequently, a frame that was created with data for a specific token, will
not work for another token. Therefore, this technique guarantees that the data can be read only
by the targeted token, ensuring data security.
For the device to work correctly, it is necessary to follow some basic requirements
• The display must have good contrast between black (absence of light) and white (bright color).
This is important when using the token with a device other than a monitor screen, such as a
handheld device or projector. In the case of regular monitors and TVs, the contrast is usually
more than enough for a perfect reading.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
10
• Frequency per bit to be presented should be set for 60hz, taking into consideration some delays.
Even though the system is able to handle some variations to this setting, using 60hz guarantees
good reading and helps to avoid errors.
• The reading area should have a width of up to 140 pixels, and height of up to 140 pixels, to avoid
flickering effects, and to comply with WCAG - Web Content Accessibility Guidelines (see Blinking
Area - Good Practices). Large areas can be used, especially when it is necessary for the token to
be presented farther from the screen, and therefore minimizing the flickering effect.
Datablink provides the Blinking server and Blinking sample code for the blinking area
presentation.
1.4.3.4 Usage
Datablink recommends using a video generator to create the blinking area and uses the
FFMPEG in its samples. The FFMPEG is an executable software with free distribution, so it is
only necessary to copy it to the required folder and make sure that this file is allowed to run
on the machine.
To show the video on browser it is possible to use a tag available on browsers with HTML 5
support or even downloading and running the video on the user video player. To execute
the videos on web browsers, it is necessary to check for the better option (see the table
below) to encode the video for performance reasons and also making the proper resizing of
the videos in the browser itself.
Browser Video Resolution
Chrome WEBM 1:1 pixel
Firefox OGG 3:3 pixel
Opera WEBM 1:1 pixel
Safari MP4 36:36 pixel
Internet explorer MP4 36:36 pixel
Edge MP4 36:36 pixel
Table 1 – Supported browsers
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
11
1.4.3.5 Blinking area – good practices
The World Wide Web Consortium (W3C, www.w3.org), an international community that
develops guidelines for development and usage of the Web, has previously addressed the
issue of the potential health implications of web technologies with flashing visual content –
specifically animations - which have been found to triggerphotosensitive epileptic seizures.
This issue could eventually affect token protocols which are based on blinking patterns on a
specific frequency should they be found to cause discomfort or seizures with end-users.
The W3C has developed a guide – the Web Content Accessibility Guidelines (WCAG,
http://www.w3.org/TR/UNDERSTANDING-WCAG20/Overview.html) to address the issue of
photosensitive seizures in its current version 2.0.
WCAG Chapter 2.3 deals specifically with seizures and the best practices for the design of
web-based animation to prevent photosensitive seizures. For emphasis, it specifically
highlights a 1997 incident where a TV cartoon broadcast in Japan caused epileptic seizures
in about 500 children who were watching the program.
Regarding the safe use of flashing visual content, we comply with the standards suggested
by WCAG Technique G176: “Keeping the flashing area small enough”
(http://www.w3.org/TR/2012/NOTEWCAG20-TECHS-20120103/G176), which recommends
the maximum size of the blinking area should be restricted to minimize any potential impact
and reduce the chance of generating a photosensitive seizure.
WCAG specifications suggest the blinking area should not be larger than 21,824 square
pixels.
Datablink technology maintains a blinking area of around 20,000 square pixels and is
therefore compliant with WCAG recommendations. The images within this help file, for
example, have a width of 160 pixels, and a height of 120 pixels, which results in an area of
19,200 square pixels.
There is a free, downloadable tool available to test web content and identify any potential
risk of photosensitive epilepsy caused by a specific web site or computer application. This
tool, called Photosensitive Epilepsy Analysis Tool (PEAT), is recommended by W3C, and can
be downloaded at http://trace.wisc.edu/peat/
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
http://trace.wisc.edu/peat/
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
12
1.4.3.6 Technical specifications
Functions:
• Time-based One-Time Password (OTP) generation,
according to the TOTP specification (RFC 6238), from the
Initiative for Open Authentication (OATH) group.
• Challenge-Response and Electronic Transaction Signing,
according to the OATH Challenge-Response Algorithms
(OCRA) specification, from the OATH group.
• Token time adjustment using screen reading protocol.
Screen reading token commands, telling the token to
present in its display the following information:
▪ Serial number
▪ Internal GMT reference time
▪ Optional company name.
• Authentication done through Datablink Management API
or an OATH authentication (standards: TOTP, OCRA,
PSKC).
Display:
• 10 digits with cents separator, and thousands separator.
• Messages that can be customized at the top of the LCD,
for presenting the values to be signed .
BCO: Bank.
AG: Agency.
CTA: Account.
QTY: Quantity.
NUM: Number.
$: Value.
: OTP Password or Electronic Signature.
• Low battery indicator.
• Reading process.
Figure 17 - Device 200 display
Figure 16 - Device 200 back
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
13
Physical Specs:
• Button with customer logo, with cover to protect the
image quality over time
• Minimum lifetime of 3 years when started to be used
• Label with serial number and bar code
• Dimension: 65mm x 30mm x 11mm
• Approximate weight: 17g
Customizations and Available Services:
• Token color
• Button logo
• Display messages/text
• OTP size and Timestep
• eSignature size and Timestep
• Help with manual development
• Handling of customized boxes
• Logistics Token Seeds:
• OATH, PSKC, AES, or 3DES encrypted transportation
• Up to 2 transport keys (1 static split for 2 people, and 1
dynamic)
1.5 Blinking Server
The blinking server exposes an API where it is possible to request the generation of a
blinking video from a specific command.
There are two options for using the Blinking server:
• Blinking Server via NodeJs.
• Blinking Server via Java.
Figure 18 - Device 200 perspective
Figure 19 - Device 200 custom
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
14
Both options runs a service that returns the blinking video and follows the same request
structure.
1.5.1 Blinking Server Requirements
1.5.1.1 Blinking Server Java
Requires Windows OS and Java 8 up to Java 14 (included).
1.5.1.2 Blinking Server NodeJs
Requires Windows OS and Node.Js.
1.5.2 Blinking Server Usage
1.5.2.1 Java file
To use the blinking server Java, follow the following steps:
Step 1 - Make sure the ffmpeg file is in the same directory as the project jar.
Step 2 – Open the prompt / terminal in the directory where the project jar is located.
Step 3 – Run the command: java -jar blinking-server.jar
Step 4 – By default, the project will start at https://127.0.0.1:3000
Figure 20 – Blinking Server Java
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
https://www.java.com/
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
15
When the execution is complete, the application will be available at port 3000 and will need
to be re-executed if you restart the Operational System.
Obs: If you use the blinking server in another application and you are getting a connection
error, open the blinking server's index page on a browser page and authorize the browser
access to the server.
Do not use the project jar in the same directory as another project that also uses configuration
files in the "application.properties" format so that there is no configuration conflict.
1.5.2.2 NodeJs file
To use the blinking server NodeJs, follow the following steps:
Step 1 - Open the prompt / terminal in the root project directory.
Step 2 – Run the command: npm install.
Step 3 – Wait for the project dependencies to be installed.
Step 4 – Run the command: npm start
Step 4 – By default, the project will start at https://127.0.0.1:3001
Figure 21 - Blinking Server Nodejs
When the execution is complete, the application will be available at port 3001 and will need
to be re-executed if you restart the Operational System.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
https://127.0.0.1:3001/
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
16
Obs: If you use the blinking server in another application and you are getting a connection
error, open the blinking server's index page on a browser page and authorize the browser
access to the server.
1.5.3 Blinking Server API
To get a blinking video from the server, both Java and NodeJs server, just use the following
request:
Request Type: POST
Path: {{baseUrl}}/blinking/generate-blinking-video
Body:
{
“blinkingCommand”: “<string>”,
“browser”: “<string>”
}
Response Body:
{
“result”: “<int>”,
“message”: “<string>”,
“blinkingVideo”: “<string>”
}
Table 2 - Blinking Server request function
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
17
Example:
Body:
{
“blinkingCommand”: “1110110001010001000000010011101111111”,
“browser”: “chrome”
}
Response Body:
{
“result”: 0,“message”: “Success”,
“blinkingVideo”: “AAAAAAJGZpc9taa57999sjnsaJJHAKKjkaX900AAAAAA …
JJAkkajklAAAAAAAY”
}
Table 3 - Blinking Server request example
The response, if success, is a Base64 encoded string, that can be converted into a vídeo using,
for example, a Javascript function like:
var myVideoComponent = document.getElementById("my-video-component");
…
myVideoComponent.src = "data:video/mp4;base64," + requestResponse.blinkingVideo;
Table 4 - Blinking Server javascript function example
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
18
To easily check if the server is running, in the browser, access the IP of the machine where
the server is installed with the port (3000 for the Java server and 3001 for the NodeJs
server). If the server is running correctly, the following page will appear:
Figure 22 - Blinking Server running
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
19
2 Architecture
Below are presented the most common architectures using the APIs provided by Datablink
Inc.
2.1 Datablink Management API architecture
Figure 23 - Datablink Management API Architecture
• Centralized database
Responsible to persist the blobs (encrypted string that have the relevant information to
token works) The blob storage, and the read and write procedures are not done by the
API, thus maintaining the actual architecture, and allowing for a maximum integration
with virtually any database.
The blobs are frequently updated, so it is important to keep only one copy for each blob,
which can be accessed concurrency for many servers.
• Datablink Management API
Datablink Management API is a library provided as a .DLL (dynamic linking library), .SO
(shared objects) load module, with capabilities required to take advantage of the full
array of functionalities of Datablink authentication devices.
The Datablink Management API should be installed and used on the same server where
the authentication and signing validations will be processed. This is typically an internal
protected server.
• Login or eSignature front-end interface
Application to be developed by the client. It is in this application that the authentication
and/or signing interface is presented to the end user. Some information to be presented
are generated by Datablink Management API, for example the challenge on an advanced
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
20
authentication or the command to be blinked on screen, in the case of Datablink
Device200.
2.2 Datablink Management Mobile200 API architecture
Figure 24 - Datablink Management Mobile200 API Architecture
• Centralized database
Responsible to persist the blobs (encrypted string that have the relevant information to
token works). The blob storage, and the read and write procedures are not done by the
API, thus maintaining the actual architecture, and allowing for a maximum integration
with virtually any database.
The blobs are frequently updated, so it is important to keep only one copy for each blob,
which can be accessed concurrency for many servers.
• Datablink Management API
Datablink Management API is a library provided as a .DLL (dynamic linking library), .SO
(shared objects) load module, with capabilities required to take advantage of the full
array of functionalities of Datablink authentication devices.
The Datablink Management API should be installed and used on the same server where
the authentication and signing validations will be processed. This is typically an internal
protected server.
• Web Services interface
Application to be developed by the client. This application will be responsible to export
all functions to be consumed by the mobile app and to manage them using the
Datablink Management Mobile200 API exported functions.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
21
3 Installation
Below are presented the requirements and a brief tutorial about how to deploy the APIs.
3.1 Requirements
Datablink Management API is supported by Windows (using .DLL file) and Linux/Unix (using
.SO file) in architectures x86 and x64. The minimum requirements for the hardware are:
• Processor: 1.4Ghz 64-bit processor.
• RAM: 2 Gb.
• Disk Space: 32 GB.
To use the Java wrapper, it is necessary to have Java Runtime (JRE) 1.8 or higher and the jna
library specified on the ".pom" file.
To use the C# wrapper it is necessary to have .NET Core 2.1.
On Windows systems, it is necessary to install the Microsoft Visual C++ 2015-2019
Redistributable Package in the same architecture (x86 and/or x64) of the machine that the
application will run and on Linux/Unix systems it is necessary to have GLIBC version 2.17.0
or higher.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
22
3.2 Files
The Datablink Management API files provided on the Zip file through download contains
the following folders:
\Datablink Blinking
…\Java: project for java solution
…\NodeJs: project for nodejs solution
\Datablink Management API:
…\headers: Header files for C++ development.
…\keys: Demo keys for Datablink sample authenticators.
for respective architectures x86 and x64 have a folder with:
…\...\bin: ".DLL" files for Windows and ".SO" files for Linux.
…\...\wrappers: with wrapper java and your respective ".pom" file and wrapper C#.
…\...\demos: C++ demonstration apps, C# demonstration apps, java demonstration
apps and tools.
\Datablink Management Mobile200 API:
…\headers: Header files for C++ development
for respective architectures x86 and x64 have a folder with:
…\...\bin: ".DLL" files for Windows and ".SO" files for Linux.
…\...\wrappers: with wrapper java and your respective ".pom" file and wrapper C#.
\Datablink_Developer_Tools
Java helper tools
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
23
3.3 Windows deployment
To deploy the APIs in a 64 bits machine, it is necessary to execute the following steps:
It is necessary to copy the extracted files available to the machine where the application
will run, perform the following steps to setup and use the APIs:
The application must run using an administrator account for registering the global
parameters.
3.3.1 For 64 bits aplication
Copy the files listed below to C:\Windows\system32 folder:
…\Datablink Management API\x64\bin\datablinkmgmtapi.dll.
…\ Datablink Mobile Management API\bin\x64\datablinkmobmgmtapi.dll.
The global parameters are registered in a windows registry:
Computador\HKEY_LOCAL_MACHINE\SOFTWARE\Datablink\Management API
3.3.1.1 C# development
It is necessary to use the wrapper in your project as libraries or register on the machine.
…\Datablink Management API\x64\wrapper\C#\datablinkmgmtapics.dll
…\Datablink Mobile Management API\x64\wrapper\C#\datablinkmobmgmtapics.dll
* Wrapper register
3.3.1.2 Java development
It is necessary to use the wrapper in your project as libraries as well as the dependencies.
Note: The dependencies are described in the .pom file.…\Datablink Management API\x64\wrapper\Java\datablinkmgmtapi-6.3.0.java
…\Datablink Management API\x64\wrapper\Java\datablinkmgmtapi-6.3.0.pom
…\Datablink Mobile Management API\x64\wrapper\Java\datablinkmobmgmtapi-6.3.0.java
…\Datablink Mobile Management API\x64\wrapper\Java\datablinkmobmgmtapi-6.3.0.pom
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
24
3.3.2 For 32 bits aplication
Copy the files listed below to C:\Windows\sysWOW64 folder:
…\Datablink Management API\x86\bin\datablinkmgmtapi.dll.
…\ Datablink Mobile Management API\bin\x86\datablinkmobmgmtapi.dll.
The global parameters are registered in a windows registry:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Datablink\Management API
3.3.2.1 C# development
It is necessary to use the wrapper in your project as libraries or register on the machine.
…\Datablink Management API\x86\wrapper\C#\datablinkmgmtapics.dll
…\Datablink Mobile Management API\x86\wrapper\C#\datablinkmobmgmtapics.dll
* Wrapper register
3.3.2.2 Java development
It is necessary to use the wrapper in your project as libraries as well as the dependencies.
Note: The dependencies are described in the .pom file.
…\Datablink Management API\x86\wrapper\Java\datablinkmgmtapi-6.3.0.java
…\Datablink Management API\x86\wrapper\Java\datablinkmgmtapi-6.3.0.pom
…\Datablink Mobile Management API\x86\wrapper\Java\datablinkmobmgmtapi-6.3.0.java
…\Datablink Mobile Management API\x86\wrapper\Java\datablinkmobmgmtapi-6.3.0.pom
3.3.3 Using a 32 bits machine
32-bit binaries are no longer distributed. If you need to use 32-bit version, contact the
support team.
3.3.4 Wrapper register
Register the .NET wrapper using the RegAsm.exe application.
Note: The register must be done using an administrator account to run the command.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
25
3.3.4.1 Using 64 bits machines
3.3.4.1.1 For 64 bits aplication
The regasm.exe application usually is located on folder:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Command:
regasm c:\windows\system32\datablinkmgmtapics.dll /tlb
regasm c:\windows\system32\datablinkmobmgmtapics.dll /tlb
3.3.4.1.2 For 32 bits aplication
The regasm.exe application usually is located on folder:
C:\Windows\Microsoft.NET\Framework\v4.0.30319
Command:
regasm c:\windows\sysWOW64\datablinkmgmtapics.dll /tlb
regasm c:\windows\sysWOW64\datablinkmobmgmtapics.dll /tlb
3.3.4.2 Using 32 bits machines
32-bit binaries are no longer distributed. If you need to use 32-bit version, contact
the support team.
3.4 Linux deployment
To deploy the APIs in a 64 bit machine, it is necessary to execute the following steps:
The global parameters are registered in a folder, so, create a datablink folder named
“dmapi” under /etc, where the Datablink Management API global parameters files will be
stored (mobile200.conf, mobile50.conf, and device200.conf). To create this directory,
execute, as root, “mkdir /etc/dmapi”. After creation, make sure this directory has
read/write permissions to the user that will use the SDK.
Now, copy the SDK files to an appropriate library directory. Here we will use the directory
/usr/local/lib as a suggestion, but, if you prefer, you can use another directory. Just adapt
the following instructions accordingly.
All instructions must be executed as root:
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
26
• Copy the files listed below to /usr/local/lib folder:
…/Datablink Management API/x64/bin/libdatablinkmgmtapi.so.6.3.1.
…/Datablink Mobile Management API/bin/x64/libdatablinkmobmgmtapi.so.6.3.1.
• After copy, make sure the file permissions are right. File permissions must be 755 (rwxr-xr-x)
• Create the symbolic links, as showed below:
cd /usr/local/lib
ln -s libdatablinkmgmtapi.so.6.3.1 libdatablinkmgmtapi.so.6
ln -s libdatablinkmgmtapi.so.6 libdatablinkmgmtapi.so
ln -s libdatablinkmobmgmtapi.so.6.3.1 libdatablinkmobmgmtapi.so.6
ln -s libdatablinkmobmgmtapi.so.6 libdatablinkmobmgmtapi.so
At that point, the command “ls -l /usr/local/lib” should show something similar to this:
Figure 25 – Symbolic links created
Next step is to configure the dynamic linker run-time bindings, using ldconfig. This step is
necessary if the directory /usr/local/lib is not yet included in ldconfig.
• Create a file named “datablink.conf” under directory /etc/ld.so.conf.d/
• The content of this file should be the text: /usr/local/lib
• If you prefer doing it in a one shot command, you can type:
sudo sh -c 'echo /usr/local/lib >/etc/ld.so.conf.d/datablink.conf'
• Force ldconfig to re-read the configuration:
sudo ldconfig
To verify if ldconfig worked properly use the command: ldconfig -v | grep datablink
As result, you should see, among other things, the following lines:
Figure 26 - Verify ldconfig
Now we have finished the library installation.
3.4.1 Java development
If you are developing in Java, it is necessary to use the java wrapper in your project as library
(.jar) as well as the dependencies.
Note: The dependencies are described in the .pom file.
…/Datablink Management API/x64/wrapper/Java/datablinkmgmtapi-6.3.0.jar
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
27
…/Datablink Management API/x64/wrapper/Java/datablinkmgmtapi-6.3.0.pom
…/Datablink Mobile Management API/x64/wrapper/Java/datablinkmobmgmtapi-6.3.0.jar
…/Datablink Mobile Management API/x64/wrapper/Java/datablinkmobmgmtapi-6.3.0.pom
3.4.2 32 bits machines
Note: 32-bit binaries are no longer distributed. If you need to use 32-bit version, contact
the support team.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
28
4 Flows
In this section of the document it is possible to find the implementation flows of the APIs.
4.1 Datablink Management API
Below are presented the life cycle for an authentication blob and the flows related to token
management and authentication.
4.1.1 State diagram for an authentication blob
Figure 27 - State diagram for an authentication blob
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
29
4.1.2 Tokens keys files
1. System administrator select the key file (file.brt) to be decrypted and fills the
transport key (file.key) sent by Datablink.
1.1. Application server loads the key file.
1.2. As long as there are lines in the file the server stays in loop.
1.2.1. Server uses Datablink Management API and decrypt one line per time using
the function DatablinkDecryptKeyFile.
1.2.2. The API returns the authentication blob inactive to the server
1.2.3. Server checks and updates/inserts the received data in database.
1.3. A message about the process is showed to the system administrator.
Figure 28 - Decrypt Key Files
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
30
4.1.3 Tokens management
Below are presented all flowsrelated with the token management.
4.1.3.1 Activate/Deactivate
1. Server loads the token authentication blob from database
2. Server calls the function DatablinkActivateToken provided by Datablink
Management API
2.1. If you want to activate the token use the boolean flag with true, otherwise,
if you want to deactivate the token use the boolean flag with false.
3. Get the authentication blob updated
4. Server checks and updates the received data in database.
Figure 29 - Activates / Deactivates an authentication blob
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
31
4.1.3.2 Block/Unblock
1. Server loads the token authentication blob from database
2. Server calls the function DatablinkActivateToken provided by Datablink
Management API
2.1. If you want to block the token use the boolean flag with true, otherwise, if
you want to unblock the token use the boolean flag with false.
3. Get the authentication blob updated
4. Server checks and updates the received data in database.
Figure 30 - Block / Unblock an authentication blob
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
32
4.1.3.3 Token expiration
1. First the global parameters regarding the expiry of the token must be set by
administrator.
2. Server application then calls the specific function for each kind of token (ex:
DatablinkWriteParmDevice200 for Device200 tokens) to write the parameters.
3. Server loads the token authentication blob from database.
4. System administrator fills the expiration date or the quantity of months for the
token to expire.
5. Server application calls the function DatablinkTokenExpiration provided by
Datablink Management API
6. Server application updates the received data in database
7. Server application shows a message about the success or failure on process.
Figure 31 - Token expiration
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
33
4.1.3.4 Generate management blinking command
1. Server loads the token authentication blob from database.
2. Server application calls the function DatablinkGenMgmtCmd and get the byte
sequence to be blink.
3. Server application presents to the user the command in the blinking area using the
communication protocol.
Figure 32 - Generates management command
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
34
4.1.3.5 Generate mobile 200 management blob
1. Server loads the authentication blob from database
2. Server application calls the function DatablinkGenMobile200MgmtAPIBlob and
get the mobile management blob generated
3. Server checks and updates/inserts the received data in database.
Figure 33 - Generate Mobile 200 management blob
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
35
4.1.4 Management global parameters
Below are presented the flows related with the functions responsible for managing the
global parameters for the authenticators provided by Datablink.
4.1.4.1 Read global parameters
Here it is possible to see a generic flow about read global parameters from registry.
Figure 34 - Reading the global parameters
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
36
4.1.4.2 Write global parameters
Below is present a generic flow about writing global parameters in registry.
Figure 35 - Writing global parameters
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
37
4.1.5 Authentication and signing
Below are presented all flows related with the token management.
4.1.5.1 Check OTP
1. User fills the OTP displayed by the token and send it to the server.
2. Application server loads the token authentication blob from database.
3. Application server calls the function DatablinkCheckOTP provided by Datablink
Management API and get the response for the authentication.
4. Application server updates the authentication blob in database.
5. A message about the process is showed to the user
Figure 36 - Checking OTP
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
38
4.1.5.2 Define mobile DNA
1. Application server receives the mobile DNA during the token mobile activation.
2. Application server loads the token authentication blob from database.
3. Application server calls the function DatablinkDefineMobileDNA provided by
Datablink Management API and get the response authentication blob updated.
4. Application server updates the authentication blob in database.
Figure 37 - Defining mobile DNA
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
39
4.1.5.3 Check signature
1. Application server loads the token authentication blob from database.
2. Application server calls the function DatablinkGenSigningCmd providing the
signature data and get the bytes sequence to be blink.
3. Application server create the blinking following the communication protocol and
presents it to the user.
4. User reads the blinking using Device 200.
5. User sends the signature code to the server.
6. Application server calls the function DatablinkCheckSignature and get the
response of the signature.
7. Application server updates the authentication blob in database.
8. Message about the process is showed to the user
Figure 38 - Signature process
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
40
4.1.5.4 Check mobile signature
The mobile signature can be done using QR code or push, below is explained step-by-step
each process
4.1.5.4.1 Signature by QR code
1. Application server loads the token mobile management blob from database.
1.1. Application server uses Datablink Management Mobile 200 API and
generates a signature QR code command.
1.2. Application server transform the string received to a QR code and
presents it to the user.
1.3. User reads the QR code using the mobile app and then provided the
signature code to the server.
1.4. Application server loads the token authentication blob from database.
1.5. Application server uses the function DatablinkCheckMobileSignature
provided by Datablink Management API and checks the signature.
1.6. Application server updates the authentication blob in database.
1.7. A message about the process is showed to the user
4.1.5.4.2 Signature by Push
1. Application server loads the token mobile management blob from database.
1.1. Application server uses Datablink Management Mobile 200 API and
generatesa signature push command.
1.2. Application server loads the token mobile push ID from database.
1.3. Application server send a push request with the data to be forwarded
to the user to the push server (Apple or Google).
1.4. Push server sends the push the mobile app.
1.5. Mobile app presents the signature request to the user.
1.6. User accept or reject the transaction.
1.7. Mobile app sends the signature data to the application server.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
41
1.8. Application server loads the token authentication blob from
database.
1.9. Application server uses the function DatablinkCheckMobileSignature
provided by Datablink Management API and checks the signature.
1.10. Application server updates the authentication blob in database.
1.11. A message about the process is shown to the user
Figure 39 - Mobile signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
42
4.1.5.5 Generate OTP
1. Application server loads the token authentication blob from database.
2. Application server uses the function DatablinkGenOTP provided by Datablink
Management API to generate an OTP.
3. Server updates the authentication blob in database.
4. Server sends to the user the OTP generated
Figure 40 - Generating OTP
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
43
4.2 Datablink Management Mobile 200 API
Below are presented the life cycle for a mobile 200 management blob and the flows related
to integration between the mobile app and the APIs.
4.2.1 State diagram for a Mobile 200 management blob
Figure 41 - State diagram for a Mobile 200 management blob
4.2.2 Activation
Below are presented generic flows for all the ways to activate a mobile token application.
4.2.2.1 Activation using credentials
1. System administrator associate a mobile token to the user in the server application
2. Server application loads the authentication blob related with the mobile token associated.
3. Server application activates the authentication blob using the Datablink Management API
and gets the authentication blob activated.
4. Server application activates the authentication blob using the Datablink Management API
and gets the authentication blob activated.
5. Server application generates a mobile management blob using the Datablink Management
API and gets the mobile management blob inactive.
6. Server application calls the function DatablinkActivate provided by Datablink Management
Mobile 200 API and gets mobile blob activated.
7. Server application generates the activation credentials.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
44
8. Server application updates the authentication and mobile blobs in database.
9. System administrator sees the activation credentials in server application and informs it to
the user.
10. User types the activation credentials on mobile app.
11. Mobile app creates the request communication package to first activation step and sends it
to the server application.
12. Server application calls the function DatablinkExtractDataCommunication provided by
Datablink Management Mobile 200 API and gets the communication data extracted.
13. Server application validates the data received (activation credentials, etc).
14. Server application loads the mobile management blob and the authentication blob related
with the activation credentials received.
15. Server application defines the DNA received in the authentication blob using the Datablink
Management API and gets the authentication blob updated.
16. Server application calls the function DatablinkActivateMobileStep1 provided by Datablink
Management Mobile 200 API and gets the communication response and the mobile
management blob updated.
17. Server application updates the authentication and mobile blobs in database.
18. Server application forwards the communication response to mobile app.
19. Mobile app receives the communication response, process it, updates the blob, create the
activation step 2 request package, and sends it to server application.
20. Server application calls the function DatablinkExtractDataCommunication provided by
Datablink Management Mobile 200 API and gets the communication data extracted.
21. Server application loads the mobile management blob and the authentication blob related
with the serial number received.
22. Server application opens the authentication window for the specific mobile token using the
Datablink Management API and gets the authentication blob updated.
23. Server application validates the OTP received using the Datablink Management API.
24. If the authentication was realized with success, so the server application calls the function
DatablinkActivateMobileStep2 provided by Datablink Management Mobile 200 API and gets
the mobile management blob activated.
25. Server application updates the mobile and authentication blobs.
26. If the authentication fails, so the application server calls the function
DatablinkCreateCommunicationPackMsg provided by Datablink Management Mobile 200
API using a custom message and created a communication package with the message to be
sent to mobile app.
27. Application server sends the communication response package to the mobile app.
28. Mobile app receives the communication response, process it, and update the blob.
29. Mobile app shows to the user a message about the success or failure on process.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
45
Figure 42 - Activating mobile token typing credentials
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
46
4.2.2.2 Activation using QR code
1. System administrator associate a mobile token to the user in the server application
2. Server application loads the authentication blob related with the mobile token
associated.
3. Server application activates the authentication blob using the Datablink Management
API and gets the authentication blob activated.
4. Server application generates a mobile management blob using the Datablink
Management API and gets the mobile management blob inactive.
5. Server application calls the function DatablinkActivate provided by Datablink
Management Mobile 200 API and gets mobile blob activated.
6. Server application generates the activation credentials.
7. Server application updates the authentication and mobile blobs in database.
8. System administrator sees the activation credentials in server application.
9. If the user uses Mobile 200 app as mobile token app, the server application should call
the function DatablinkGenActivationCredentialsQRCodeDefault provided by Datablink
Management Mobile 200 API, otherwise if the client uses a mobile app developed for
him the server application should calls the function
DatablinkGenActivationCredentialsQRCode also provided by Datablink Management
Mobile 200 API.
10. Server application uses the string encrypted received on previous step and encodes it
into a QR code image.
11. QR Code generated is sentto User.
12. User reads the QR code using the mobile app.
13. Mobile app creates the request communication package to first activation step
14. And sends it to the server application.
15. Server application calls the function DatablinkExtractDataCommunication provided by
Datablink Management Mobile 200 API and gets the communication data extracted.
16. Server application validates the data received (activation credentials, etc).
17. Server application loads the mobile management blob and the authentication blob
related with the activation credentials received.
18. Server application defines the DNA received in the authentication blob using the
Datablink Management API and gets the authentication blob updated.
19. Server application calls the function DatablinkActivateMobileStep1 provided by
Datablink Management Mobile 200 API and gets the communication response and the
mobile management blob updated.
20. Server application updates the authentication and mobile blobs in database.
21. Server application forwards the communication response to mobile app.
22. Mobile app receives the communication response, process it, updates the blob, create
the activation step 2 request package, and sends it to server application.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
47
23. Mobile App sends the second activation package.
24. Server application calls the function DatablinkExtractDataCommunication provided by
Datablink Management Mobile 200 API and gets the communication data extracted.
25. Server application loads the mobile management blob and the authentication blob
related with the serial number received.
26. Server application opens the authentication window for the specific mobile token using
the Datablink Management API and gets the authentication blob updated.
27. Server application validates the OTP received using the Datablink Management API.
28. If the authentication was realized with success, so the server application calls the
function DatablinkActivateMobileStep2 provided by Datablink Management Mobile 200
API and gets the mobile management blob activated.
29. If the authentication fails, so the application server calls the function
DatablinkCreateCommunicationPackMsg provided by Datablink Management Mobile
200 API using a custom message and created a communication package with the
message to be sent to mobile app.
30. Application server sends the communication response package to the mobile app.
31. Mobile app receives the communication response, process it and update the blob.
32. Mobile app shows to the user a message about the success or failure on process.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
48
Figure 43 - Activating mobile token using QR code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
49
4.2.3 Block mobile token
Below are presented generic flows to all ways to block a mobile token application
4.2.3.1 Block mobile token
1. System administrator blocks the mobile token in server application
2. Server application loads the mobile management and authentication blobs.
3. Server application block the authentication blob using the Datablink Management API and
gets the authentication blob blocked.
4. Server application calls the function DatablinkBlock provided by Datablink Management
Mobile 200 API and gets the mobile blob pre-blocked.
5. Server application updates the mobile and authentication blobs in database.
6. Server application shows a message about the success or failure during the process.
Note: The mobile app will be blocked when it be synchronized
4.2.3.2 Block mobile token by PIN errors
1. User types a wrong PIN more times than allowed.
2. Mobile app creates a block by PIN package
Figure 44 - Blocking mobile token
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
50
3. And sends it to server application.
4. Server application calls the function DatablinkExtractDataCommunication provided by
Datablink Management Mobile 200 API and gets the communication data extracted.
5. Server application loads the mobile management and authentication blobs.
6. Server application calls the function DatablinkBlockByPIN provided by Datablink
Management Mobile 200 API and gets the mobile blob pre-blocked.
7. Server application calls the function DatablinkBlockMobile provided by Datablink
Management Mobile 200 API and gets the mobile blob blocked and the communication
response package.
8. Server application block the authentication blob using the Datablink Management API and
gets the authentication blob blocked.
9. Server application updates the mobile blob, authentication blob and stores the unblock
password in database.
10. Mobile app receives the communication response package, process it and update the blob.
11. Mobile app is blocked and shows a message to the user
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
51
Figure 45 - Blocking mobile token by PIN errors
4.2.4 Unblock mobile token
1. User requests the unblock password to the system administrator.
2. System administrator sees the unblock credentials.
3. And informs the unblock password to the User.
4. User types the unblock password on mobile app.
5. Mobile app creates the request communication package to unblock the token.
6. And sends it to the server application.
7. Server application calls the function DatablinkExtractDataCommunication provided by
Datablink Management Mobile 200 API and gets the communication data extracted.
8. Server application validates the data received (serial number, unblock password, OTP, etc).
9. Server application loads the mobile management blob and the authentication blob related
with the serial number received.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
52
10. Server application unblock the authentication blob using the Datablink Management API and
gets the authentication blob unblocked.
11. Server application validates the OTP received using the Datablink Management API.
12. If the authentication was realized with success:
Server application calls the function DatablinkBlock provided by Datablink Management
Mobile 200 API and gets the mobile management blob pre-unblocked.
13. Server application calls the function DatablinkUnblockMobile provided by Datablink
Management Mobile 200 API and gets the communication response package and the mobile
management blob unblocked.
14. Server application updates the mobile and authentication blobs.
15. If the authentication fails:
Application server calls the function DatablinkCreateCommunicationPackMsg provided by
Datablink Management Mobile 200 API using a custom message and created a
communication package with the message to be sent to mobile app.
16. Application server sends the communication response package to the mobile app.
17. Mobile app receives the communication response, process it and update the blob.
18. Mobile app shows to the user a message about the success or failure on process
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablinkBrazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
53
Figure 46 - Unblocking mobile token
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
54
4.2.5 Synchronize mobile token
Below are presented generic flows to all ways to synchronize a mobile token application.
4.2.5.1 Synchronize mobile token
1. User uses the sync function on mobile token application.
2. Mobile app creates a sync request package.
3. And sends it to the server application.
4. Server application calls the function DatablinkExtractDataCommunication provided by
HDatablink Management Mobile 200 API and gets the communication data extracted.
5. Server application loads the mobile management blob using the serial number received in
the communication package.
6. Server application calls the function DatablinkSyncMobile provided by Datablink
Management Mobile 200 API and gets the mobile blob updated and the communication
response package.
7. Application server forwards the response package to the mobile app
8. Mobile app received the response package, process it, updates the blob and presents to the
user message about the success or failure on process
Figure 47 - Synchronizing mobile token
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
55
4.2.5.2 Synchronize mobile token by time
1. Mobile app creates a sync by time request package and sends it to the server application.
2. Server application calls the function DatablinkExtractDataCommunication provided by
Datablink Management Mobile 200 API and gets the communication data extracted.
3. Server application loads the mobile management blob using the serial number received in
the communication package.
4. Server application calls the function DatablinkSyncMobile provided by Datablink
Management Mobile 200 API and gets the mobile blob updated and the communication
response package.
5. Application server forwards the response package to the mobile app
6. Mobile app received the response package, process it, updates the blob and presents to the
user message about the success or failure on process.
Notes:
1. This function differs of the DatablinkSyncMobile function because it does not update the
mobile blob on server side.
2. When this function is implemented it is common to use it automatically in the mobile
application, otherwise it will be possible to synchronize the mobile token without updating the
mobile application status. An example case is to implement this function whenever the mobile
application is initialized.
3. Is only necessary to extract the communication package if the server application implements
some logs for this process, otherwise this step can be ignored.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
56
Figure 48 - Synchronizing mobile token by time
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
57
4.2.6 Read mobile token information
1. System administrator selects the mobile token to see the mobile blob information.
2. Server application loads the mobile management blob selected.
3. Server application calls the function DatablinkReadInfo provided by Datablink Management
Mobile 200 API and gets the mobile blob information.
4. Application server presents to the system administrator the information loaded from mobile
blob.
Figure 49 - Reading mobile blob information
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
58
4.2.7 Migrate mobile token
1. User uses the function to migrate of the mobile app.
2. Mobile app creates the request communication package to migrate the token.
3. Sends it to the server application.
4. Server application calls the function DatablinkExtractDataCommunication provided by
Datablink Management Mobile 200 API and gets the communication data extracted.
5. Server application validates the data received (serial number, migration password, OTP, etc).
6. Server application loads the mobile management blob and the authentication blob related
with the serial number received.
7. Server application validates the OTP received using the Datablink Management API.
8. If the authentication was realized with success:
9. Server application calls the function DatablinkMigrate provided by Datablink Management
Mobile 200 API and gets the mobile management blob pre-migrated.
10. Server application calls the function DatablinkMigrateMobile provided by Datablink
Management Mobile 200 API and gets the communication response package and the mobile
management blob migrated.
11. Server application updates the mobile and authentication blobs.
12. If the authentication fails:
13. Application server calls the function DatablinkCreateCommunicationPackMsg provided by
Datablink Management Mobile 200 API using a custom message and created a communication
package with the message to be sent to mobile app.
14. Application server sends the communication response package to the mobile app.
15. Mobile app receives the communication response, process it and update the blob.
16. Mobile app shows to the user a message about the success or failure on process
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
59
Figure 50 - Migrate mobile token
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
60
4.2.8 Create transactions
Below are presented generic flows about how to create transactions using QR code or push.
4.2.8.1 Create transactions using Push
1. User requests a specific transaction (authorization, challenge response or signature) to the
server application.
2. Server application loads the mobile management blob related with the user from database.
3. Server application calls the function DatablinkGenerateSignaturePushCommand provided by
Datablink Management Mobile 200 API and gets an encrypted string that must be forward to
the mobile app as a push request or
4. Server application calls the function DatablinkGenerateAuthorizationPushCommand
provided by Datablink Management Mobile 200 API and gets an encrypted string that must
be forward to the mobile app as a push request or
5. Server application calls the function DatablinkGenerateChalleneResponsePushCommand
provided by Datablink Management Mobile 200 API and gets an encrypted string that must
be forward to the mobile app as a push request.
6. Application server loads the mobile push identifier from database.
7. Application server sends to the push server (Apple or Google) the data to be forwarded to
the mobile app as a push request.
7.1 Push server sends the push request to the mobile app.
8. Mobile app receives the push request, process it and presents the transaction data to the
user accepts or declines the transaction.
9. Mobile app presents the transaction request to the User
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338support@datablink.com
www.watchguard.com/wgrd-datablink
61
Figure 51 - Creating transaction using Push
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
62
4.2.8.2 Create transactions using QR code
1. User requests a specific transaction (authorization, challenge response or signature) to the
server application.
2. Server application loads the mobile management blob related with the user from database.
3. Server application calls the function DatablinkGenerateSignatureQRCodeCommand and gets
an encrypted string that must be encoded into a QR code image, or
4. Server application calls the function DatablinkGenerateAuthorizationQRCodeCommand and
gets an encrypted string that must be encoded into a QR code image, or
5. Server application calls the function DatablinkGenerateResponseQRCodeCommand and gets
an encrypted string that must be encoded into a QR code image.
6. Application server encodes the string received into a QR code image.
7. Application server shows the QR code image to the user
Figure 52 - Creating transaction using QR code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
63
4.2.9 Change mobile token configuration
1. Mobile app creates a generic communication package requesting the new configuration.
2. Mobile app sends the communication package to the server application.
3. Server application calls the function DatablinkExtractDataCommunication provided by
Datablink Management Mobile 200 API and gets the data sent.
4. Server application loads the mobile management blob from database.
5. Server application calls the function DatablinkCreateDataConfig provided by Datablink
Management Mobile 200 API and gets a communication package with the new configuration
and the mobile blob updated.
6. Application server updates the mobile blob in database.
7. Application server sends the communication package to mobile app.
8. Mobile app receives the communication package with the new configuration, process it and
store the blob updated.
Figure 53 - Changing mobile token configuration
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
64
5 Functions
Below are presented all functions exported by Datablink APIs with their objectives,
parameters, returns and example codes.
5.1 Datablink Management API
Datablink Management API functions
5.1.1 Key files
The following function is related with the operations using the key files sent by Datablink Inc
5.1.1.1 DatablinkDecrytpKeyFile
The DatablinkDecryptKeyFile function is the function responsible to import the tokens Keys
and to transform the input data to blobs that should be persisted in a specific database,
which is created by the client following his necessity.
The program that calls this function should read the input key file containing the token’s
serial number line-by-line, and the authentication blob should be encrypted with one or
two Transport Keys.
Following is an example of a key file line
Figure 54 - Key file line
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
65
Signature:
C++ unsigned int DatablinkDecryptKeyFile(char* iSerial, char* iFileBlob, char*
iTransportKey, char* iAdTransportKey, char* oTokenModel, char* oByteBlob,
int* oSize);
Java public static int DatablinkDecryptKeyFile(String iSerial, String
iFileBlob, String iTransportKey, String iAdTransportKey, TokenModel
oTokenModel, AuthenticationBlob oAuthBlob);
C# public static int DatablinkDecryptKeyFile(string iSerial, string iFileBlob,
string iTransportKey, string iAdTransportKey, TokenModel oTokenModel,
AuthenticationBlob oAuthBlob);
Table 5 - DatablinkDecryptKeyFile Signature
Parameter(s):
• iSerial (i): token's serial number, read on the key file.
• iFileBlob (i): blob read from the key file, excluding the serial number.
• iTransportKey (i): transport key used to decrypt the key file, represented by a
hexadecimal 32-character string.
• iAdTransportKey (i): additional transport key. It is optional, only used when the
customer demands 2 keys to decrypt the file.
• oTokenModel (o): parameter where the token model will be returned. If correctly
identified, will have one of the following values:
Token model Code Status
DATABLINK_CARD100_CARD_ENVELOPE 1 Deprecated
TOKEN_DATABLINK_CARD100 2 Deprecated
TOKEN_DATABLINK_MOBILE200 3
TOKEN_DATABLINK_DEVICE100 4
TOKEN_DATABLINK_CARD200 5 Deprecated
TOKEN_DATABLINK_DESK110 6 Deprecated
TOKEN_DATABLINK_MOBILE100 7 Deprecated
TOKEN_DATABLINK_MOBILE50 8
TOKEN_DATABLINK_DEVICE200 9
TOKEN_DATABLINK_MOBILE110 10 Deprecated
Table 6 - Token models
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
66
• oBlob (o): token's blob in Base64 format string, ready to be stored in the database.
• oSize (o): size of the blob that was generated. It is 128 characters for Card 100 cards
and envelopes, and 236 characters for Mobile 200 and Device 200 tokens.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
char* firstLineKeyFile =
"BRND00000064AAkAADTRNeANQIjcQ5ofScc8Ynapg1kjuaRgQ7yhc/28MmLjbHZR4vtm3BmlYl4p12AgRmg0
5JstItMf6HCWuUfPb+onEBHK0I5uZs84ZePRGeLoQk2ar0zDyZfaj6Px6z20eA1JWf7o4LUqAsWFYJWHs79BI
Se6";
char* transpKey1 = "11111111111111111111111111111111";
char* transpKey2 = "";
char serialNumber[13] = { 0
}; int tokenModel = 0;
int32_t authBlobSize = TOKEN_BLOB_SIZE;
char authBlob[TOKEN_BLOB_SIZE + 1] = { 0 };
strncpy(serialNumber, firstLineKeyFile, 12);
uint32_t result = DatablinkDecryptKeyFile(serialNumber, &firstLineKeyFile[12],
transpKey1, transpKey2, tokenModel, authBlob, &authBlobSize);
if (result != SUCCESS)
{
int32_t messageSize =
256;
char* message = (char*)malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
printf("\n Blob generated = %s", authBlob);
printf("\n Blob Size = %d", authBlobSize);
printf("\n Token model = %d", tokenModel);
printf("\n Key File Decrypetd!");
Table 7 - DatablinkDecryptKeyFile C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
67
Java
String firstLineKeyFile =
"BRND00000064AAkAADTRNeANQIjcQ5ofScc8Ynapg1kjuaRgQ7yhc/28MmLjbHZR4vtm3BmlY
l4p12AgRmg05JstItMf6HCWuUfPb+onEBHK0I5uZs84ZePRGeLoQk2ar0zDyZfaj6Px6z20eA1
JWf7o4LUqAsWFYJWHs79BISe6";
String transpKey1 = "11111111111111111111111111111111";
String transpKey2 = "";
String serialNumber = firstLineKeyFile.substring(0, 12);
TokenModel tokenModel = new TokenModel();
DATABLINK_BLOB authBlob = new DATABLINK_BLOB();
int result = DatablinkMgmtAPI.DatablinkDecryptKeyFile(serialNumber,
firstLineKeyFile.substring(12), transpKey1, transpKey2, tokenModel,
authBlob);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
System.out.println("Blob generated = " + authBlob.getBlob());
System.out.println("Token model = " + tokenModel.getModel());
System.out.println("Key File Decrypetd!");
}
Table 8 - DatablinkDecryptKeyFile Java Sample Code
C#
String firstLineKeyFile =
"BRND00000064AAkAADTRNeANQIjcQ5ofScc8Ynapg1kjuaRgQ7yhc/28MmLjbHZR4vtm3BmlY
l4p12AgRmg05JstItMf6HCWuUfPb+onEBHK0I5uZs84ZePRGeLoQk2ar0zDyZfaj6Px6z20eA1
JWf7o4LUqAsWFYJWHs79BISe6";
String transpKey1 = "11111111111111111111111111111111";
String transpKey2 = "";
String serialNumber = firstLineKeyFile.Substring(0, 12);
TokenModel tokenModel = new TokenModel();
DATABLINK_BLOB authBlob = new DATABLINK_BLOB();
int result = DatablinkMgmtAPI.DatablinkDecryptKeyFile(serialNumber,
firstLineKeyFile.Substring(12), transpKey1, transpKey2, tokenModel,
authBlob);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob generated = " + authBlob.Blob);
Console.WriteLine("Token model = " + tokenModel.Model);
Console.WriteLine("Key File Decrypetd!");
}
Table 9 - DatablinkDecryptKeyFile C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
68
5.1.2 Tokens management
In this section are all functions related with tokens management
5.1.2.1 DatablinkActivateToken
The DatablinkActivateToken function is used to activate and deactivate a token. By default,
when a blob is first created its status is "inactive".
The activate/deactivate token causes also that all of the blob internal dynamic information,
such as challenges made, dates, error, time drift, etc., to be erased
Signature:
C++ unsigned int DatablinkActivateToken(char* ioAuthBlob, bool iActivate);
Java public static int DatablinkActivateToken(AuthenticationBlob
ioAuthBlob, boolean iActivate);
C# public static int DatablinkActivateToken(AuthenticationBlob ioAuthBlob, bool
iActivate);
Table 10 - DatablinkActivateToken Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be activated/deactivated. After
calling this function, its contents are changed and the blob should be stored back
into the database.
• iActivate (i): If "true", activates the token. If "false", deactivates.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
69
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
bool activate = true;
strncpy_s(authBlob,
"J1cSADJH959YIYWdhBSHve9mf56d8+iZ9SR+vtWHTqr+ijtkqxTZd9Y3ZgPrZDuSJRsx27nfw
sP4qWlK/i0xCEH2EuL4eKTQ/m8TtGgQiyogOnUuSJ82cwMLKluxf5Gw0qKUlHSlIB07DXD152f
q+vTT7Z1SV0T5cT5eSTsCt0CjhxKgEkv1TR6e7IITTofLD+9BnM1wXtoomPkJaUYxTiwW0eEzw
2pdji2X1bTzV1QB", blobSize);
uint32_t result = DatablinkActivateToken(authBlob, activate);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
{
printf("\n Blob updated = %s", authBlob);
printf("\n Token Activated!");
}
Table 11 - DatablinkActivateToken C++ Sample Code
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"J1cSADJH959YIYWdhBSHve9mf56d8+iZ9SR+vtWHTqr+ijtkqxTZd9Y3ZgPrZDuSJRsx27nfw
sP4qWlK/i0xCEH2EuL4eKTQ/m8TtGgQiyogOnUuSJ82cwMLKluxf5Gw0qKUlHSlIB07DXD152f
q+vTT7Z1SV0T5cT5eSTsCt0CjhxKgEkv1TR6e7IITTofLD+9BnM1wXtoomPkJaUYxTiwW0eEzw
2pdji2X1bTzV1QB");
boolean activate = true;
int result = DatablinkMgmtAPI.DatablinkActivateToken(authBlob, activate);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Token Activated!");
}
Table 12 - DatablinkActivateToken Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
70
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("J1cSADJH959YIYWdhBSHve9mf56d8+iZ9SR+vtWHTqr+ijtkqxTZd9Y3Zg
PrZDuSJRsx27nfwsP4qWlK/i0xCEH2EuL4eKTQ/m8TtGgQiyogOnUuSJ82cwMLKluxf5Gw0qKU
lHSlIB07DXD152fq+vTT7Z1SV0T5cT5eSTsCt0CjhxKgEkv1TR6e7IITTofLD+9BnM1wXtoomP
kJaUYxTiwW0eEzw2pdji2X1bTzV1QB");
bool activate = true;
int result = DatablinkMgmtAPI.DatablinkActivateToken(authBlob, activate);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Token Activated!");
}
Table 13 - DatablinkActivateToken C# Sample Code
5.1.2.2 DatablinkBlockToken
The DatablinkBlockToken function is used to manually block or unblock a token. The blob
will contain information that the token is blocked and the server will not accept
authentication for it. Nothing happens to the token itself, hardware or software.
The token can only be blocked if it is active, otherwise the function will return an error code,
and the status of the token will not change. A blocked token can only be unblocked if its
status is manually or automatically blocked.
Unblocking a token also resets the number of consecutive errors
Signature:
C++ unsigned int DatablinkBlockToken(char* ioAuthBlob, bool iBlock);
Java public static int
DatablinkBlockToken(AuthenticationBlob ioAuthBlob, boolean
iBlock);
C# public static int DatablinkBlockToken(AuthenticationBlob ioAuthBlob, bool
iBlock);
Table 14 - DatablinkBlockToken Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
71
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be blocked or unblocked. After
calling this function, its contents are changed and the blob should be stored back
into the database.
• iBlock (i): If "true", it blocks the token. If "false", unblocks.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
bool block = true;
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
uint32_t result = DatablinkBlockToken(authBlob, block);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Token Blocked!");
}
Table 15 - DatablinkBlockTokenC++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
72
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
boolean block = true;
int result = DatablinkMgmtAPI.DatablinkBlockToken(authBlob, block);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Token Blocked!");
}
Table 16 - DatablinkBlockToken Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
bool block = true;
int result = DatablinkMgmtAPI.DatablinkBlockToken(authBlob, block);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Token Blocked!");
}
Table 17 - DatablinkBlockToken C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
73
5.1.2.3 DatablinkTokenExpiration
The DatablinkTokenExpiration function is used to define an expiration date for the token.
The expiration date is only a software setting; the physical token does not expire. The
expiration date can be defined in two ways: from the number of months since activation or
using a specific date.
It is important to note that for this feature to work properly, the "token_expires" parameter
from the Datablink Management runtime parameters must be defined as TRUE, otherwise
the token expiration is ignored.
Expired tokens can only be reused if the token blob is generated again, or this blob is
deactivated and reactivated (see DatablinkActivateToken).
Signature:
C++ unsigned int DatablinkTokenExpiration(char* ioAuthBlob, int iNumMonths, int
iDay, int iMonth, int iYear);
Java public static int DatablinkTokenExpiration(AuthenticationBlob
ioAuthBlob, int iNumMonths, int iDay, int iMonth, int iYear);
C# public static int DatablinkTokenExpiration(AuthenticationBlob ioAuthBlob, int
iNumMonths, int iDay, int iMonth, int iYear);
Table 18 - DatablinkTokenExpiration Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be its expiration date defined. After
calling this function, its contents are changed and the blob should be stored back
into the database.
• iNumMonths (i): Number of months to be counted from the activation date, in such
a way that this token is considered as expired. If the value of this parameter is 0
(zero), it will be ignored, and the parameters to be considered are the next ones.
• iDay (i): Day of the month, of the expiration date. If iNumMonths is different from
zero, this parameter is ignored.
• iMonth (i): Month of the year, of the expiration date. If iNumMonths is different
from zero, this parameter is ignored.
• iYear (i): 4-digit year, of the expiration date. If iNumMonths is different from zero,
this parameter is ignored.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
74
Use example:
C++
Using months
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because the C string
terminator
bool block = true;
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
int32_t iNumMonths = 1;
int32_t iDay = 0;
int32_t iMonth = 0;
int32_t iYear = 0;
uint32_t result = DatablinkTokenExpiration(authBlob, iNumMonths, iDay,
iMonth, iYear);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Token with expiration date defined!");
}
Table 19 - DatablinkTokenExpiration C++ Sample Code - Using months
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
75
C++
Using a specific date
const int blobSize = TOKEN_BLOB_SIZE + 1; //we use +1 because of the C
string terminator
char authBlob[blobSize] = { 0 };
bool block = true;
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
int32_t iNumMonths = 1;
int32_t iDay = 20;
int32_t iMonth = 2;
int32_t iYear = 2017;
uint32_t result = DatablinkTokenExpiration(authBlob, iNumMonths, iDay,
iMonth, iYear);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Token with expiration date defined!");
}
Table 20 - DatablinkTokenExpiration C++ Sample Code - Using a specific date
Java
Using months
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
int iNumMonths = 1;
int iDay = 0;
int iMonth = 0;
int iYear = 0;
int result = DatablinkMgmtAPI.DatablinkTokenExpiration(authBlob,
iNumMonths, iDay, iMonth, iYear);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Token with expiration date defined!");
}
Table 21- DatablinkTokenExpiration Java Sample Code - Using months
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
76
Java
Using a specific date
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
int iNumMonths = 0;
int iDay = 20;
int iMonth = 2;
int iYear = 2017;
int result = DatablinkMgmtAPI.DatablinkTokenExpiration(authBlob,
iNumMonths, iDay, iMonth, iYear);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Token with expiration date defined!");
}
Table 22 - DatablinkTokenExpiration Java Sample Code - Using a specific date
C#
Using months
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
int iNumMonths = 1;
int iDay = 0;
int iMonth = 0;
int iYear = 0;
int result = DatablinkMgmtAPI.DatablinkTokenExpiration(authBlob,
iNumMonths, iDay, iMonth, iYear);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Token with expiration date defined!");
}
Table 23 - DatablinkTokenExpiration C# Sample Code - Using Months
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
77
C#
Using a specific date
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
int iNumMonths = 0;
int iDay = 20;
int iMonth = 2;
int iYear = 2017;
int result = DatablinkMgmtAPI.DatablinkTokenExpiration(authBlob,
iNumMonths, iDay, iMonth, iYear);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Token with expiration date defined !");
}
Table 24 - DatablinkTokenExpiration C# Sample Code - Using a specific date
5.1.2.4 DatablinkGenMgmtCmd
The DatablinkGenMgmtCmd function is used to issue the bits string that will be used as the
communication protocol with the Device 200 token, sending a management command to
the token.
The result of this function is a byte string that shall be used in order, from the most
significant bit to the least significant bit, to present the blinking area. For .NET (C#) and Java
development, it is presented as a string, each character '0' or '1'. If the specific command
was not enabled in the token when it was programmed, an error code will be returned.
One of the ManagementCmd functions fixes the token's internal GMT Time. If you are sure
the user was able to sync its internal clock, you should also call the DatablinkResetTimeDrift
function, to reset the time drift can to zero. Otherwise, the next authentication will still
consider the token's time drift, and if this deviation is larger than the time window the
authentication might fail.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
78
Signature:
C++ unsigned int DatablinkGenMgmtCmd(char* ioAuthBlob, char iCommand, unsigned
char* oCommandBlink, int* oCommandBlinkSize);
Java public static int DatablinkGenMgmtCmd(AuthenticationBlob
ioAuthBlob, byte iCommand, CommandBlink oCommandBlink);
C# public static int DatablinkGenMgmtCmd(AuthenticationBlob ioAuthBlob, byte
iCommand, CommandBlink oCommandBlink);
Table 25 - DatablinkGenMgmtCmd Signature
Parameter(s):
• ioAuthBlob (i/o): token blob to be used when sending the command.
• iCommand (i): command to be sent to the Device 200 token:
DEV200_CMD_SHOW_GMT - 1
DEV200_CMD_UPDATE_GMT- 2
DEV200_CMD_SERIAL - 3
• oCommandBlink (o): bytes carrying the bits to be used by the blinking protocol.
Those bytes should be interpreted and presented the following way:
0 - Present black color for 60ms 1 - Present white color for 60ms
Example:
oCommandBlinkSize = 3
oCommandBlink[0]: 0x0A (0000 1010)
oCommandBlink[1]: 0x29 (0010 1001)
oCommandBlink[2]: 0xF0 (1111 0000)
Present the following bits every 60ms: 0000 1010 0010 1001 1111 0000
Meaning:
0000 = black, black, black, black
1010 = white, black, white, black
0010 = black, black, white, black
1001 = white, black, black, white
1111 = white, white, white, white
0000 = black, black, black, black
For C# and Java, the same data will be presented as a string, such as:
"000010100010100111110000"
• oCommandBlinkSize (o): Number of bytes generated, to be used in the blinking
protocol.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
79
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because the string terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
int32_t commandSize = 512;
uint8_t* command = (uint8_t*) malloc(commandSize);
memset(command, 0, commandSize);
uint32_t result = DatablinkGenMgmtCmd(authBlob, DEV200_CMD_SERIAL,
command, &commandSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Command = ");
for (int32_t i = 0; i < commandSize; i++)
{
printf("%02X ", command[i]);
}
printf("\n Command Size = %d", commandSize);
std::string sequence = "";
for (int i = 0; i < commandSize; i++)
{
for (int j = 7; j >= 0; j--)
{
sequence += (((command[i] >> j) & 0x01) == 1 ? "1" : "0");
}
}
printf("\n Blinking sequence = %s", sequence.c_str( ));
printf("\n Device Management Command Generated!");
}
free(command);
Table 26 - DatablinkGenMgmtCmd C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
80
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
byte command = DatablinkMgmtAPIConst.DEV200_CMD_SERIAL;
COMMAND commandBlink = new COMMAND();
int result = DatablinkMgmtAPI.DatablinkGenMgmtCmd(authBlob, command,
commandBlink);if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Command = " + commandBlink.getBitsSequence());
System.out.println("Device Management Command Generated!");
}
Table 27 - DatablinkGenMgmtCmd Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
byte command = DatablinkMgmtAPIConst.DEV200_CMD_SERIAL;
COMMAND commandBlink = new COMMAND();
int result = DatablinkMgmtAPI.DatablinkGenMgmtCmd(authBlob, command,
commandBlink);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Command = " + commandBlink.BitsSequence);
Console.WriteLine("Device Management Command Generated!");
}
Table 28 - DatablinkGenMgmtCmd C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
81
5.1.2.5 DatablinkGenMobile200MgmtAPIBlob
The DatablinkGenMobile200MgmtAPIBlob function is used to generate a Mobile 200 token
management blob from a Mobile 200 token blob, to be used by the Datablink Management
Mobile 200 API. This specific blob is used to control a Mobile 200 token installation within
a recipient, for example the token status within a smartphone, its activation PIN, etc., and
other specific parameters needed for the online communication with a Mobile 200 token.
For security reasons, it is also necessary to inform one client implementation key for this
function. This key must be also used for the mobile app and for the Datablink Management
Mobile 200 API functions and ensures that the one client implementation is unique.
Signature:
C++ unsigned int DatablinkGenMobile200MgmtAPIBlob(char* iAuthBlob, char*
iClientImplKey, char* oMobileMgmtSDKBlob, unsigned int*
ioMobileMgmtSDKBlobSize);
Java public static int
DatablinkGenMobile200MgmtAPIBlob(AuthenticationBlob iAuthBlob,
String iClientImplKey,
StringBuilder oMob200Blob);
C# public static int DatablinkGenMobile200MgmtAPIBlob(AuthenticationBlob
iAuthBlob, string iClientImplKey, StringBuilder oMob200Blob);
Table 29 – DatablinkGenMobile200MgmtAPIBlob
Parameter(s):
• iAuthBlob (i): Mobile 200 token authentication blob from which a management
token blob will be generated for a Management API installation.
• iClientImplKey (i): Implementation security key defined during the mobile
implementation. This key is used as part of the secret to encrypt the generated blob
and must be the same key used in Datablink Management Mobile 200 API functions.
This key must be defined as a hexadecimal 64-characters string.
• iAppMobileGenID (i): Indicates which Mobile 200 software generation is being used
within the current implementation.
Possible values:
0 - SafeMOBILE
1 - Mobile 200
- deprecated
2 - SafeMobile IPT - deprecated
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
82
• oMobileMgmtAPIBlob (o): Will receive the Datablink Mobile Management API blob,
on a Base64 format. This variable should have enough size to receive the generated
blob.
• ioMobileMgmtAPIBlobSize (i/o): Size of the output blob. Since this blob has a
variable size, it should indicate the maximum string size possible to be filled within
the oMobileMgmtAPIBlob variable. If there is not sufficient space to fill the blob
inside the oMobileMgmtAPIBlob variable, an error will be generated by this
function. Used only by implementations using C and C++.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because the C string
terminator
strncpy_s(authBlob,
"U1PAUIBE1FIrfQuLW3cbciGsAMiiLroecqogyeV3S+geyqt5xv0M7sV4QSU6bA+17xCKgv3YW
5hso15xYV9sJ7mjpkknSA+/zfCR/YDfgu6jyUVpz6TAv5NlpeYNC1vMk+fmyCTbZeUcG4B+JNo
bwfq0vT6ADk8V3PikQx49yWY8R21c2vPoyOE5PSRoiJ67BwojL9STdIeRC1bcei0i+S+JwQEJ0
a73KBtyAy3xKt7g", blobSize);
char* clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
uint32_t mob200MgmtBlobSize = 512;
char* mob200MgmtBlob = (char*) malloc(mob200MgmtBlobSize);
memset(mob200MgmtBlob, 0, mob200MgmtBlobSize);
uint32_t result = DatablinkGenMobile200MgmtAPIBlob(authBlob,
clientImplKey, mob200MgmtBlob, &mob200MgmtBlobSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Mobile blob generated = %s", authBlob);
printf("\n Mobile Management Blob Generated!");
}
free(mob200MgmtBlob);
Table 30 – DatablinkGenMobile200MgmtAPIBlob C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
83
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"U1PAUIBE1FIrfQuLW3cbciGsAMiiLroecqogyeV3S+geyqt5xv0M7sV4QSU6bA+17xCKgv3YW
5hso15xYV9sJ7mjpkknSA+/zfCR/YDfgu6jyUVpz6TAv5NlpeYNC1vMk+fmyCTbZeUcG4B+JNo
bwfq0vT6ADk8V3PikQx49yWY8R21c2vPoyOE5PSRoiJ67BwojL9STdIeRC1bcei0i+S+JwQEJ0
a73KBtyAy3xKt7g");
String clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
StringBuilder mob200MgmtBlob = new StringBuilder();
int result = DatablinkMgmtAPI.DatablinkGenMobile200MgmtAPIBlob(authBlob,
clientImplKey, mob200MgmtBlob);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Mobile blob generated = " +
mob200MgmtBlob.toString());
System.out.println("Mobile Management Blob Generated!");
}
Table 31 – DatablinkGenMobile200MgmtAPIBlob Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("U1PAUIBE1FIrfQuLW3cbciGsAMiiLroecqogyeV3S+geyqt5xv0M7sV4QS
U6bA+17xCKgv3YW5hso15xYV9sJ7mjpkknSA+/zfCR/YDfgu6jyUVpz6TAv5NlpeYNC1vMk+fm
yCTbZeUcG4B+JNobwfq0vT6ADk8V3PikQx49yWY8R21c2vPoyOE5PSRoiJ67BwojL9STdIeRC1
bcei0i+S+JwQEJ0a73KBtyAy3xKt7g");
String clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
StringBuilder mob200MgmtBlob = new StringBuilder();
int result = DatablinkMgmtAPI.DatablinkGenMobile200MgmtAPIBlob(authBlob,
clientImplKey, mob200MgmtBlob);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Mobile blob generated = " +
mob200MgmtBlob.ToString());
Console.WriteLine("Mobile Management Blob Generated!");
}
Table 32 – DatablinkGenMobile200MgmtAPIBlob C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338support@datablink.com
www.watchguard.com/wgrd-datablink
84
5.1.2.6 DatablinkTokenModel
The DatablinkTokenModel function is used to return the token model given any
authentication blob.
Signature:
C++ unsigned int DatablinkTokenModel(char* iAuthBlob, int* oTokenModel);
Java public static int DatablinkTokenModel(AuthenticationBlob iAuthBlob,
TokenModel oTokenModel);
C# public static int DatablinkTokenModel(AuthenticationBlob iAuthBlob,
TokenModel oTokenModel);
Table 33 - DatablinkTokenModel Signature
Parameter(s):
• iAuthBlob (i): Token authentication blob to be analyzed, and have its model
returned.
• oTokenModel (o): parameter where the token model will be returned. If correctly
identified, will have one of the following values:
Token model Code Status
DATABLINK_CARD100_CARD_ENVELOPE 1 Deprecated
TOKEN_DATABLINK_CARD100 2 Deprecated
TOKEN_DATABLINK_MOBILE200 3
TOKEN_DATABLINK_DEVICE100 4
TOKEN_DATABLINK_CARD200 5 Deprecated
TOKEN_DATABLINK_DESK110 6 Deprecated
TOKEN_DATABLINK_MOBILE100 7 Deprecated
TOKEN_DATABLINK_MOBILE50 8
TOKEN_DATABLINK_DEVICE200 9
TOKEN_DATABLINK_MOBILE110 10 Deprecated
Table 34 - Token Model
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
85
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
int tokenModel = 0;
uint32_t result = DatablinkTokenModel(authBlob, &tokenModel);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Token model = %d", tokenModel);
}
Table 35 - DatablinkTokenModel C++ Sample Code
Java
AuthenticationBlob authBlob = new
AuthenticationBlob("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91G
BNEy64xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7
EcfkN35jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1P
p0S4L0tMT2QArblOylZf2oY/o1HXbZYIrCLfg"); TokenModel tokenModel = new
TokenModel();
int result = DatablinkMgmtSDK. DatablinkTokenModel(authBlob, tokenModel);
if (result != DatablinkMgmtSDKErrorCodes.SUCCESS) {
System.out.println("Error = " +
DatablinkMgmtSDK.getErrorMessage(result,
DatablinkMgmtSDKConst.LANG_ENGLISH));
} else
{
System.out.println("Token model = " + tokenModel.getModel());
}
Table 36 - DatablinkTokenModel Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
86
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy
64xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7Ecfk
N35jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4
L0tMT2QArblOylZf2oY/o1HXbZYIrCLfg");
TokenModel tokenModel = new TokenModel();
int result = DatablinkMgmtAPI.DatablinkTokenModel(authBlob, tokenModel);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Token model = " + tokenModel.Model);
}
Table 37 - DatablinkTokenModel C# Sample Code
5.1.2.7 DatablinkDefineMobileDNA
The DatablinkDefineMobileDNA function is used to insert calculated DNA into a Mobile 200
blob.
A Mobile 200 DNA is actually a DNA calculated within the environment where the product
is installed, which could be a cell phone, smartphone or tablet. If the Mobile 200 is
distributed and configured to use the DNA as an additional factor for the OTP calculation, it
will be generated during activation, and transmitted to the server application that forwards
this data to Datablink Management API. This DNA is then stored within the corresponding
Mobile 200 authentication blob, so that future OTPs can be calculated using the DNA as an
additional validation factor.
The token authentication blob does not need to be active for the DNA to be defined.
However, an active token will lose its DNA if it is deactivated.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
87
Signature:
C++ unsigned int DatablinkDefineMobileDNA(char* ioAuthBlob, char* iDNA);
Java public static int DatablinkDefineMobileDNA(AuthenticationBlob
ioAuthBlob, String iDNA);
C# public static int DatablinkDefineMobileDNA(AuthenticationBlob ioAuthBlob,
string iDNA);
Table 38 - DatablinkDefineMobileDNA Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob that will have the DNA inserted into it.
After calling this function, its contents are changed and the authentication blob
should be stored back into the database.
• iDNA (i): the DNA from the environment where Mobile 200 is installed, represented
by a 42 characters hexadecimal string. This parameter is provided by the mobile app
during the activation process. If empty (""), the DNA will be removed from the blob.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"U1PAUIBE1FIrfQuLW3cbciGsAMiiLroecqogyeV3S+geyqt5xv0M7sV4QSU6bA+17xCKgv3YW
5hso15xYV9sJ7mjpkknSA+/zfCR/YDfgu6jyUVpz6TAv5NlpeYNC1vMk+fmyCTbZeUcG4B+JNo
bwfq0vT6ADk8V3PikQx49yWY8R21c2vPoyOE5PSRoiJ67BwojL9STdIeRC1bcei0i+S+JwQEJ0
a73KBtyAy3xKt7g", blobSize);
char* dna = "0123456789ABCDEF0123456789ABCDEF0123456789";
uint32_t result = DatablinkDefineMobileDNA(authBlob, dna);
if (result != SUCCESS){
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}else{
printf("\n Blob updated = %s", authBlob);
printf("\n DNA Defined!");
}
Table 39 - DatablinkDefineMobileDNA C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
88
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"U1PAUIBE1FIrfQuLW3cbciGsAMiiLroecqogyeV3S+geyqt5xv0M7sV4QSU6bA+17xCKgv3YW
5hso15xYV9sJ7mjpkknSA+/zfCR/YDfgu6jyUVpz6TAv5NlpeYNC1vMk+fmyCTbZeUcG4B+JNo
bwfq0vT6ADk8V3PikQx49yWY8R21c2vPoyOE5PSRoiJ67BwojL9STdIeRC1bcei0i+S+JwQEJ0
a73KBtyAy3xKt7g");
String dna = "0123456789ABCDEF0123456789ABCDEF0123456789";
int result = DatablinkMgmtAPI.DatablinkDefineMobileDNA(authBlob, dna);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error" + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("DNA Defined!");
}
Table 40 - DatablinkDefineMobileDNA Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("U1PAUIBE1FIrfQuLW3cbciGsAMiiLroecqogyeV3S+geyqt5xv0M7sV4QS
U6bA+17xCKgv3YW5hso15xYV9sJ7mjpkknSA+/zfCR/YDfgu6jyUVpz6TAv5NlpeYNC1vMk+fm
yCTbZeUcG4B+JNobwfq0vT6ADk8V3PikQx49yWY8R21c2vPoyOE5PSRoiJ67BwojL9STdIeRC1
bcei0i+S+JwQEJ0a73KBtyAy3xKt7g");
String dna = "0123456789ABCDEF0123456789ABCDEF0123456789";
int result = DatablinkMgmtAPI.DatablinkDefineMobileDNA(authBlob, dna);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("DNA Defined!");
}
Table 41 - DatablinkDefineMobileDNA C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
89
5.1.2.8 DatablinkChangeOTPSize
The DatablinkChangeOTPSize function is used to change the size of an OTP for a specific
authentication blob. This function is applicable only for tokens Mobile 50.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
Signature:
C++ unsigned int DatablinkChangeOTPSize(char* ioAuthBlob, int iOTPSize);
Java public static int DatablinkChangeOTPSize(AuthenticationBlob
ioAuthBlob, int iOTPSize);
C# public static int DatablinkChangeOTPSize(AuthenticationBlob ioAuthBlob, int
iOTPSize);
Table 42 - DatablinkChangeOTPSize Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to change the OTP size.
• iOTPSize (i): OTP size to be set in authentication blob.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
90
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"i6AlwnDiwq/xUTiaAVpLiUsP7P8p7MZGr29c7v9mpTrq7shSnWc33C7MkGAazGo1Kg3u0yLf0
MTbMwkpW82hkbggGAWWOIPlws9OLFEdkre7OSOJt4eYFc6owSAcxHvnHGdTGACubwCVROvKHiE
ztuqcAnwxr+dmf79H9GnYEsmhfG41yoeM7fGA+yC+r36ksZhdiZReQFNbYi3X8uGHO6m+xfrbs
r0RCb/adOGDKnkA", blobSize);
int32_t newOtpSize = 4;
uint32_t result = DatablinkChangeOTPSize(authBlob, newOtpSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n OTP Size Changed!");
}
Table 43 - DatablinkChangeOTPSize C++ Sample Code
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"i6AlwnDiwq/xUTiaAVpLiUsP7P8p7MZGr29c7v9mpTrq7shSnWc33C7MkGAazGo1Kg3u0yLf0
MTbMwkpW82hkbggGAWWOIPlws9OLFEdkre7OSOJt4eYFc6owSAcxHvnHGdTGACubwCVROvKHiE
ztuqcAnwxr+dmf79H9GnYEsmhfG41yoeM7fGA+yC+r36ksZhdiZReQFNbYi3X8uGHO6m+xfrbs
r0RCb/adOGDKnkA");
int newOtpSize = 4;
int result = DatablinkMgmtAPI.DatablinkChangeOTPSize(authBlob,
newOtpSize);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("OTP Size Changed!");
}
Table 44 - DatablinkChangeOTPSize Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
91
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("i6AlwnDiwq/xUTiaAVpLiUsP7P8p7MZGr29c7v9mpTrq7shSnWc33C7MkG
AazGo1Kg3u0yLf0MTbMwkpW82hkbggGAWWOIPlws9OLFEdkre7OSOJt4eYFc6owSAcxHvnHGdT
GACubwCVROvKHiEztuqcAnwxr+dmf79H9GnYEsmhfG41yoeM7fGA+yC+r36ksZhdiZReQFNbYi
3X8uGHO6m+xfrbsr0RCb/adOGDKnkA");
int newOtpSize = 4;
int result = DatablinkMgmtAPI.DatablinkChangeOTPSize(authBlob,
newOtpSize);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("OTP Size Changed!");
}
Table 45 - DatablinkChangeOTPSize C# Sample Code
5.1.3 Management global parameters
In this section are the functions responsible for managing the global parameters for the
authenticators provided by Datablink.
5.1.3.1 DatablinkReadDevice200Parms
The DatablinkReadDevice200Parms function presents the Datablink runtime utilization
parameters for the Device 200 tokens (DEVICE200_PARMS) during execution.
Signature:
C++ unsigned int DatablinkReadDevice200Parms (DEVICE200_PARMS* oDevice200Parms);
Java public static int DatablinkReadDevice200Parms(Device200Parms
oDevice200Parms);
C# public static int DatablinkReadDevice200Parms(Device200Parms
oDevice200Parms);
Table 46 - DatablinkReadDevice200Parms Signature
Parameter(s):
• oDevice200Parms (o): receives the structure with the Device 200 runtime parameters.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
92
Use example:
C++
DEVICE200_PARMS dev200Parms;
uint32_t result = DatablinkReadDevice200Parms(&dev200Parms);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n\t==== Device200 parameters ====");
printf("\n\t GMT difference = %u", dev200Parms.GMT_diff);
printf("\n\t Maximum errors allowed = %u", dev200Parms.max_errors);
printf("\n\t OTP window = %d", dev200Parms.otp_window);
printf("\n\t Token expire = %d", dev200Parms.token_expire);
printf("\n\t Unblock authentication daily = %d",
dev200Parms.unblock_aut_day);
printf("\n\t Unblock authentication after how many hours = %u",
dev200Parms.unblock_aut_hours);
printf("\n\t Unblock authentication after how many minutes = %u",
dev200Parms.unblock_aut_minutes);
printf("\n\t Advanced authentication = %u",
dev200Parms.adv_auth_window);
printf("\n\t Signature authentication = %u",
dev200Parms.signature_window);
}
Table 47 - DatablinkReadDevice200Parms C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
93
Java
DEVICE200PARMS dev200Parms = new DEVICE200PARMS();
int result = DatablinkMgmtAPI.DatablinkReadDevice200Parms(dev200Parms);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));}else{
System.out.println("==== Device200 parameters ====");
System.out.println("\t GMT difference = " + dev200Parms.getGMTDiff());
System.out.println("\t Maximum errors allowed = " +
dev200Parms.getMaxErrors());
System.out.println("\t OTP window = " + dev200Parms.getOtpWindow());
System.out.println("\t Token expire = " +
dev200Parms.isTokenExpires());
System.out.println("\t Unblock authentication diarily = " +
dev200Parms.isUnblockAutDay());
System.out.println("\t Unblock authentication after how many hours = "
+ dev200Parms.getUnblockAutHours());
System.out.println("\t Unblock authentication after how many minutes =
" + dev200Parms.getUnblockAutMinutes());
System.out.println("\t Advanced authentication window = " +
dev200Parms.getAdvancedAutWindow());
System.out.println("\t Signature authentication window = " +
dev200Parms.getSignatureWindow());
Table 48 - DatablinkReadDevice200Parms Java Sample Code
C#
DEVICE200PARMS dev200Parms = new DEVICE200PARMS();
int result = DatablinkMgmtAPI.DatablinkReadDevice200Parms(dev200Parms);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("==== Device200 parameters ====");
Console.WriteLine("\t GMT difference = " + dev200Parms.GMTDiff);
Console.WriteLine("\t Maximum errors allowed = " +
dev200Parms.MaxErrors);
Console.WriteLine("\t OTP window = " + dev200Parms.OtpWindow);
Console.WriteLine("\t Token expire = " + dev200Parms.TokenExpires);
Console.WriteLine("\t Unblock authentication diarily = " +
dev200Parms.UnblockAutDay);
Console.WriteLine("\t Unblock authentication after how many hours = "
+ dev200Parms.UnblockAutHours);
Console.WriteLine("\t Unblock authentication after how many minutes =
" + dev200Parms.UnblockAutMinutes);
Console.WriteLine("\t Advanced authentication window = " +
dev200Parms.AdvancedAutWindow);
Console.WriteLine("\t Signature authentication window = " +
dev200Parms.SignatureWindow);
Table 49 - DatablinkReadDevice200Parms C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
94
5.1.3.2 DatablinkReadMobile50Parms
The DatablinkReadMobile50Parms function presents the Datablink runtime utilization
parameters for the Mobile 50 tokens (Mobile50_PARMS) during execution.
Signature:
C++ unsigned int DatablinkReadMobile50Parms (MOBILE50_PARMS* oMobile50Parms);
Java public static int DatablinkReadMobile50Parms(Mobile50Parms
oMobile50Parms);
C# public static int DatablinkReadMobile50Parms(Mobile50Parms oMobile50Parms);
Table 50 - DatablinkReadMobile50Parms Signature
Parameter(s):
• oMobile50Parms (o): receives the structure with the Mobile 50 runtime parameters.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
MOBILE50_PARMS mob50Parms;
uint32_t result = DatablinkReadMobile50Parms(&mob50Parms);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}else{
printf("\n\t==== Mobile50 parameters ====");
printf("\n\t Maximum errors allowed = %u", mob50Parms.max_errors);
printf("\n\t OTP window = %d", mob50Parms.otp_window);
printf("\n\t Token expire = %d", mob50Parms.token_expire);
printf("\n\t Unblock authentication daily = %d",
mob50Parms.unblock_aut_day);
printf("\n\t Unblock authentication after how many hours = %u",
mob50Parms.unblock_aut_hours);
printf("\n\t Unblock authentication after how many minutes = %u",
mob50Parms.unblock_aut_minutes);
}
Table 51 - DatablinkReadMobile50Parms C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
95
Java
MOBILE50PARMS mob50Parms = new MOBILE50PARMS();
int result = DatablinkMgmtAPI.DatablinkReadMobile50Parms(mob50Parms);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("==== Mobile50 parameters ====");
System.out.println("\t Maximum errors allowed = " +
mob50Parms.getMaxErrors());
System.out.println("\t OTP window = " + mob50Parms.getOtpWindow());
System.out.println("\t Token expire = " +
mob50Parms.isTokenExpires());
System.out.println("\t Unblock authentication diarily = " +
mob50Parms.isUnblockAutDay());
System.out.println("\t Unblock authentication after how many hours = "
+ mob50Parms.getUnblockAutHours());
System.out.println("\t Unblock authentication after how many minutes =
" + mob50Parms.getUnblockAutMinutes());
Table 52 - DatablinkReadMobile50Parms Java Sample Code
C#
MOBILE50PARMS mob50Parms = new MOBILE50PARMS();
int result = DatablinkMgmtAPI.DatablinkReadMobile50Parms(mob50Parms);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("==== Mobile50 parameters ====");
Console.WriteLine("\t Maximum errors allowed = " +
mob50Parms.MaxErrors);
Console.WriteLine("\t OTP window = " + mob50Parms.OtpWindow);
Console.WriteLine("\t Token expire = " + mob50Parms.TokenExpires);
Console.WriteLine("\t Unblock authentication diarily = " +
mob50Parms.UnblockAutDay);
Console.WriteLine("\t Unblock authentication after how many hours = "
+ mob50Parms.UnblockAutHours);
Console.WriteLine("\t Unblock authentication after how many minutes =
" + mob50Parms.UnblockAutMinutes);
Table 53 - DatablinkReadMobile50Parms C# Sample Code
5.1.3.3 DatablinkReadMobile200Parms
The DatablinkReadMobile200Parms function presents the Datablink runtime utilization
parameters for the Mobile 200 tokens (MOBILE200_PARMS) during execution.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
96
Signature:
C++ unsigned int DatablinkReadMobile200Parms (MOBILE200_PARMS* oMobile200Parms);
Java public static int DatablinkReadMobile200Parms(Mobile200Parms
oMobile200Parms);
C# public static int DatablinkReadMobile200Parms(Mobile200Parms
oMobile200Parms);
Table 54 - DatablinkReadMobile200Parms Signature
Parameter(s):
• oMobile200Parms (o): receives the structure with the Mobile 200 runtime
parameters.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
MOBILE200_PARMS mob200Parms;
uint32_t result = DatablinkReadMobile200Parms(&mob200Parms);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}else{
printf("\n\t==== Mobile200 parameters ====");
printf("\n\t GMT difference = %u", mob200Parms.GMT_diff);
printf("\n\t Maximum errors allowed = %u", mob200Parms.max_errors);
printf("\n\t OTP window = %d", mob200Parms.otp_window);
printf("\n\t Token expire = %d", mob200Parms.token_expire);printf("\n\t Unblock authentication diarily = %d",
mob200Parms.unblock_aut_day);
printf("\n\t Unblock authentication after how many hours = %u",
mob200Parms.unblock_aut_hours);
printf("\n\t Unblock authentication after how many minutes = %u",
mob200Parms.unblock_aut_minutes);
printf("\n\t Advanced authentication window = %u",
mob200Parms.adv_auth_window);
printf("\n\t Signature authentication window = %u",
mob200Parms.signature_window);
}
Table 55 - DatablinkReadMobile200Parms C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
97
Java
MOBILE200PARMS mob200Parms = new MOBILE200PARMS();
int result = DatablinkMgmtAPI.DatablinkReadMobile200Parms(mob200Parms);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("==== Mobile200 parameters ====");
System.out.println("\t GMT difference = " + mob200Parms.getGMTDiff());
System.out.println("\t Maximum errors allowed = " +
mob200Parms.getMaxErrors());
System.out.println("\t OTP window = " + mob200Parms.getOtpWindow());
System.out.println("\t Token expire = " +
mob200Parms.isTokenExpires());
System.out.println("\t Unblock authentication diarily = " +
mob200Parms.isUnblockAutDay());
System.out.println("\t Unblock authentication after how many hours = "
+ mob200Parms.getUnblockAutHours());
System.out.println("\t Unblock authentication after how many minutes =
" + mob200Parms.getUnblockAutMinutes());
System.out.println("\t Advanced authentication window = " +
mob200Parms.getAdvancedAutWindow());
System.out.println("\t Signature authentication window = " +
mob200Parms.getSignatureWindow());
}
Table 56 - DatablinkReadMobile200Parms Java Sample Code
C#
MOBILE200PARMS mob200Parms = new MOBILE200PARMS();
int result = DatablinkMgmtAPI.DatablinkReadMobile200Parms(mob200Parms);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
Console.WriteLine("==== Mobile200 parameters ====");
Console.WriteLine("\t GMT difference = " + mob200Parms.GMTDiff);
Console.WriteLine("\t Maximum errors allowed = " +
mob200Parms.MaxErrors);
Console.WriteLine("\t OTP window = " + mob200Parms.OtpWindow);
Console.WriteLine("\t Token expire = " + mob200Parms.TokenExpires);
Console.WriteLine("\t Unblock authentication diarily = " +
mob200Parms.UnblockAutDay);
Console.WriteLine("\t Unblock authentication after how many hours = "
+ mob200Parms.UnblockAutHours);
Console.WriteLine("\t Unblock authentication after how many minutes =
" + mob200Parms.UnblockAutMinutes);
Console.WriteLine("\t Advanced authentication window = " +
mob200Parms.AdvancedAutWindow);
Console.WriteLine("\t Signature authentication window = " +
mob200Parms.SignatureWindow);
Table 57 - DatablinkReadMobile200Parms C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
98
5.1.3.4 DatablinkWriteParmsDevice200
The DatablinkWriteParmsDevice200 function allows the Datablink Management runtime
utilization parameters for the Device 200 tokens (DEVICE200_PARMS) to change during
execution.
When calling this function, if the iMem parameter is set to FALSE, the parameters are also
changed in the registry (Windows) or device200.conf (Linux), to maintain storage of the
most recently defined parameters. If iMem is set to TRUE, the parameters are only changed
during runtime (in memory).
If you are not using memory storage, you can avoid inconsistency within the values by first
calling DatablinkReadDevice200Parms to get actual values, changing only the desired fields
and then storing the updated parameters.
Signature:
C++ unsigned int DatablinkWriteParmsDevice200(DEVICE200_PARMS iDevice200Parms,
bool iMem);
Java public static int DatablinkWriteParmsDevice200(Device200Parms
iDevice200Parms, boolean iMem);
C# public static int
DatablinkWriteParmsDevice200(Device200Parms iDevice200Parms, bool
iMem);
Table 58 - DatablinkWriteParmsDevice200 Signature
Parameter(s):
• iDevice200Parms (i): structure with the Device 200 runtime parameters to be
changed.
• iMem (i): If “true”, will only store the parameters in memory, and will not try to
store in the registry or file.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
99
Use example:
C++
bool memory = false;
DEVICE200_PARMS dev200Parms;
dev200Parms.GMT_diff = 1;
dev200Parms.max_errors = 0;
dev200Parms.otp_window = 1200;
dev200Parms.token_expire = 0;
dev200Parms.unblock_aut_day = 0;
dev200Parms.unblock_aut_hours = 0;
dev200Parms.unblock_aut_minutes = 0;
dev200Parms.adv_auth_window = 1800;
dev200Parms.signature_window = 600;
uint32_t result = DatablinkWriteParmsDevice200(dev200Parms, false);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Device200 Parameters Updated!");
}
Table 59 - DatablinkWriteParmsDevice200 C++ Sample Code
Java
boolean memory = false;
DEVICE200PARMS dev200Parms = new DEVICE200PARMS();
dev200Parms.setGMTDiff(1);
dev200Parms.setMaxErrors(0);
dev200Parms.setOtpWindow(1200);
dev200Parms.setTokenExpires(false);
dev200Parms.setUnblockAutDay(false);
dev200Parms.setUnblockAutHours(0);
dev200Parms.setUnblockAutMinutes(0);
dev200Parms.setAdvancedAutWindow(1800);
dev200Parms.setSignatureWindow(600);
int result = DatablinkMgmtAPI.DatablinkWriteParmsDevice200(dev200Parms,
memory);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Device200 parameters updated!");
}
Table 60 - DatablinkWriteParmsDevice200 Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
100
C#
bool memory = false;
DEVICE200PARMS dev200Parms = new DEVICE200PARMS();
dev200Parms.GMTDiff = 1;
dev200Parms.MaxErrors = 0;
dev200Parms.OtpWindow = 1200;
dev200Parms.TokenExpires = false;
dev200Parms.UnblockAutDay = false;
dev200Parms.UnblockAutHours = 0;
dev200Parms.UnblockAutMinutes = 0;
dev200Parms.AdvancedAutWindow = 1800;
dev200Parms.SignatureWindow = 600;
int result = DatablinkMgmtAPI.DatablinkWriteParmsDevice200(dev200Parms,
memory);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Device200 Parameters Updated!");
}
Table 61 - DatablinkWriteParmsDevice200 C# Sample Code
5.1.3.5 DatablinkWriteParmsMobile50
The DatablinkWriteParmsMobile50 function allows the Datablink Management runtime
utilization parametersfor the Mobile 50 tokens (MOBILE50_PARMS) to change during
execution.
When calling this function, if the iMem parameter is set to FALSE, the parameters are also
changed in the registry (Windows) or mobile50.conf (Linux), to maintain storage of the most
recently defined parameters. If iMem is set to TRUE, the parameters are only changed
during runtime (in memory).
If you are not using memory storage, you can avoid inconsistency within the values by first
calling DatablinkReadMobile50Parms to get actual values, changing only the desired fields
and then storing the updated parameters.
Signature:
C++ unsigned int DatablinkWriteParmsMobile50(MOBILE50_PARMS iMobile50Parms, bool
iMem);
Java public static int DatablinkWriteParmsMobile50(Mobile50Parms
iMobile50Parms, boolean iMem);
C# public static int DatablinkWriteParmsMobile50(Mobile50Parms iMobile50Parms,
bool iMem);
Table 62 - DatablinkWriteParmsMobile50 Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
101
Parameter(s):
• iMobile50Parms (i): structure with the Mobile 50 runtime parameters to be changed.
• iMem (i): If “true”, will only store the parameters in memory, and will not try to store
in the registry or file.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
bool memory = false;
MOBILE50_PARMS mob50Parms;
mob50Parms.max_errors = 0;
mob50Parms.otp_window = 1200;
mob50Parms.token_expire = 0;
mob50Parms.unblock_aut_day = 0;
mob50Parms.unblock_aut_hours = 0;
mob50Parms.unblock_aut_minutes = 0;
uint32_t result = DatablinkWriteParmsMobile50(mob50Parms, memory);
if (result != SUCCESS){
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}else{
printf("\n Mobile50 Parameters Updated!");
}
Table 63 - DatablinkWriteParmsMobile50 C++ Sample Code
Java
boolean memory = false;
MOBILE50PARMS mob50Parms = new MOBILE50PARMS();
mob50Parms.setMaxErrors(0);
mob50Parms.setOtpWindow(1200);
mob50Parms.setTokenExpires(false);
mob50Parms.setUnblockAutDay(false);
mob50Parms.setUnblockAutHours(0);
mob50Parms.setUnblockAutMinutes(0);
int result = DatablinkMgmtAPI.DatablinkWriteParmsMobile50(mob50Parms,
memory);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Mobile50 parameters updated!");
}
Table 64 - DatablinkWriteParmsMobile50 Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
102
C#
bool memory = false;
MOBILE50PARMS mob50Parms = new MOBILE50PARMS();
mob50Parms.MaxErrors = 0;
mob50Parms.OtpWindow = 1200;
mob50Parms.TokenExpires = false;
mob50Parms.UnblockAutDay = false;
mob50Parms.UnblockAutHours = 0;
mob50Parms.UnblockAutMinutes = 0;
int result = DatablinkMgmtAPI.DatablinkWriteParmsMobile50(mob50Parms,
memory);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Mobile50 Parameters Updated!");
}
Table 65 - DatablinkWriteParmsMobile50 C# Sample Code
5.1.3.6 DatablinkWriteParmsMobile200
The DatablinkWriteParmsMobile200 function allows the Datablink Management runtime
utilization parameters for the Mobile 200 tokens (MOBILE200_PARMS) to change during
execution.
When calling this function, if the iMem parameter is set to FALSE, the parameters are also
changed in the registry (Windows) or mobile200.conf (Linux), to maintain storage of the
most recently defined parameters. If iMem is set to TRUE, the parameters are only changed
during runtime (in memory).
If you are not using memory storage, you can avoid inconsistency within the values by first
calling DatablinkReadMobile200Parms to get actual values, changing only the desired fields
and then storing the updated parameters
Signature:
C++ unsigned int DatablinkWriteParmsMobile200(MOBILE200_PARMS iMobile200Parms,
bool iMem);
Java public static int DatablinkWriteParmsMobile200(Mobile200Parms
iMobile200Parms, boolean iMem);
C# public static int
DatablinkWriteParmsMobile200(Mobile200Parms iMobile200Parms, bool
iMem);
Table 66 - DatablinkWriteParmsMobile200 Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
103
Parameter(s):
• iMobile200Parms (i): structure with the Mobile 200 runtime parameters to be
changed.
• iMem (i): If “true”, will only store the parameters in memory, and will not try to
store in the registry or file.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
bool memory = false;
MOBILE200_PARMS mob200Parms;
mob200Parms.GMT_diff = 1;
mob200Parms.max_errors = 0;
mob200Parms.otp_window = 1200;
mob200Parms.token_expire = 0;
mob200Parms.unblock_aut_day = 0;
mob200Parms.unblock_aut_hours = 0;
mob200Parms.unblock_aut_minutes = 0;
mob200Parms.adv_auth_window = 1800;
mob200Parms.signature_window = 600;
uint32_t result = DatablinkWriteParmsMobile200(mob200Parms, memory);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Mobile200 Parameters Updated!");
}
Table 67 - DatablinkWriteParmsMobile200 C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
104
Java
boolean memory = false;
MOBILE200PARMS mob200Parms = new MOBILE200PARMS();
mob200Parms.setGMTDiff(1);
mob200Parms.setMaxErrors(0);
mob200Parms.setOtpWindow(1200);
mob200Parms.setTokenExpires(false);
mob200Parms.setUnblockAutDay(false);
mob200Parms.setUnblockAutHours(0);
mob200Parms.setUnblockAutMinutes(0);
mob200Parms.setAdvancedAutWindow(1800);
mob200Parms.setSignatureWindow(600);
int result = DatablinkMgmtAPI.DatablinkWriteParmsMobile200(mob200Parms,
memory);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Mobile200 parameters updated!");
}
Table 68 - DatablinkWriteParmsMobile200 Java Sample Code
C#
bool memory = false;
MOBILE200PARMS mob200Parms = new MOBILE200PARMS();
mob200Parms.GMTDiff = 1;
mob200Parms.MaxErrors = 0;
mob200Parms.OtpWindow = 1200;
mob200Parms.TokenExpires = false;
mob200Parms.UnblockAutDay = false;
mob200Parms.UnblockAutHours = 0;
mob200Parms.UnblockAutMinutes = 0;
mob200Parms.AdvancedAutWindow = 1800;
mob200Parms.SignatureWindow = 600;
int result = DatablinkMgmtAPI.DatablinkWriteParmsMobile200(mob200Parms,
memory);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else{
Console.WriteLine("Mobile200 Parameters Updated!");
}
Table 69 - DatablinkWriteParmsMobile200 C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
105
5.1.4 Token status
In this section are the functions responsible for read the dynamics information from the
token blobs.
5.1.4.1 DatablinkReadDevice200Info
The DatablinkReadDevice200Info function should be used to read all dynamic information
about a Device 200 token.
Signature:
C++ unsigned int DatablinkReadDevice200Info(char* iAuthBlob, DEVICE200_INFO*
oDevice200info);
Java public static int DatablinkReadDevice200Info(AuthenticationBlob
iAuthBlob, Device200Info oDevice200Info);
C# public static int DatablinkReadDevice200Info(AuthenticationBlob iAuthBlob,
Device200Info oDevice200Info);
Table 70 - DatablinkReadDevice200Info Signature
Parameter(s):
• iAuthBlob (i): Device 200 authentication blob from which you want to read the
dynamic information.
• oDevice200Info (o): output parameter that will receive the Device 200 dynamic
information.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
106
Use example:
C++
DEVICE200_INFO dev200Info;
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
uint32_t result = DatablinkReadDevice200Info(authBlob, &dev200Info);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n==== Device200 dynamic info ====");
printf("\n\t Activation date = %s", dev200Info.activation_date);
printf("\n\t Authentication errors = %u", dev200Info.auth_errors);
printf("\n\t Block date = %s", dev200Info.block_date);
printf("\n\t Challenge size = %u", dev200Info.challenge_size);
printf("\n\t Deviation = %d", dev200Info.deviation);
printf("\n\t Expiration date = %s", dev200Info.expiration_date);
printf("\n\t Last error authetication = %s",
dev200Info.last_error_auth);
printf("\n\t Last success authetication = %s",
dev200Info.last_success_auth);
printf("\n\t Last error signature = %s", dev200Info.last_error_sign);
printf("\n\t Last success signature = %s",
dev200Info.last_success_sign);
printf("\n\t OTP size = %u", dev200Info.otp_size);
printf("\n\t Response size = %u", dev200Info.response_size);
printf("\n\t OTP timestep = %u", dev200Info.otp_timestep);
printf("\n\t Serial number = %s", dev200Info.serial);
printf("\n\t Signature size = %u", dev200Info.signature_size);
printf("\n\t Signature timestep = %u", dev200Info.signature_timestep);
printf("\n\t Signature errors = %u", dev200Info.sign_errors);
printf("\n\t Token status = %u", dev200Info.status);
printf("\n\t Sync window = %u", dev200Info.sync_window);
}
Table 71 - DatablinkReadDevice200Info C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
107
Java
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
DEVICE200_INFO dev200Info = new DEVICE200_INFO();
int result = DatablinkMgmtAPI.DatablinkReadDevice200Info(authBlob,
dev200Info);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("==== Device200 dynamic info ====");
System.out.println("\t Activation date = " +
dev200Info.getActivationDate());
System.out.println("\t Authentication errors = " +
dev200Info.getAuthErrors());
System.out.println("\t Block date = " + dev200Info.getBlockDate());
System.out.println("\t Challenge size = " +
dev200Info.getChallengeSize());
System.out.println("\t Deviation = " + dev200Info.getDeviation());
System.out.println("\t Expiration date = " +
dev200Info.getExpirationDate());
System.out.println("\t Last error authetication = " +
dev200Info.getLastErrorAuth());
System.out.println("\t Last success authetication = " +
dev200Info.getLastSuccessAuth());
System.out.println("\t Last error signature = " +
dev200Info.getLastErrorSign());
System.out.println("\t Last success signature = " +
dev200Info.getLastSuccessSign());
System.out.println("\t OTP size = " + dev200Info.getOtpSize());
System.out.println("\t Response size = " +
dev200Info.getResponseSize());
System.out.println("\t OTP timestep = " +
dev200Info.getOtpTimestep());
System.out.println("\t Serial number = " + dev200Info.getSerial());
System.out.println("\t Signature size = " +
dev200Info.getSignatureSize());
System.out.println("\t Signature timestep = " +
dev200Info.getSignatureTimestep());
System.out.println("\t Signature errors = " +
dev200Info.getSignErrors());
System.out.println("\t Token status = " + dev200Info.getStatus());
System.out.println("\t Sync window = " + dev200Info.getSyncWindow());
}
Table 72 - DatablinkReadDevice200Info Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
108
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
DEVICE200_INFO dev200Info = new DEVICE200_INFO();
int result = DatablinkMgmtAPI.DatablinkReadDevice200Info(authBlob,
dev200Info);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("==== Device200 dynamic info ====");
Console.WriteLine("\t Activation date = " +
dev200Info.ActivationDate);
Console.WriteLine("\t Authentication errors = " +
dev200Info.AuthErrors);
Console.WriteLine("\t Block date = " + dev200Info.BlockDate);
Console.WriteLine("\t Challenge size = " + dev200Info.ChallengeSize);
Console.WriteLine("\t Deviation = " + dev200Info.Deviation);
Console.WriteLine("\t Expiration date = " +
dev200Info.ExpirationDate);
Console.WriteLine("\t Last error authetication = " +
dev200Info.LastErrorAuth);
Console.WriteLine("\t Last success authetication = " +
dev200Info.LastSuccessAuth);
Console.WriteLine("\t Last error signature = " +
dev200Info.LastErrorSign);
Console.WriteLine("\t Last success signature= " +
dev200Info.LastSuccessSign);
Console.WriteLine("\t OTP size = " + dev200Info.OtpSize);
Console.WriteLine("\t Response size = " + dev200Info.ResponseSize);
Console.WriteLine("\t OTP timestep = " + dev200Info.OtpTimestep);
Console.WriteLine("\t Serial number = " + dev200Info.Serial);
Console.WriteLine("\t Signature size = " + dev200Info.SignatureSize);
Console.WriteLine("\t Signature timestep = " +
dev200Info.SignatureTimestep);
Console.WriteLine("\t Signature errors = " + dev200Info.SignErrors);
Console.WriteLine("\t Token status = " + dev200Info.Status);
Console.WriteLine("\t Sync window = " + dev200Info.SyncWindow);
}
Table 73 - DatablinkReadDevice200Info C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
109
5.1.4.2 DatablinkReadMobile50Info
The DatablinkReadMobile50Info function should be used to read all dynamic information
about a Mobile 50 token.
Signature:
C++ unsigned int DatablinkReadMobile50Info(char* iAuthBlob, MOBILE50_INFO*
oMobile50info);
Java public static int DatablinkReadMobile50Info(AuthenticationBlob
iAuthBlob, Mobile50Info oMobile50Info);
C# public static int DatablinkReadMobile50Info(AuthenticationBlob iAuthBlob,
Mobile50Info oMobile50Info);
Table 74 - DatablinkReadMobile50Info Signature
Parameter(s):
• iAuthBlob (i): Mobile 50 authentication blob from which you want to read the
dynamic information.
• oMobile50Info (o): output parameter that will receive the Mobile 50 dynamic
information.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
110
Use example:
C++
MOBILE50_INFO mob50Info;
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the string C
terminator
strncpy_s(authBlob,
"i6AlwnDiwq/xUTiaAVpLiUsP7P8p7MZGr29c7v9mpTrq7shSnWc33C7MkGAazGo1Kg3u0yLf0
MTbMwkpW82hkbggGAWWOIPlws9OLFEdkre7OSOJt4eYFc6owSAcxHvnHGdTGACubwCVROvKHiE
ztuqcAnwxr+dmf79H9GnYEsmhfG41yoeM7fGA+yC+r36ksZhdiZReQFNbYi3X8uGHO6m+xfrbs
r0RCb/adOGDKnkA", blobSize);
uint32_t result = DatablinkReadMobile50Info(authBlob, &mob50Info);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n==== Mobile50 dynamic info ====");
printf("\n\t Activation date = %s", mob50Info.activation_date);
printf("\n\t Authentication errors = %u", mob50Info.auth_errors);
printf("\n\t Block date = %s", mob50Info.block_date);
printf("\n\t Expiration date = %s", mob50Info.expiration_date);
printf("\n\t Last error authetication = %s",
mob50Info.last_error_auth);
printf("\n\t Last success authetication = %s",
mob50Info.last_success_auth);
printf("\n\t OTP size = %u", mob50Info.otp_size);
printf("\n\t OTP timestep = %u", mob50Info.otp_timestep);
printf("\n\t Serial number = %s", mob50Info.serial);
printf("\n\t Token status = %u", mob50Info.status);
}
Table 75 - DatablinkReadMobile50Info C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
111
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"i6AlwnDiwq/xUTiaAVpLiUsP7P8p7MZGr29c7v9mpTrq7shSnWc33C7MkGAazGo1Kg3u0yLf0
MTbMwkpW82hkbggGAWWOIPlws9OLFEdkre7OSOJt4eYFc6owSAcxHvnHGdTGACubwCVROvKHiE
ztuqcAnwxr+dmf79H9GnYEsmhfG41yoeM7fGA+yC+r36ksZhdiZReQFNbYi3X8uGHO6m+xfrbs
r0RCb/adOGDKnkA");
MOBILE50_INFO mob200Info = new MOBILE50_INFO();
int result = DatablinkMgmtAPI.DatablinkReadMobile50Info(authBlob,
mob200Info);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("==== Mobile50 dynamic info ====");
System.out.println("\t Activation date = " +
mob200Info.getActivationDate());
System.out.println("\t Authentication errors = " +
mob200Info.getAuthErrors());
System.out.println("\t Block date = " + mob200Info.getBlockDate());
System.out.println("\t Expiration date = " +
mob200Info.getExpirationDate());
System.out.println("\t Last error authetication = " +
mob200Info.getLastErrorAuth());
System.out.println("\t Last success authetication = " +
mob200Info.getLastSuccessAuth());
System.out.println("\t OTP size = " + mob200Info.getOtpSize());
System.out.println("\t OTP timestep = " +
mob200Info.getOtpTimestep());
System.out.println("\t Serial number = " + mob200Info.getSerial());
System.out.println("\t Token status = " + mob200Info.getStatus());
}
Table 76 - DatablinkReadMobile50Info Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
112
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("i6AlwnDiwq/xUTiaAVpLiUsP7P8p7MZGr29c7v9mpTrq7shSnWc33C7MkG
AazGo1Kg3u0yLf0MTbMwkpW82hkbggGAWWOIPlws9OLFEdkre7OSOJt4eYFc6owSAcxHvnHGdT
GACubwCVROvKHiEztuqcAnwxr+dmf79H9GnYEsmhfG41yoeM7fGA+yC+r36ksZhdiZReQFNbYi
3X8uGHO6m+xfrbsr0RCb/adOGDKnkA");
MOBILE50_INFO mob200Info = new MOBILE50_INFO();
int result = DatablinkMgmtAPI.DatablinkReadMobile50Info(authBlob,
mob200Info);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("==== Mobile50 dynamic info ====");
Console.WriteLine("\t Activation date = " +
mob200Info.ActivationDate);
Console.WriteLine("\t Authentication errors = " +
mob200Info.AuthErrors);
Console.WriteLine("\t Block date = " + mob200Info.BlockDate);
Console.WriteLine("\t Expiration date = " +
mob200Info.ExpirationDate);
Console.WriteLine("\t Last error authetication = " +
mob200Info.LastErrorAuth);
Console.WriteLine("\t Last success authetication = " +
mob200Info.LastSuccessAuth);
Console.WriteLine("\t OTP size = " + mob200Info.OtpSize);
Console.WriteLine("\t OTP timestep = " + mob200Info.OtpTimestep);
Console.WriteLine("\t Serial number = " + mob200Info.Serial);
Console.WriteLine("\t Token status = " + mob200Info.Status);
}
Table 77 - DatablinkReadMobile50Info C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
113
5.1.4.3 DatablinkReadMobile200Info
The DatablinkReadMobile200Info function should be used to read all dynamic information
about a Mobile 200 token.
Signature:
C++ unsigned int DatablinkReadMobile200Info(char* iAuthBlob, MOBILE200_INFO*
oMobile200info);
Java public static int DatablinkReadMobile200Info(AuthenticationBlob
iAuthBlob, Mobile200Info oMobile200Info);
C# public static int DatablinkReadMobile200Info(AuthenticationBlob iAuthBlob,
Mobile50Info oMobile200Info);
Table 78 - DatablinkReadMobile200Info Signature
Parameter(s):
• iAuthBlob (i): Mobile 200 authentication blob from which you want to read thedynamic information.
oMobile200Info (o): output parameter that will receive the Mobile 200 dynamic information.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
114
Use example:
C++
MOBILE200_INFO mob200Info;
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKCbz4iumOSmFcVpDw
60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwGoOs2V6kpzZPq8G6
pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EKSiFwRrYEBqsaF9h
Sumd71q6TnWzkFg", blobSize);
uint32_t result = DatablinkReadMobile200Info(authBlob, &mob200Info);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n==== Mobile200 dynamic info ====");
printf("\n\t Activation date = %s", mob200Info.activation_date);
printf("\n\t Authentication errors = %u", mob200Info.auth_errors);
printf("\n\t Block date = %s", mob200Info.block_date);
printf("\n\t Challenge size = %u", mob200Info.challenge_size);
printf("\n\t Deviation = %d", mob200Info.deviation);
printf("\n\t Expiration date = %s", mob200Info.expiration_date);
printf("\n\t Last error authetication = %s",
mob200Info.last_error_auth);
printf("\n\t Last success authetication = %s",
mob200Info.last_success_auth);
printf("\n\t Last error signature = %s", mob200Info.last_error_sign);
printf("\n\t Last success signature = %s",
mob200Info.last_success_sign);
printf("\n\t OTP size = %u", mob200Info.otp_size);
printf("\n\t Response size = %u", mob200Info.response_size);
printf("\n\t OTP timestep = %u", mob200Info.otp_timestep);
printf("\n\t Serial number = %s", mob200Info.serial);
printf("\n\t Signature size = %u", mob200Info.signature_size);
printf("\n\t Signature timestep = %u", mob200Info.signature_timestep);
printf("\n\t Signature errors = %u", mob200Info.sign_errors);
printf("\n\t Token status = %u", mob200Info.status);
printf("\n\t Sync window = %u", mob200Info.sync_window);
}
Table 79 - DatablinkReadMobile200Info C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
115
Java
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKC
bz4iumOSmFcVpDw60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwG
oOs2V6kpzZPq8G6pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EK
SiFwRrYEBqsaF9hSumd71q6TnWzkFg");
MOBILE200_INFO mob200Info = new MOBILE200_INFO();
int result = DatablinkMgmtAPI.DatablinkReadMobile200Info(authBlob,
mob200Info);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("==== Mobile200 dynamic info ====");
System.out.println("\t Activation date = " +
mob200Info.getActivationDate());
System.out.println("\t Authentication errors = " +
mob200Info.getAuthErrors());
System.out.println("\t Block date = " + mob200Info.getBlockDate());
System.out.println("\t Challenge size = " +
mob200Info.getChallengeSize());
System.out.println("\t Deviation = " + mob200Info.getDeviation());
System.out.println("\t Expiration date = " +
mob200Info.getExpirationDate());
System.out.println("\t Last error authetication = " +
mob200Info.getLastErrorAuth());
System.out.println("\t Last success authetication = " +
mob200Info.getLastSuccessAuth());
System.out.println("\t Last error signature = " +
mob200Info.getLastErrorSign());
System.out.println("\t Last success signature = " +
mob200Info.getLastSuccessSign());
System.out.println("\t OTP size = " + mob200Info.getOtpSize());
System.out.println("\t Response size = " +
mob200Info.getResponseSize());
System.out.println("\t OTP timestep = " +
mob200Info.getOtpTimestep());
System.out.println("\t Serial number = " + mob200Info.getSerial());
System.out.println("\t Signature size = " +
mob200Info.getSignatureSize());
System.out.println("\t Signature timestep = " +
mob200Info.getSignatureTimestep());
System.out.println("\t Signature errors = " +
mob200Info.getSignErrors());
System.out.println("\t Token status = " + mob200Info.getStatus());
System.out.println("\t Sync window = " + mob200Info.getSyncWindow());
}
Table 80 - DatablinkReadMobile200Info Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
116
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKC
bz4iumOSmFcVpDw60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwG
oOs2V6kpzZPq8G6pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EK
SiFwRrYEBqsaF9hSumd71q6TnWzkFg");
MOBILE200_INFO mob200Info = new MOBILE200_INFO();
int result = DatablinkMgmtAPI.DatablinkReadMobile200Info(authBlob,
mob200Info);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("==== Mobile200 dynamic info ====");
Console.WriteLine("\t Activation date = " +
mob200Info.ActivationDate);
Console.WriteLine("\t Authentication errors = " +
mob200Info.AuthErrors);
Console.WriteLine("\t Block date = " + mob200Info.BlockDate);
Console.WriteLine("\t Challenge size = " + mob200Info.ChallengeSize);
Console.WriteLine("\t Deviation = " + mob200Info.Deviation);
Console.WriteLine("\t Expiration date = " +
mob200Info.ExpirationDate);
Console.WriteLine("\t Last error authetication = " +
mob200Info.LastErrorAuth);
Console.WriteLine("\t Last success authetication = " +
mob200Info.LastSuccessAuth);
Console.WriteLine("\t Last error signature = " +
mob200Info.LastErrorSign);
Console.WriteLine("\t Last success signature = " +
mob200Info.LastSuccessSign);
Console.WriteLine("\t OTP size = " + mob200Info.OtpSize);
Console.WriteLine("\t Response size = " + mob200Info.ResponseSize);
Console.WriteLine("\t OTP timestep = " + mob200Info.OtpTimestep);
Console.WriteLine("\t Serial number = " + mob200Info.Serial);
Console.WriteLine("\t Signature size = " + mob200Info.SignatureSize);
Console.WriteLine("\t Signature timestep = " +
mob200Info.SignatureTimestep);
Console.WriteLine("\t Signature errors = " + mob200Info.SignErrors);
Console.WriteLine("\t Token status = " + mob200Info.Status);
Console.WriteLine("\t Sync window = " + mob200Info.SyncWindow);
}
Table 81 - DatablinkReadMobile200Info C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
117
5.1.5 Authentication and signing
In this section are all functions related with strong and advanced authentication and signing
process.
5.1.5.1 DatablinkCheckOTPThe DatablinkCheckOTP function is used to authenticate a user. It uses the dynamic
password typed by the user in a string format.
For the Mobile 200 tokens, if its DNA has been previously defined (see
DatablinkDefineMobileDNA), it will be automatically used as part of the OTP validation
process.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
Signature:
C++ unsigned int DatablinkCheckOTP(char* ioAuthBlob, char* iOTP);
Java public static int DatablinkCheckOTP(AuthenticationBlob ioAuthBlob,
String iOTP);
C# public static int DatablinkCheckOTP(AuthenticationBlob ioAuthBlob, string
iOTP);
Table 82 - DatablinkCheckOTP Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be used when authenticating the
user (OTP validation). After calling this function, its contents are changed, and the
blob should be stored back into the database.
• iOTP (i): "One-Time Password", or "Unique Password". Dynamic password typed by
the user, represented as a string.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
118
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
char* otp = "123456";
uint32_t result = DatablinkCheckOTP(authBlob, otp);
printf("\n Blob updated = %s", authBlob);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n OTP Authenticated!");
}
Table 83 - DatablinkCheckOTP C++ Sample Code
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
String otp = "123456";
int result = DatablinkMgmtAPI.DatablinkCheckOTP(authBlob, otp);
System.out.println("Blob updated = " + authBlob.getBlob());
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("OTP Authenticated!");
}
Table 84 - DatablinkCheckOTP Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
119
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
String otp = "123456";
int result = DatablinkMgmtAPI.DatablinkCheckOTP(authBlob, otp);
Console.WriteLine("Blob updated = " + authBlob.Blob);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("OTP Authenticated!");
}
Table 85 - DatablinkCheckOTP C# Sample Code
5.1.5.2 DatablinkCheckOTPMSChapV2
The DatablinkCheckOTPMSChapV2 function is used to authenticate a user with an OTP +
fixed password provided through a MS-ChapV2 challenge, according to RFC 2759 (Microsoft
PPP CHAP Extensions, Version 2).
Some of the fields to be passed as parameters are actually part of the MS-ChapV2 package
and are used for the internal calculations.
This function is only available on Datablink Management API for Windows.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
120
Signature:
C++ unsigned int DatablinkCheckOTPMSChapV2(char* ioAuthBlob, unsigned
iNTResponse, unsigned char* iAuthenticatorChallenge, unsigned
iPeerChallenge, char* iUser, char* iFixedPassword,
oAuthenticatorSuccessResponse);
char*
char*
char*
Java public static int DatablinkCheckOTPMSChapV2(AuthenticationBlob
ioAuthBlob, byte[] iNTResponse, byte[] iAuthenticatorChallenge,
byte[] iPeerChallenge, String iUser, String iFixedPassword, byte[]
oAuthenticatorSuccessResponse);
C# public static int DatablinkCheckOTPMSChapV2(AuthenticationBlob ioAuthBlob,
byte[] iNTResponse, byte[] iAuthenticatorChallenge, byte[] iPeerChallenge,
string iUser, string iFixedPassword, byte[] oAuthenticatorSuccessResponse);
Table 86 - DatablinkCheckOTPMSChapV2 Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be used when authenticating the
user (OTP + password validation). After calling this function, its contents are changed
and the blob should be stored back into the database.
• iNTResponse (i): 24 octets field, that comes in the MS-ChapV2 package, is function
of the Authenticator Challenge, Peer Challenge, Username, and Password.
• iAuthenticatorChallenge (i): 16 octets field, that comes in the MS-CHAPV2 package.
• iPeerChallenge (i): 16 octets field, that comes in the MS-CHAPV2 package.
• iUser (i): The user name that should be validated.
• iFixedPassword (i): The user fixed password, that should be passed in cleartext. This
is needed so the API can concatenate with the possible token OTPs and make the
calculations to compare with iNTResponse.
• oAuthenticatorSuccessResponse (o): The field that should be sent back within the
MS-ChapV2 response.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
121
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
uint8_t ntResponse[] = { 216, 32, 110, 35, 110, 144, 4, 222, 248, 154, 33,
0, 6, 131, 81, 11, 87, 176, 108, 110, 135, 198, 245, 203 };
uint8_t authenticatorChallenge[] = { 5, 211, 102, 236, 15, 53, 6, 249, 90,
54, 153, 189, 222, 131, 106, 98 };
uint8_t peerChallenge[] = { 214, 237, 113, 192, 180, 227, 35, 40, 64, 50,
159, 192, 150, 24, 116, 232 };
char* user = "teste";
char* fixedPassword = "123456";
char authenticatorSuccessResponse[256] = { 0 };
uint32_t result = DatablinkCheckOTPMSChapV2(authBlob, ntResponse,
authenticatorChallenge, peerChallenge, user, fixedPassword,
authenticatorSuccessResponse);
printf("\n Blob updated = %s", authBlob);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0,messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Authenticator response = %s",
authenticatorSuccessResponse);
printf("\n OTP MsChapV2 Authenticated!");
}
Table 87 - DatablinkCheckOTPMSChapV2 C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
122
Java
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy
64xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7Ecfk
N35jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4
L0tMT2QArblOylZf2oY/o1HXbZYIrCLfg");
byte[] ntResponse = new byte[]{-40, 32, 110, 35, 110, -112, 4, -34, -8, -
102, 33, 0, 6, -125, 81, 11, 87, -80, 108, 110, -121, -58, -11, -53};
byte[] authenticatorChallenge = new byte[]{5, -45, 102, -20, 15, 53, 6, -
7, 90, 54, -103, -67, -34, -125, 106, 98};
byte[] peerChallenge = new byte[]{-42, -19, 113, -64, -76, -29, 35, 40,
64, 50, -97, -64, -106, 24, 116, -24};
String user = "teste";
String fixedPassword = "123456";
byte[] authenticatorSuccessResponse = new byte[256];
int result = DatablinkMgmtAPI.DatablinkCheckOTPMSChapV2(authBlob,
ntResponse, authenticatorChallenge, peerChallenge, user, fixedPassword,
authenticatorSuccessResponse);
System.out.println("Blob updated = " + authBlob.getBlob());
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.print("Authenticator response = [");
for(byte b : authenticatorSuccessResponse){
System.out.print(b + ",");
}
System.out.print("]");
System.out.println("OTP MsChapV2 Authenticated!");
}
Table 88 - DatablinkCheckOTPMSChapV2 Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
123
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
byte[] ntResponse = new byte[] { 216, 32, 110, 35, 110, 144, 4, 222, 248,
154, 33, 0, 6, 131, 81, 11, 87, 176, 108, 110, 135, 198, 245, 203 };
byte[] authenticatorChallenge = new byte[] { 5, 211, 102, 236, 15, 53, 6,
249, 90, 54, 153, 189, 222, 131, 106, 98 };
byte[] peerChallenge = new byte[] { 214, 237, 113, 192, 180, 227, 35, 40,
64, 50, 159, 192, 150, 24, 116, 232 };
string user = "teste";
string fixedPassword = "123456";
byte[] authenticatorSuccessResponse = new byte[256];
int result = DatablinkMgmtAPI.DatablinkCheckOTPMSChapV2(authBlob,
ntResponse, authenticatorChallenge, peerChallenge, user, fixedPassword,
authenticatorSuccessResponse);
Console.WriteLine("Blob updated = " + authBlob.Blob);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.Write("Authenticator response = [");
foreach (byte b in authenticatorSuccessResponse)
{
Console.Write(b + ",");
}
Console.Write("]");
Console.WriteLine("OTP MsChapV2 Authenticated!");
}
Table 89 - DatablinkCheckOTPMSChapV2 C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
124
5.1.5.3 DatablinkGenSigningCmd
The DatablinkGenSigningCmd function is used to issue the bits string that will be used as
the communication protocol with the Device 200 token.
To this function, one should pass, as parameters, the transaction number (as programmed
in the token), and the transaction data. As a result, a byte string will be generated and shall
be used, from the most significant bit to the least significant bit, in order to present the
blinking area. For .NET (C#) and Java development, it is presented as a string, each character
'0' or '1'.
This function should always be called before validating the eSignature with the
DatablinkCheckSignature command.
The authentication blob passed through this function is changed, so it must be stored back to
the database after the function is called, no matter its result.
Signature:
C++ unsigned int DatablinkGenSigningCmd(char* ioAuthBlob, char iTransactionID,
char iNumValues, __int64 iValues[], unsigned char* oCommandBlink, int*
oCommandBlinkSize);
Java public static int DatablinkGenSigningCmd(AuthenticationBlob
ioAuthBlob, byte iTransactionID, long[] iValues, CommandBlink
oCommandBlink);
C# public static int DatablinkGenSigningCmd(AuthenticationBlob ioAuthBlob, byte
iTransactionID, long[] iValues, CommandBlink oCommandBlink);
Table 90 - DatablinkGenSigningCmd Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be used to sign the transaction. After
calling this function, its contents are changed and the blob should be stored back
into the database.
• iTransactionID (i): identifier of the transaction that is currently being used to sign,
according to the token programming sheet. It should be a value between 1 and 10.
• iNumValues (i): number of values to be passed through the iValues[] parameter.
This number of values should respect the pre-defined programming parameters and
reflect the chosen transaction.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
125
• iValues (i): list with transaction values. In case of decimal numbers (transaction
amount, with cents), the decimal point should be ignored, and always add the 2
digits that would come just after the decimal point, even if zeros. For example, the
$ 540.70 value should be represented by the number "54070". Other example, in
case of $ 100.00, it should be presented as "10000".
• oCommandBlink (o): bytes carrying the bits to be used by the blinking protocol.
Those bytes should be interpreted and presented the following way:
0 - Present black color for 60ms 1 - Present white color for 60ms
Example:
oCommandBlinkSize = 3
oCommandBlink[0]: 0x0A (0000 1010)
oCommandBlink[1]: 0x29 (0010 1001)
oCommandBlink[2]: 0xF0 (1111 0000)
Present the following bits every 60ms: 0000 1010 0010 1001 1111 0000
Meaning:
0000 = black, black, black, black
1010 = white, black, white, black
0010 = black, black, white, black
1001 = white, black, black, white
1111 = white, white, white, white
0000 = black, black, black, black
For C# and Java, the same data will be presented as a string, such as:
"000010100010100111110000"
• oCommandBlinkSize (o): Number of bytes generated, to be used in the blinking
protocol.
•
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
126
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
uint8_t transactionID = 1;
const uint8_t numValues = 4;
int64_t values[numValues] = { 123, 1234, 123456, 50000 };
int32_t commandSize = 512;
uint8_t* command = (uint8_t*) malloc(commandSize);
memset(command, 0, commandSize);
uint32_t result = DatablinkGenSigningCmd(authBlob, transactionID,
numValues, values, command, &commandSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Command = ");
for (int32_t i = 0; i < commandSize; i++)
{
printf("%02X ", command[i]);
}
printf("\n Command Size = %d", commandSize);
std::string sequence = "";
for (int i = 0; i < commandSize; i++)
{
for (int j = 7; j >= 0; j--)
{
sequence += (((command[i] >> j) & 0x01) == 1 ? "1" : "0");
}
}
printf("\n Blinking sequence = %s", sequence.c_str( ));
printf("\n Device Signature Command Generated!");
}
free(command);
Table 91 - DatablinkGenSigningCmd C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
127
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
byte transactionID = 1;
long[] values = new long[]{123, 1234, 123456, 50000};
COMMAND commandBlink = new COMMAND();
int result = DatablinkMgmtAPI.DatablinkGenSigningCmd(authBlob,
transactionID, values, commandBlink);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Command = " + commandBlink.getBitsSequence());
System.out.println("Device Signature Command Generated!");
}
Table 92 - DatablinkGenSigningCmd Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
byte transactionID = 1;
long[] values = new long[] { 123, 1234, 123456, 50000 };
COMMAND commandBlink = new COMMAND();
int result = DatablinkMgmtAPI.DatablinkGenSigningCmd(authBlob,
transactionID, values, commandBlink);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Command = " + commandBlink.BitsSequence);
Console.WriteLine("Device Signature Command Generated!");
}
Table 93 - DatablinkGenSigningCmd C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
128
5.1.5.4 DatablinkGenDeviceSigningCmd
The DatablinkGenDeviceSigningCmd function is used to issue the bits string that will be used
as the communication protocol with the Device 200 token.
To this function, one should pass, as parameters, the transaction number (as programmed
in the token), and the transaction data. As a result, a byte string will be generated and shall
be used, from the most significant bit to the least significant bit, in order to present the
blinking area. For .NET (C#) and Java development, it is presented as a string, each character
'0' or '1'.
This function should always be called before validating the eSignature with the
DatablinkCheckSignature command.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
Signature:
C++ uint DatablinkGenDeviceSigningCmd(char* ioBlob, char iTransactionID, char
iNumValues, __int64 iValues[], unsigned char* oBlinkBytes, int*
oNumBlinkBytes)
Java public static int DatablinkGenDeviceSigningCmd(DATABLINK_BLOB
ioBlob, byte iTransactionID, long[] iValues, COMMAND oCommandBlink)
C# public static int DatablinkGenDeviceSigningCmd(DATABLINK_BLOB ioBlob, byte
iTransactionID, long[] iValues, COMMAND oBlinkBytes)
Table 94 - DatablinkGenDeviceSigningCmd Signature
Parameter(s):
• ioBlob (i/o): Token authentication blob to be used to sign the transaction. After
calling this function, its contents are changed and the blob should be stored back
into the database.
• iTransactionID (i): identifier of the transaction that is currently being used to sign,
according to the token programming sheet. It should be a value between 1 and 10.
• iNumValues (i): number of values to be passed through the iValues[] parameter.
This number of values should respect the pre-defined programming parameters and
reflect the chosen transaction.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
129
• iValues (i): list with transaction values. In case of decimal numbers (transaction
amount, with cents), the decimal point should be ignored, and always add the 2
digits that would come just after the decimal point, even if zeros. For example, the
$ 540.70 value should be represented by the number "54070". Other example, in
case of $ 100.00, it should be presented as "10000".
• oBlinkBytes (o): bytes carrying the bits to be used by the blinking protocol. Those
bytes should be interpreted and presented the following way:
0 - Present black color for 60ms 1 - Present white color for 60ms
Example:
oNumBlinkBytes = 3
oBlinkBytes[0]: 0x0A (0000 1010)
oBlinkBytes[1]: 0x29 (0010 1001)
oBlinkBytes[2]: 0xF0 (1111 0000)
Present the following bits every 60ms: 0000 1010 0010 1001 1111 0000
Meaning:
0000 = black, black, black, black
1010 = white, black, white, black
0010 = black, black, white, black
1001 = white, black, black, white
1111 = white, white, white, white
0000 = black, black, black, black
For C# and Java, the same data will be presented as a string, such as:
"000010100010100111110000"
• oNumBlinkBytes (o): Number of bytes generated, to be used in the blinking
protocol.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
130
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg",blobSize);
uint8_t transactionID = 1;
const uint8_t numValues = 4;
int64_t values[numValues] = { 123, 1234, 123456, 50000 };
int32_t commandSize = 512;
uint8_t* command = (uint8_t*) malloc(commandSize);
memset(command, 0, commandSize);
uint32_t result = DatablinkGenDeviceSigningCmd(authBlob, transactionID,
numValues, values, command, &commandSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Command = ");
for (int32_t i = 0; i < commandSize; i++)
{
printf("%02X ", command[i]);
}
printf("\n Command Size = %d", commandSize);
std::string sequence = "";
for (int i = 0; i < commandSize; i++)
{
for (int j = 7; j >= 0; j--)
{
sequence += (((command[i] >> j) & 0x01) == 1 ? "1" : "0");
}
}
printf("\n Blinking sequence = %s", sequence.c_str( ));
printf("\n Device Signature Command Generated!");
}
free(command);
Table 95 - DatablinkGenDeviceSigningCmd C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
131
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
byte transactionID = 1;
long[] values = new long[]{123, 1234, 123456, 50000};
COMMAND commandBlink = new COMMAND();
int result = DatablinkMgmtAPI.DatablinkGenDeviceSigningCmd(authBlob,
transactionID, values, commandBlink);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Command = " + commandBlink.getBitsSequence());
System.out.println("Device Signature Command Generated!");
}
Table 96 - DatablinkGenDeviceSigningCmd Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
byte transactionID = 1;
long[] values = new long[] { 123, 1234, 123456, 50000 };
COMMAND commandBlink = new COMMAND();
int result = DatablinkMgmtAPI.DatablinkGenDeviceSigningCmd(authBlob,
transactionID, values, commandBlink);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Command = " + commandBlink.BitsSequence);
Console.WriteLine("Device Signature Command Generated!");
}
Table 97 - DatablinkGenDeviceSigningCmd C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
132
5.1.5.5 DatablinkCheckSignature
The DatablinkCheckSignature function is used to validate an eSignature generated by
transaction values previously defined through the DatablinkGenerateSigningCmd function. If
the transaction data has not been defined yet, the function will return an error.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
Signature:
C++ unsigned int DatablinkCheckSignature(char* ioAuthBlob, char* iSignature);
Java public static int DatablinkCheckSignature(AuthenticationBlob
ioAuthBlob, String iSignature);
C# public static int DatablinkCheckSignature(AuthenticationBlob ioAuthBlob,
string iSignature);
Table 98 - DatablinkCheckSignature Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be used on the eSignature validation.
After calling this function, its contents are changed and the blob should be stored
back into the database.
• iSignature (i): eSignature generated by the token, based on the transaction values,
and typed by the user, represented as a string.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
133
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"h5/4D3Jm2xXL0E0b8eY4B4fiJDr1s85nWOIcNDKuPCeoUmSIg02LqAtFqDIotPE1Ck4Cl6HrS
ORarATy7JnlEZJbIo8ySnXfPVj8cExsiOhOhEetnh3j6NQKR6zImM2zxP/A+1zxmi+Itb8Y0la
q/rxXQflatv0MPJu/FRQiRcDkuIKB9iF78ag5lHWDoHRCCUWMQOhM59wccohr42MuIcrfWXfUa
VoszE05o+pfpwUA", blobSize);
char* signature = "12345678";
uint32_t result = DatablinkCheckSignature(authBlob, signature);
printf("\n Blob updated = %s", authBlob);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Device Signature Authenticated!");
}
Table 99 - DatablinkCheckSignature C++ Sample Code
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"wfGzA4/T3ikrJ2I/fCBn1fkdCAGEPYvlA+aAVBgKCZ2i+NW/rA474fHWRE1JMZ2iAOXveT3xs
vfe91pN8nnAZyC+NraO2HBM9+buDj1QbJ7lS5QYXlz8aHn7o+pLg55i+XrSKAltkmEtYeAVbo/
Tk8IaeksT5/RhUJ0AsoJliG0m/lvPoZvA+mkDX05fHgcIFT/9awugTI0NMdOhIHkhVJzaq01Ft
gs+SJLqWXFK4QRQ");
String signature = "12345678";
int result = DatablinkMgmtAPI.DatablinkCheckSignature(authBlob,
signature);
System.out.println("Blob updated = " + authBlob.getBlob());
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Device Signature Authenticated!");
}
Table 100 - DatablinkCheckSignature Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
134
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("wfGzA4/T3ikrJ2I/fCBn1fkdCAGEPYvlA+aAVBgKCZ2i+NW/rA474fHWRE
1JMZ2iAOXveT3xsvfe91pN8nnAZyC+NraO2HBM9+buDj1QbJ7lS5QYXlz8aHn7o+pLg55i+XrS
KAltkmEtYeAVbo/Tk8IaeksT5/RhUJ0AsoJliG0m/lvPoZvA+mkDX05fHgcIFT/9awugTI0NMd
OhIHkhVJzaq01Ftgs+SJLqWXFK4QRQ");
string signature = "12345678";
int result = DatablinkMgmtAPI.DatablinkCheckSignature(authBlob,
signature);
Console.WriteLine("Blob updated = " + authBlob.Blob);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS){
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
Console.WriteLine("Device Signature Authenticated!");
}
Table 101 - DatablinkCheckSignature C# Sample Code5.1.5.6 DatablinkCheckMobileSignature
The DatablinkCheckMobileSignature function is used to validate an eSignature generated by
a Mobile 200 token.
The program using this function should pass, as parameters, the transaction values
concatenated as a string and the eSignature typed by the user (generated by the token), in
a string format.
The values to be concatenated must exactly match values that appear at the Mobile 200
fields. For example, if the "Branch" field shows "1234-5" and the currency field shows
"1500.00", then the string to be passed along should be: "1234-51500.00", including dash
and dots. Only alphanumeric characters are accepted, as well as common symbols in the
ASCII table from 33 (exclamation mark) to 126 (tilde). In the case of C#, it is passed as a list
of strings.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
Signature:
C++ unsigned int DatablinkCheckMobileSignature(char* ioAuthBlob, char* iValues,
char* iSignature);
Java public static int DatablinkCheckMobileSignature(AuthenticationBlob
ioAuthBlob, String iValues, String iSignature);
C# public static int DatablinkCheckMobileSignature(AuthenticationBlob
ioAuthBlob, string iValues, string iSignature);
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
135
Table 102 - DatablinkCheckMobileSignature Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be used on the eSignature validation.
After calling this function, its contents are changed and the blob should be stored
back into the database.
• iValues (i): List with transaction values, concatenated. It should be used exactly the
same values as they are presented at the Mobile 200 fields, and in the same order
as they are listed. For example, if the following values are presented: "1234-5",
"33445/12" and "1,200.50", the string should be passed along as:
"1234533445/121,200.50".
• iSignature (i): eSignature generated by the token, based on the transaction values,
and typed by the user, represented as a string.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"h5/4D3Jm2xXL0E0b8eY4B4fiJDr1s85nWOIcNDKuPCeoUmSIg02LqAtFqDIotPE1Ck4Cl6HrS
ORarATy7JnlEZJbIo8ySnXfPVj8cExsiOhOhEetnh3j6NQKR6zImM2zxP/A+1zxmi+Itb8Y0la
q/rxXQflatv0MPJu/FRQiRcDkuIKB9iF78ag5lHWDoHRCCUWMQOhM59wccohr42MuIcrfWXfUa
VoszE05o+pfpwUA", blobSize);
char* signature = "12345678";
char* values = "1234-51,500.00";
uint32_t result = DatablinkCheckMobileSignature(authBlob, values,
signature);
printf("\n Blob updated = %s", authBlob);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Mobile Signature Authenticated!");
}
Table 103 - DatablinkCheckMobileSignature C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
136
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"h5/4D3Jm2xXL0E0b8eY4B4fiJDr1s85nWOIcNDKuPCeoUmSIg02LqAtFqDIotPE1Ck4Cl6HrS
ORarATy7JnlEZJbIo8ySnXfPVj8cExsiOhOhEetnh3j6NQKR6zImM2zxP/A+1zxmi+Itb8Y0la
q/rxXQflatv0MPJu/FRQiRcDkuIKB9iF78ag5lHWDoHRCCUWMQOhM59wccohr42MuIcrfWXfUa
VoszE05o+pfpwUA");
String values = "1234-51,500.00";
String signature = "12345678";
int result = DatablinkMgmtAPI.DatablinkCheckMobileSignature(authBlob,
values, signature);
System.out.println("Blob updated = " + authBlob.getBlob());
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Mobile Signature Authenticated!");
}
Table 104 - DatablinkCheckMobileSignature Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("h5/4D3Jm2xXL0E0b8eY4B4fiJDr1s85nWOIcNDKuPCeoUmSIg02LqAtFqD
IotPE1Ck4Cl6HrSORarATy7JnlEZJbIo8ySnXfPVj8cExsiOhOhEetnh3j6NQKR6zImM2zxP/A
+1zxmi+Itb8Y0laq/rxXQflatv0MPJu/FRQiRcDkuIKB9iF78ag5lHWDoHRCCUWMQOhM59wcco
hr42MuIcrfWXfUaVoszE05o+pfpwUA");
String values = "1234-51,500.00";
String signature = "12345678";
int result = DatablinkMgmtAPI.DatablinkCheckMobileSignature(authBlob,
values, signature);
Console.WriteLine("Blob updated = " + authBlob.Blob);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Mobile Signature Authenticated!");
}
Table 105 - DatablinkCheckMobileSignature C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
137
5.1.5.7 DatablinkCheckDeviceSignature
The DatablinkCheckDeviceSignature function is used to validate an eSignature generated by
transaction values previously defined through the DatablinkGenDeviceSigningCmd function.
If the transaction data has not been defined yet, the function will return an error.
Signature:
C++ uint DatablinkCheckDeviceSignature(char* ioBlob, char iTransactionID, char
iNumValues, __int64 iValues[], char* iSignature)
Java public static int DatablinkCheckDeviceSignature(DATABLINK_BLOB
ioBlob, byte iTransactionID, long[] iValues, String iSignature)
C# public static int DatablinkCheckDeviceSignature(DATABLINK_BLOB ioBlob, byte
iTransactionID, long[] iValues, String iSignature)
Table 106 - DatablinkCheckDeviceSignature Signature
Parameter(s):
• ioBlob (i/o): Token authentication blob to be used on the eSignature validation.
After calling this function, its contents are changed and the blob should be stored
back into the database.
• iTransactionID (i): identifier of the transaction that is currently being used to sign,
according to the token programming sheet. It should be a value between 1 and 10.
• iNumValues (i): number of values to be passed through the iValues[] parameter.
This number of values should respect the pre-defined programming parameters and
reflect the chosen transaction.
• iValues (i): list with transaction values. In case of decimal numbers (transaction
amount, with cents), the decimal point should be ignored, and always add the 2
digits that would come just after the decimal point, even if zeros. For example, the
$ 540.70 value should be represented by the number "54070". Other example, in
case of $ 100.00, it should be presented as "10000".
• iSignature (i): eSignature generated by the token, based on the transaction values,
and typed by the user, represented as a string.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
138
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"wfGzA4/T3ikrJ2I/fCBn1fkdCAGEPYvlA+aAVBgKCZ2i+NW/rA474fHWRE1JMZ2iAOXveT3xs
vfe91pN8nnAZyC+NraO2HBM9+buDj1QbJ7lS5QYXlz8aHn7o+pLg55i+XrSKAltkmEtYeAVbo/Tk8IaeksT5/RhUJ0AsoJliG0m/lvPoZvA+mkDX05fHgcIFT/9awugTI0NMdOhIHkhVJzaq01Ft
gs+SJLqWXFK4QRQ", blobSize);
uint8_t transactionID = 1;
const uint8_t numValues = 4;
int64_t values[numValues] = { 123, 1234, 123456, 50000 };
int32_t blinkBytesSize = 512;
uint8_t* blinkBytes = (uint8_t*) malloc(blinkBytesSize);
memset(blinkBytes, 0, blinkBytesSize);
char* signature = "12345678";
uint32_t result = DatablinkCheckDeviceSignature(authBlob, transactionID,
numValues, values, signature);
printf("\n Blob updated = %s", authBlob);
if (result != SUCCESS){
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}else{
printf("\n Device Signature Authenticated!");
}
free(blinkBytes);
Table 107 - DatablinkCheckDeviceSignature C++ Sample Code
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"h5/4D3Jm2xXL0E0b8eY4B4fiJDr1s85nWOIcNDKuPCeoUmSIg02LqAtFqDIotPE1Ck4Cl6HrS
ORarATy7JnlEZJbIo8ySnXfPVj8cExsiOhOhEetnh3j6NQKR6zImM2zxP/A+1zxmi+Itb8Y0la
q/rxXQflatv0MPJu/FRQiRcDkuIKB9iF78ag5lHWDoHRCCUWMQOhM59wccohr42MuIcrfWXfUa
VoszE05o+pfpwUA");
byte transactionID = 1;
long[] values = new long[]{123, 1234, 123456, 50000};
String signature = "12345678";
int result = DatablinkMgmtAPI.DatablinkCheckDeviceSignature(authBlob,
transactionID, values, signature);
System.out.println("Blob updated = " + authBlob.getBlob());
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Device Signature Authenticated!");
}
Table 108 - DatablinkCheckDeviceSignature Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
139
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("wfGzA4/T3ikrJ2I/fCBn1fkdCAGEPYvlA+aAVBgKCZ2i+NW/rA474fHWRE
1JMZ2iAOXveT3xsvfe91pN8nnAZyC+NraO2HBM9+buDj1QbJ7lS5QYXlz8aHn7o+pLg55i+XrS
KAltkmEtYeAVbo/Tk8IaeksT5/RhUJ0AsoJliG0m/lvPoZvA+mkDX05fHgcIFT/9awugTI0NMd
OhIHkhVJzaq01Ftgs+SJLqWXFK4QRQ");
byte transactionID = 1;
long[] values = new long[] { 123, 1234, 123456, 50000 };
string signature = "12345678";
int result = DatablinkMgmtAPI.DatablinkCheckDeviceSignature(authBlob,
transactionID, values, signature);
Console.WriteLine("Blob updated = " + authBlob.Blob);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Device Signature Authenticated!");
}
Table 109 - DatablinkCheckDeviceSignature C# Sample Code
5.1.5.8 DatablinkGenOTP
The DatablinkGenOTP function is used to generate a dynamic password (OTP) from a Mobile
50 token, to be sent over an email, SMS or any other option available.
Signature:
C++ unsigned int DatablinkGenOTP(char* ioAuthBlob, char* oOTP);
Java public static int DatablinkGenOTP(AuthenticationBlob ioAuthBlob,
StringBuilder oOTP);
C# public static int DatablinkGenOTP(AuthenticationBlob ioAuthBlob,
StringBuilder oOTP);
Table 110 - DatablinkGenOTP Signature
Parameter(s):
• ioAuthBlob (i/o): Mobile 50 token authentication blob to be used for generating an
OTP. After calling this function, its contents are changed and the blob should be
stored back into the database.
• oOTP (o): OTP generated to be sent for the user to do the authentication
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
140
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"i6AlwnDiwq/xUTiaAVpLiUsP7P8p7MZGr29c7v9mpTrq7shSnWc33C7MkGAazGo1Kg3u0yLf0
MTbMwkpW82hkbggGAWWOIPlws9OLFEdkre7OSOJt4eYFc6owSAcxHvnHGdTGACubwCVROvKHiE
ztuqcAnwxr+dmf79H9GnYEsmhfG41yoeM7fGA+yC+r36ksZhdiZReQFNbYi3X8uGHO6m+xfrbs
r0RCb/adOGDKnkA", blobSize);
int otpSize = 11;
char* otp = (char*) malloc(otpSize);
memset(otp, 0, otpSize);
uint32_t result = DatablinkGenOTP(authBlob, otp);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n OTP = %s", otp);
printf("\n OTP Generated!");
}
free(otp);
Table 111 - DatablinkGenOTP C++ Sample Code
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"i6AlwnDiwq/xUTiaAVpLiUsP7P8p7MZGr29c7v9mpTrq7shSnWc33C7MkGAazGo1Kg3u0yLf0
MTbMwkpW82hkbggGAWWOIPlws9OLFEdkre7OSOJt4eYFc6owSAcxHvnHGdTGACubwCVROvKHiE
ztuqcAnwxr+dmf79H9GnYEsmhfG41yoeM7fGA+yC+r36ksZhdiZReQFNbYi3X8uGHO6m+xfrbs
r0RCb/adOGDKnkA");
StringBuilder otp = new StringBuilder();
int result = DatablinkMgmtAPI.DatablinkGenOTP(authBlob, otp);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("OTP = " + otp.toString());
System.out.println("OTP Generated!");
}
Table 112 - DatablinkGenOTP Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
141
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("i6AlwnDiwq/xUTiaAVpLiUsP7P8p7MZGr29c7v9mpTrq7shSnWc33C7MkG
AazGo1Kg3u0yLf0MTbMwkpW82hkbggGAWWOIPlws9OLFEdkre7OSOJt4eYFc6owSAcxHvnHGdT
GACubwCVROvKHiEztuqcAnwxr+dmf79H9GnYEsmhfG41yoeM7fGA+yC+r36ksZhdiZReQFNbYi
3X8uGHO6m+xfrbsr0RCb/adOGDKnkA");
StringBuilder otp = new StringBuilder();
int result = DatablinkMgmtAPI.DatablinkGenOTP(authBlob, otp);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("OTP = " + otp.ToString());
Console.WriteLine("OTP Generated!");
}
Table 113 - DatablinkGenOTP C# Sample Code
5.1.5.9 DatablinkChallengeGen
The DatablinkChallengeGen function is used to generate a challenge for a Mobile 200 token.
This challenge will be used to do an advanced authentication.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
Signature:
C++ unsigned int DatablinkChallengeGen(char* ioAuthBlob, unsigned char*
oChallenge, int* ioChallengeSize);
Java public static int DatablinkChallengeGen(AuthenticationBlob
ioAuthBlob, ChallengeResponse oChallengeResponse);
C# public static int DatablinkChallengeGen(AuthenticationBlob ioAuthBlob,
ChallengeResponse oChallengeResponse);
Table 114 - DatablinkChallengeGen C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
142
Parameter(s):• ioAuthBlob (i/o): Mobile 200 token authentication blob to be used for generate the
challenge. After calling this function, its contents are changed and the blob should
be stored back into the database.
• oChallenge (o): Challenge generated to be used during the advanced authentication.
Used only on C++ implementations.
• oChallengeSize (i/o): Challenge generated (oChallenge) size. Used only on C++
implementations.
• oChallengeResponse (o): Challenge generated to be used during the advanced
authentication. Used only on Java and C# implementations.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKCbz4iumOSmFcVpDw
60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwGoOs2V6kpzZPq8G6
pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EKSiFwRrYEBqsaF9h
Sumd71q6TnWzkFg", blobSize);
int32_t challengeSize = 11;
uint8_t* challenge = (uint8_t*) malloc(challengeSize);
memset(challenge, 0, challengeSize);
uint32_t result = DatablinkChallengeGen(authBlob, challenge,
&challengeSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Challenge = %s", (char*) challenge);
printf("\n Challenge Size = %d", challengeSize);
printf("\n Challenge Generated!");
}
free(challenge);
Table 115 - DatablinkChallengeGen C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
143
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKCbz4iumOSmFcVpDw
60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwGoOs2V6kpzZPq8G6
pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EKSiFwRrYEBqsaF9h
Sumd71q6TnWzkFg");
CHALLENGE_ADVANCED_AUT challenge = new CHALLENGE_ADVANCED_AUT();
int result = DatablinkMgmtAPI.DatablinkChallengeGen(authBlob, challenge);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Challenge = " +
challenge.getChallengeAdvancedAut());
System.out.println("Challenge Generated!");
}
Table 116 - DatablinkChallengeGen Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKC
bz4iumOSmFcVpDw60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwG
oOs2V6kpzZPq8G6pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EK
SiFwRrYEBqsaF9hSumd71q6TnWzkFg");
CHALLENGE_ADVANCED_AUT challengeResp = new CHALLENGE_ADVANCED_AUT();
int result = DatablinkMgmtAPI.DatablinkChallengeGen(authBlob,
challengeResp);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Challenge = " +
challengeResp.ChallengeAdvancedAut);
Console.WriteLine("Challenge Generated!");
}
Table 117 - DatablinkChallengeGen C# Sample Code
5.1.5.10 DatablinkChallengeResponseCmdGen
The DatablinkChallengeResponseCmdGen function is used to generate a challenge for a
Device 200 token. This challenge will be used to do an advanced authentication and is
contained into the blinking command generated.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
144
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
Signature:
C++ unsigned int DatablinkChallengeResponseCmdGen(char* ioAuthBlob, unsigned
char* oCommandBlink, int* ioCommandBlinkSize, unsigned char* oChallenge, int*
ioChallengeSize);
Java public static int
DatablinkChallengeResponseCmdGen(AuthenticationBlob ioAuthBlob,
CommandBlink oCommandBlink, ChallengeResponse oChallengeResponse);
C# public static int DatablinkChallengeResponseCmdGen(AuthenticationBlob
ioAuthBlob, CommandBlink oCommandBlink, ChallengeResponse
oChallengeResponse);
Table 118 - DatablinkChallengeResponseCmdGen Signature
Parameter(s):
• ioAuthBlob (i/o): Device 200 token authentication blob to be used for generating
the challenge. After calling this function, its contents are changed and the blob
should be stored back into the database.
• oCommandBlink (o): Blinking command generated with the challenge.
0 - Present black color for 60ms 1 - Present white color for 60ms
Example:
oNumBlinkBytes = 3
oBlinkBytes[0]: 0x0A (0000 1010)
oBlinkBytes[1]: 0x29 (0010 1001)
oBlinkBytes[2]: 0xF0 (1111 0000)
Present the following bits every 60ms: 0000 1010 0010 1001 1111 0000
Meaning:
0000 = black, black, black, black
1010 = white, black, white, black
0010 = black, black, white, black
1001 = white, black, black, white
1111 = white, white, white, white
0000 = black, black, black, black
For C# and Java, the same data will be presented as a string, such as:
"000010100010100111110000"
• ioCommandBlinkSize (i/o): Blinking command (oCommandBlink) size. Used only on
C++ implementations.
• oChallenge (o): Challenge generated.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
145
• ioChallengeSize (i/o): Challenge generated (oChallenge) size. Used only on C++
implementations.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
int32_t commandSize = 256;
uint8_t* command = (uint8_t*) malloc(commandSize);
int32_t challengeSize = 11;
uint8_t* challenge = (uint8_t*) malloc(challengeSize);
memset(command, 0, commandSize);
memset(challenge, 0, challengeSize);
uint32_t result = DatablinkChallengeResponseCmdGen(authBlob, command,
&commandSize, challenge, &challengeSize);
if (result != SUCCESS){
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}else{
printf("\n Blob updated = %s", authBlob);
printf("\n Challenge = %s", (char*) challenge);
printf("\n Challenge Size = %d", challengeSize);
printf("\n Command = ");
for (int32_t i = 0; i < commandSize; i++)
{
printf("%02X ", command[i]);
}
printf("\n Command Size = %d", commandSize);
std::string sequence = "";
for (int i= 0; i < commandSize; i++)
{
for (int j = 7; j >= 0; j--)
{
sequence += (((command[i] >> j) & 0x01) == 1 ? "1" : "0");
}
}
printf("\n Blinking sequence = %s", sequence.c_str( ));
printf("\n Device Challenge Command Generated!");
}
free(command);
free(challenge);
Table 119 - DatablinkChallengeResponseCmdGen C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
146
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
CHALLENGE_ADVANCED_AUT challenge = new CHALLENGE_ADVANCED_AUT();
COMMAND commandBlink = new COMMAND();
int result = DatablinkMgmtAPI.DatablinkChallengeResponseCmdGen(authBlob,
commandBlink, challenge);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Challenge = " +
challenge.getChallengeAdvancedAut());
System.out.println("Command = " + commandBlink.getBitsSequence());
System.out.println("Device Challenge Command Generated!");
}
Table 120 - DatablinkChallengeResponseCmdGen Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
CHALLENGE_ADVANCED_AUT challenge = new CHALLENGE_ADVANCED_AUT();
COMMAND commandBlink = new COMMAND();
int result = DatablinkMgmtAPI.DatablinkChallengeResponseCmdGen(authBlob,
commandBlink, challenge);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Challenge = " + challenge.ChallengeAdvancedAut);
Console.WriteLine("Command = " + commandBlink.BitsSequence);
Console.WriteLine("Device Challenge Command Generated!");
}
Table 121 - DatablinkChallengeResponseCmdGen C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
147
5.1.5.11 DatablinkSetChallenge
The DatablinkSetChallenge function is used to generate to set a challenge in a Mobile 200
token. This challenge will be used to do an advanced authentication.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
Signature:
C++ unsigned int DatablinkSetChallenge(char* ioAuthBlob, unsigned char*
iChallenge, int* iChallengeSize);
Java public static int DatablinkSetChallenge(AuthenticationBlob
ioAuthBlob, ChallengeResponse iChallenge);
C# public static int DatablinkSetChallenge(AuthenticationBlob ioAuthBlob,
ChallengeResponse iChallenge);
Table 122 - DatablinkSetChallenge Signature
Parameter(s):
• ioAuthBlob (i/o): Mobile 200 token authentication blob for set the challenge. After
calling this function, its contents are changed and the blob should be stored back
into the database.
• iChallenge (i): Challenge to be setted in the authentication blob.
• iChallengeSize (i): Size of the challenge to be setted (iChallenge). Used only for C++
implementations.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
148
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKCbz4iumOSmFcVpDw
60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwGoOs2V6kpzZPq8G6
pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EKSiFwRrYEBqsaF9h
Sumd71q6TnWzkFg", blobSize);
int32_t challengeSize = 11;
char* challenge = (char*) malloc(challengeSize);
memset(challenge, 0, challengeSize);
sprintf_s(challenge, challengeSize, "%s", "123456");
uint32_t result = DatablinkSetChallenge(authBlob, (uint8_t*) challenge,
&challengeSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Challenge Setted!");
}
free(challenge);
Table 123 - DatablinkSetChallenge C++ Sample Code
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKCbz4iumOSmFcVpDw
60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwGoOs2V6kpzZPq8G6
pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EKSiFwRrYEBqsaF9h
Sumd71q6TnWzkFg");
CHALLENGE_ADVANCED_AUT challenge = new CHALLENGE_ADVANCED_AUT();
challenge.setChallengeAdvancedAut("123456");
int result = DatablinkMgmtAPI.DatablinkSetChallenge(authBlob, challenge);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Challenge Setted!");
}
Table 124 - DatablinkSetChallenge Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
149
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKC
bz4iumOSmFcVpDw60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwG
oOs2V6kpzZPq8G6pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EK
SiFwRrYEBqsaF9hSumd71q6TnWzkFg");
CHALLENGE_ADVANCED_AUT challenge = new CHALLENGE_ADVANCED_AUT();
challenge.ChallengeAdvancedAut = "123456";
int result = DatablinkMgmtAPI.DatablinkSetChallenge(authBlob, challenge);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Challenge Setted!");
}
Table 125 - DatablinkSetChallenge C# Sample Code
5.1.5.12 DatablinkCheckResponse
The DatablinkCheckResponse function is used to validate a challenge generated previously
through the DatablinkChallengeGen or DatablinkChallengeResponseCmdGen functions. If
the challenge has not been defined yet, the function will return an error.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
This function is applicable for tokens Device 200 and Mobile 200.
Signature:C++ unsigned int DatablinkCheckResponse(char* ioAuthBlob, char* iResponse);
Java public static int DatablinkCheckResponse(AuthenticationBlob
ioAuthBlob, String iReponse);
C# public static int DatablinkCheckResponse(AuthenticationBlob ioAuthBlob, string
iReponse);
Table 126 - DatablinkCheckResponse Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
150
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be used on the response validation.
After calling this function, its contents are changed and the blob should be stored
back into the database.
• iResponse (i): Response to a challenge generated by the token.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKCbz4iumOSmFcVpDw
60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwGoOs2V6kpzZPq8G6
pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EKSiFwRrYEBqsaF9h
Sumd71q6TnWzkFg", blobSize);
char* response = "123456";
uint32_t result = DatablinkCheckResponse(authBlob, response);
printf("\n Blob updated = %s", authBlob);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Response Authenticated!");
}
Table 127 - DatablinkCheckResponse C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
151
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKCbz4iumOSmFcVpDw
60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwGoOs2V6kpzZPq8G6
pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EKSiFwRrYEBqsaF9h
Sumd71q6TnWzkFg");
String response = "123456";
int result = DatablinkMgmtAPI.DatablinkCheckResponse(authBlob, response);
System.out.println("Blob updated = " + authBlob.getBlob());
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Response Authenticated!");
}
Table 128 - DatablinkCheckResponse Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("t6rpoewlrt1kAzkiStOpvthihOri9/eEGUxEljERfQg64v7vYRZa3JpDKC
bz4iumOSmFcVpDw60gJgFiuMwBO6Gyli1gj/1Vgzj5EIGl3Fg+yFhuch5DobmNMXHxAF1ECzwG
oOs2V6kpzZPq8G6pRJ4Nb9ca2YflzzWCvxCmj0hV70IPQ8afe7JcckUz25o1tYvy+Q6SB4/2EK
SiFwRrYEBqsaF9hSumd71q6TnWzkFg");
string response = "132456";
int result = DatablinkMgmtAPI.DatablinkCheckResponse(authBlob, response);
Console.WriteLine("Blob updated = " + authBlob.Blob);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Response Authenticated!");
}
Table 129 - DatablinkCheckResponse C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
152
5.1.6 Synchronism
In this section are located the explanation about how to synchronize the token.
5.1.6.1 DatablinkOpenTokenWindow
The DatablinkOpenTokenWindow function is used to define a time window, in hours, for a
specific token, to be used in the next authentication. Regarding of whether there is a
successful authentication or sync, this temporary time window is voided after the OTP
validation function is called.
The synchronism process can be done simultaneously with OTP validation by using the
DatablinkSyncCheckOTP function, or through the use of two consecutive OTPs, with
DatablinkSyncToken function.
The authentication blob passed through this function is changed, so it must be stored back to
the database after the function is called, no matter the result.
Signature:
C++ unsigned int DatablinkOpenTokenWindow(char* ioByteBlob, int iWindow);
Java public static int DatablinkOpenTokenWindow(AuthenticationBlob
ioAuthBlob, int iWindow);
C# public static int DatablinkOpenTokenWindow(AuthenticationBlob ioAuthBlob,
int iWindow);
Table 130 - DatablinkOpenTokenWindow Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to have its internal time window
changed. After calling this function, its contents are changed and the blob should be
stored back into the database.
• iWindow (i): time window, in hours, within time variations are accepted for
authentication and synchronism purposes, in the next authentication. This value
should be between 0 and 120 hours.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
153
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
int32_t window = 12;
uint32_t result = DatablinkOpenTokenWindow(authBlob, window);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Window Opened!");
}
Table 131 - DatablinkOpenTokenWindow C++ Sample Code
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
int window = 12;
int result = DatablinkMgmtAPI.DatablinkOpenTokenWindow(authBlob, window);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Window Opened!");
}
Table 132 - DatablinkOpenTokenWindow Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
154
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
int window = 12;
int result = DatablinkMgmtAPI.DatablinkOpenTokenWindow(authBlob,window);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Window Opened!");
}
Table 133 - DatablinkOpenTokenWindow C# Sample Code
5.1.6.2 DatablinkSyncToken
The DatablinkSyncToken function is used to synchronize a token, by using two consecutive
dynamic one-time passwords (OTPs), up to 24 hours before and after GMT.
The synchronism can be used simultaneously with an OTP validation through the
DatablinkSyncCheckOTP function, or by opening a token's time window for its next
authentication through the DatablinkOpenTokenWindow function.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
Signature:
C++ unsigned int DatablinkSyncToken(char* ioAuthBlob, char* iOTP1, char* iOTP2);
Java public static int
DatablinkSyncToken(AuthenticationBlob ioAuthBlob, String
iOTP1, String iOTP2);
C# public static int DatablinkSyncToken(AuthenticationBlob ioAuthBlob, string
iOTP1, string iOTP2);
Table 134 - DatablinkSyncToken Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
155
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be synchronized. After calling this
function, its contents are changed and the blob should be stored back into the
database.
• iOTP1 (i): OTP typed by the user, at the moment the synchronism should happen.
• iOTP2 (i): OTP typed by the user, after the first OTP was generated.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
char authBlob[TOKEN_BLOB_SIZE + 1] = { 0 };//we use +1 because the string terminator
strcpy(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcTgkSIW2rFu9
Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5
IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2oY/o1HXbZYIrCLfg");
char* otp1 = "020741"; char* otp2 = "873968";
uint32_t result = DatablinkSyncToken(authBlob, otp1,
otp2);
if (result != SUCCESS){ int32_t messageSize = 512; char* message =
(char*)malloc(messageSize); memset(message, 0, messageSize);
Table 135 - DatablinkSyncToken C++ Sample Code
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
String otp1 = "020741";
String otp2 = "873968";
int result = DatablinkMgmtAPI.DatablinkSyncToken(authBlob, otp1, otp2);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Token Synchronized!");
}
Table 136 - DatablinkSyncToken Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
156
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
string otp1 = "020741";
string otp2 = "873968";
int result = DatablinkMgmtAPI.DatablinkSyncToken(authBlob, otp1, otp2);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Token Synchronized!");
}
Table 137 - DatablinkSyncToken C# Sample Code
5.1.6.3 DatablinkSyncCheckOTP
The DatablinkSyncCheckOTP function is used to authenticate a user, at the same time
synchronizing the token, using a larger than normal time window.
The synchronism process can also be done by using two consecutive OTPs through the
DatablinkSyncToken the DatablinkOpenWindow function.
The authentication blob passed through this function is changed, so it must be stored back
to the database after the function is called, no matter its result.
Signature:
C++ unsigned int DatablinkSyncCheckOTP(char* ioAuthBlob, int iWindow, char* iOTP);
Java public static int DatablinkSyncCheckOTP(AuthenticationBlob
ioAuthBlob, int iWindow, String iOTP);
C# public static int DatablinkSyncCheckOTP(AuthenticationBlob ioAuthBlob, int
iWindow, string iOTP);
Table 138 - DatablinkSyncCheckOTP Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
157
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob to be used when authenticating the
user (OTP validation). After calling this function, its contents are changed and the
authentication blob should be stored back into the database.
• iWindow (i): Time window, in hours, within time variations are accepted for
authentication and synchronism purposes. Typically, this time window will be wider
than the one defined through the token runtime parameters (global parameters),
since this function should be exclusively used for authentication while synchronizing
the token. This value should be between 0 and 120 hours.
• iOTP (i): "One-Time Password", or "Unique Password". Dynamic password typed by
the user, represented as a string.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
int32_t window = 12;
char* otp = "701521";
uint32_t result = DatablinkSyncCheckOTP(authBlob, window, otp);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Token Synchronized!");
}
Table 139 - DatablinkSyncCheckOTP C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
158
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
int window = 12;
String otp = "701521";
int result = DatablinkMgmtAPI.DatablinkSyncCheckOTP(authBlob, window,
otp);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Token Synchronized!");
}
Table 140 - DatablinkSyncCheckOTP Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
int window = 12;
string otp = "701521";
int result = DatablinkMgmtAPI.DatablinkSyncCheckOTP(authBlob, window,
otp);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Token Synchronized!");
}
Table 141 - DatablinkSyncCheckOTP C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
159
5.1.6.4 DatablinkResetTimeDrift
The DatablinkResetTimeDrift is used to reset a token time drift. This function should be
called only if the token's internal GMT Time was adjusted to use the server time (e.g.: by
using the blinking GMT adjustment command, or if the MOBILE 200 token has been
synchronized with the server). If the command was issued but the user did not actually
present the token to read and receive this command, calling this function will actually
unsync the token. Therefore, it is necessary to issue a sync function or ask the user to read it
again to fix its internal GMT time.
If this function is not called after the token's internal GMT time is fixed, the token might go
out-of-sync since the blob will still contain the last registered time drift.
The authentication blob that is passed to this function is changed, so it should be stored
back to the database after the function is called.
Signature:
C++ unsigned int DatablinkResetTimeDrift(char* ioAuthBlob);
Java public static int DatablinkResetTimeDrift(AuthenticationBlob
ioAuthBlob);
C# public static int DatablinkResetTimeDrift(AuthenticationBlob ioAuthBlob);
Table 142 - DatablinkResetTimeDrift Signature
Parameter(s):
• ioAuthBlob (i/o): Token authentication blob, that will have its internal time drift
parameter reset. After calling this function, its contents are changed and the blob
should be stored back into the database.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
160
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because of the C string
terminator
strncpy_s(authBlob,
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg", blobSize);
uint32_t result = DatablinkResetTimeDrift(authBlob);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob updated = %s", authBlob);
printf("\n Time Drift Reseted!");
}
Table 143 - DatablinkResetTimeDrift C++ Sample Code
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy64xHhPZO+K6HMwcT
gkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN35jMsuhqdRWjp4p1
9qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0tMT2QArblOylZf2o
Y/o1HXbZYIrCLfg");
int result = DatablinkMgmtAPI.DatablinkResetTimeDrift(authBlob);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob updated = " + authBlob.getBlob());
System.out.println("Time Drift Reseted!");
}
Table 144 - DatablinkResetTimeDrift Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
161
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("n6j1f7/QRRT7Gk2k/qY98oIHaZ8AJsy1JN451/+94C8b4n391n91GBNEy6
4xHhPZO+K6HMwcTgkSIW2rFu9Eh//K0cHrIwbllSXZvYkEMK1arEYhbBnbgFHAo2NTE7EcfkN3
5jMsuhqdRWjp4p19qrnW/Q9DWH1c+Vfh7W5IfpDTpQNTqNewKtGkmde0c2ndBmOEE1Pp0S4L0t
MT2QArblOylZf2oY/o1HXbZYIrCLfg");
int result = DatablinkMgmtAPI.DatablinkResetTimeDrift(authBlob);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob updated = " + authBlob.Blob);
Console.WriteLine("Time Drift Reseted!");
}
Table 145 - DatablinkResetTimeDrift C# Sample Code
5.1.7 Functions utilities
Below are presented the functions utilities, this means the functions to be used to get
information from Datablink Management API.
5.1.7.1 DatablinkMgmtAPIVersion
The DatablinkMgmtAPIVersion function is used to get the API version which is being used.
For C# implementations this function was changed to a property.
Signature:
C++ void DatablinkMgmtAPIVersion(char* oVersion, int iMaxSize);
Java public static String DatablinkMgmtAPIVersion();
C# public static string DatablinkMgmtAPIVersion();
Table 146 - DatablinkMgmtAPIVersion Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
162
Parameter(s):
• oVersion (o): Output parameter to be filled with the actual API version. Used only
by implementations using C and C++.
• iMaxSize (i): Size of the string with the API version. Since this string has a variable
size, this parameter should indicate the maximum size possible to be filled within
the oVersion variable. If there is no sufficient space to fill the message inside the
oVersion variable, the variable will be filled with the quantity of characters indicated
by iMaxSize. Used only by implementations using C and C++.
Returns:
Java/C#
Current Datablink Management API version
Table 147 - DatablinkMgmtAPIVersion Java / C# Return
Use example:
C++
int32_t versionSize = 256;
char* version = (char*) malloc(versionSize);
memset(version, 0, versionSize);
DatablinkMgmtAPIVersion(version, versionSize);
printf("\n Version = %s", version);
free(version);
Table 148 - DatablinkMgmtAPIVersion C++ Sample Code
Java
String version = DatablinkMgmtAPI.DatablinkMgmtAPIVersion();
System.out.println("Version = " + version);
Table 149 - DatablinkMgmtAPIVersion Java Sample Code
C#
Console.WriteLine("Version = " +
DatablinkMgmtAPI.DatablinkMgmtAPIVersion());
Table 150 - DatablinkMgmtAPIVersion C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink163
5.1.7.2 DatablinkErrorMessage
Function responsible to get the message related to a return code of Datablink Management
API.
Signature:
C++ void DatablinkErrorMessage(unsigned int iError, char* oMessage, int
iMaxMsgSize, int iLanguage);
Java public static String DatablinkErrorMessage(int iError, int
iLanguage);
C# public static string DatablinkErrorMessage(int iError, int iLanguage);
Table 151 - DatablinkErrorMessage Signature
Parameter(s):
• iError (i): Code to get the message.
• oMessage (o): Output parameter with the message related to the code (iError). Used
only by implementations using C and C++.
• iMaxMsgSize (i/o): Parameter with the maximum size (size allocated) to be filled on
oMessag. Used only by implementations using C and C++.
• iLanguage (i): Language in which the return message is desired.
Returns:
Java/C#
Text with the message related to the code iCode.
Table 152 - DatablinkErrorMessage Java / C# Return
Use example:
C++
int result = ERR_AUTHENTICATION;
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error Message: %i = %s", result, message);
free(message);
Table 153 - DatablinkErrorMessage C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
164
Java
System.out.println("Error = " +
DatablinkMgmtAPI.DatablinkErrorMessage(DatablinkMgmtAPIErrorCodes.ERR_AUTH
ENTICATION, DatablinkMgmtAPIConst.LANG_ENGLISH));
Table 154 - DatablinkErrorMessage Java Sample Code
C#
int result = DatablinkMgmtAPIErrorCodes.ERR_AUTHENTICATION;
Console.WriteLine("Error Message: " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
Table 155 - DatablinkErrorMessage C# Sample Code
5.1.8 HSM functions
In this section are the functions created to integrate the Datablink Management API with
Hardware Security Modules (HSM).
These functions are only available on Datablink Management API for Windows.
5.1.8.1 DatablinkReadParmsHSM
The DatablinkReadParmsHSM function presents the Datablink Management runtime
utilization parameters for the HSM connection, if defined, in execution time. The HSM
parameters, according to the PKCS #11 basic rules, should have the slot number where the
key is, the PKCS#11 interface .DLL path (provided by the HSM manufacturer), the key name,
and the password. Since the password is confidential information, it is not returned by this
function.
Signature:
C++ bool DatablinkReadParmsHSM(unsigned int* oSlot, char* oCryptokiPath, int
iSizeCryptokiPath, char* oKeyName, int iSizeKeyName);
Java public static boolean DatablinkReadParmsHSM (IntByReference oSlot,
StringBuilder oCryptokiPath, StringBuilder oKeyName);
C# public static bool DatablinkReadParmsHSM(ref int oSlot, StringBuilder
oCryptokiPath, StringBuilder oKeyName);
Table 156 - DatablinkReadParmsHSM Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
165
Parameter(s):
• oSlot (o): receives the slot number of the HSM where the key is located.
• oCryptokiPath (o): receives the full path, including the .DLL name, of the PKCS#11 .DLL to
be used. This library is usually provided by the HSM vendor.
• iSizeCryptokiPath (i): maximum size of the oCryptokiPath field. If the string is longer than
the maximum size, only the first <iSizeCryptokiPath - 1> characters will be copied.
oKeyName (o): receives the name of the key to be used.
• iSizeKeyName (i): maximum size of the oKeyName field. If the string is longer than the
maximum size, only the first <iSizeKeyName - 1> characters will be copied.
Returns: TRUE - The values are set, and the HSM is currently in use
FALSE - The values could be eventually set, but the HSM is currently not in
use, either because the values are not set, they are not correct, or the
function DatablinkEnableHSM wasn't called yet
Use example:
C++
uint32_t slot = 0;
int32_t cryptokiPathSize = 256;
char* cryptokiPath = (char*) malloc(cryptokiPathSize);
memset(cryptokiPath, 0, cryptokiPathSize);
int32_t keyNameSize = 256;
char* keyName = (char*) malloc(keyNameSize);
memset(keyName, 0, keyNameSize);
bool result = DatablinkReadParmsHSM(&slot, cryptokiPath, cryptokiPathSize,
keyName, keyNameSize);
if (!result)
{
printf("\n\t Error to read HSM parameters");
}
else
{
printf("==== HSM parameters ====");
printf("\n\t Slot = %d", slot);
printf("\n\t Cryptoki path = %s", cryptokiPath);
printf("\n\t Key name = %s", keyName);
}
free(cryptokiPath);
free(keyName);
Table 157 - DatablinkReadParmsHSM C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
166
Java
IntByReference slot = new IntByReference();
StringBuffer cryptokiPath = new StringBuffer();
StringBuffer keyName = new StringBuffer();
boolean result = DatablinkMgmtAPI.DatablinkReadParmsHSM(slot,
cryptokiPath, keyName);
if(!result){
System.out.println("Error to read HSM parameters");
}else{
System.out.println("==== HSM parameters ====");
System.out.println("\t Slot = " + slot.getValue());
System.out.println("Criptoki path = " + cryptokiPath.toString());
System.out.println("\t Key name = " + keyName.toString());
}
Table 158 - DatablinkReadParmsHSM Java Sample Code
C#
int slot = -1;
StringBuilder cryptokiPath = new StringBuilder();
StringBuilder keyName = new StringBuilder();
bool result = DatablinkMgmtAPI.DatablinkReadParmsHSM(ref slot,
cryptokiPath, keyName);
if (!result)
{
Console.WriteLine("Error to read HSM parameters");
}
else
{
Console.WriteLine("==== HSM Parameters ====");
Console.WriteLine("\t Slot = " + slot);
Console.WriteLine("Criptoki path = " + cryptokiPath.ToString());
Console.WriteLine("\t Key name = " + keyName.ToString());
Table 159 - DatablinkReadParmsHSM C# Sample Code
5.1.8.2 DatablinkWriteParmsHSM
The DatablinkWriteParmsHSM function is used to define the Datablink Management
runtime utilization parameters for the HSM connection, in execution time. The HSM
parameters, according to the PKCS #11 basic rules, should have the key's slot number, the
PKCS#11 interface .DLL path (provided by the HSM manufacturer), the key name, and the
password needed to access and use the key within the HSM. The key should be an AES-256
key.
Even though it is defined through this function, the parameters are not tested before the
function DatablinkEnableHSM is called. So, to make sure the parameters are correct, call
this function after defining the HSM parameters and get the results to make sure it was
enabled. If it did not work, note the error that was returned.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
167
When calling this function, if the iMem parameter is set to FALSE, the parameters are also
changed in the Windows registry or Linux .conf file to maintain storage of the most recently
defined parameters. If iMem is set to TRUE, the parameters are only changed during
runtime (in memory).
If you are not using memory storage, you can avoid inconsistency within the values by first
calling DatablinkReadParmsHSM to get actual values,changing only the desired fields and
then storing the updated parameters.
Signature:
C++ unsigned int DatablinkWriteParmsHSM(char* iDllwithPath, unsigned int iSlot,
char* iKeyName, char* iPassword, bool iMem);
Java public static int DatablinkWriteParmsHSM(String iDllwithPath, int
iSlot, String iKeyName, String iPassword, boolean iMem);
C# public static int DatablinkWriteParmsHSM(string iDllwithPath, int iSlot,
string iKeyName, string iPassword, bool iMem);
Table 160 - DatablinkWriteParmsHSM C++ Sample Code
Parameter(s):
• iDllwithPath (i): full path with the DLL name, of the PKCS#11 dll to be used. This
library is usually provided by the HSM vendor.
• iSlot (i): slot number of the HSM where the key is located.
• iKeyName (i): name of the AES-256 key to be used.
• iPassword (i): password needed to use the key within the HSM, or blank if no
password is needed.
• iMem (i): if “true”, will only store the parameters in memory, and will not try to
store in the registry.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
168
Use example:
C++
char* dllPath = "C:\\Program Files (x86)\\SafeNet\\ProtectToolkit C
SDK\\bin\\sw\\cryptoki.dll";
uint32_t slot = 0;
char* keyName = "dtbswkey";
char* password = "1234";
bool memory = false;
uint32_t result = DatablinkWriteParmsHSM(dllPath, slot, keyName, password,
memory);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Parameters updated!");
}
Table 161 - DatablinkWriteParmsHSM C++ Sample Code
Java
String dllPath = "C:\\Program Files (x86)\\SafeNet\\ProtectToolkit C
SDK\\bin\\sw\\cryptoki.dll";
int slot = 0;
String keyName = "brtswkey";
String password = "1234";
boolean memory = false;
int result = DatablinkMgmtAPI.DatablinkWriteParmsHSM(dllPath, slot,
keyName, password, memory);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Parameters Updated!");
}
Table 162 - DatablinkWriteParmsHSM Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
169
C#
string dllPath = @"C:\Program Files (x86)\SafeNet\ProtectToolkit C
SDK\bin\sw\cryptoki.dll";
int slot = 0;
string keyName = "brtswkey";
string password = "1234";
bool memory = false;
int result = DatablinkMgmtAPI.DatablinkWriteParmsHSM(dllPath, slot,
keyName, password, memory);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Parameters Updated!");
}
Table 163 - DatablinkWriteParmsHSM C# Sample Code
5.1.8.3 DatablinkEnableHSM
The DatablinkEnableHSM function is used to enable a connection between the Datablink
Management API and the HSM, using the parameters defined through the
DatablinkWriteParmsHSM function and possible to see through the
DatablinkReadParmsHSM.
If the connection is successful, the HSM starts to be used immediately, so the API can use it
to encrypt and decrypt all blobs.
If the connection is not possible for any reason, the return code should be verified; it could
either carry a common error, or an HSM-specific error.
If the HSM is being used, every time the API is loaded, the application should call this
function to establish a connection to the HSM, thus making sure it is available.
Signature:
C++ unsigned int DatablinkEnableHSM(bool iEnable);
Java public static int DatablinkEnableHSM(boolean iEnable);
C# public static int DatablinkEnableHSM(bool iEnable);
Table 164 - DatablinkEnableHSM Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
170
Parameter(s):
• iEnable (i): If TRUE, will try to connect to the HSM using the pre-defined parameters.
If FALSE, will force to disconnect to it.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
bool enabled = false;
uint32_t result = DatablinkEnableHSM(enabled);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n HSM enabled!");
}
Table 165 - DatablinkEnableHSM C++ Sample Code
Java
boolean enabled = true;
int result = DatablinkMgmtAPI.DatablinkEnableHSM(enabled);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("HSM Enabled!");
}
Table 166 - DatablinkEnableHSM Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
171
C#
bool enabled = true;
int result = DatablinkMgmtAPI.DatablinkEnableHSM(enabled);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("HSM Enabled!");
}
Table 167 - DatablinkEnableHSM C# Sample Code
5.1.8.4 DatablinkBlobConversionHSM
The DatablinkBlobConversionHSM function is used to convert an authentication blob that
was previously encrypted only by the Datablink Management API (software based
encryption), into an HSM-encrypted blob. It is usually needed when the HSM is being
implemented on a running implementation of Datablink Management API, where you have
blobs already in your database. Once the HSM parameters are defined, and the HSM
connection is established, this function could be used in a batch application to convert all
database blobs into HSM encrypted blobs.
In order to use this function, the HSM connection has to be established.
For new tokens, imported through the DatablinkDecryptKeyFile function, there is no need
to call this function since it will automatically encrypt into an HSM blob once the connection
is made.
Signature:
C++ unsigned int DatablinkBlobConversionHSM(char* iRegularBlob, char* oHSMBlob);
Java public static int DatablinkBlobConversionHSM(AuthenticationBlob
ioAuthBlob);
C# public static int DatablinkBlobConversionHSM(AuthenticationBlob ioAuthBlob);
Table 168 - DatablinkBlobConversionHSM Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
172
Parameter(s):
• iRegularAuthBlob (i): Blob already in use, previously encrypted just with the
Datablink Management API. Used only for C++ implementations.
• oHSMAuthBlob (o): Will receive the same blob, but now encryptedwith the key
from the HSM, ready to be stored back into the database. Used only for C++
implementations.
• ioAuthBlob (i/o): Token authentication blob, that will have the encryption changed
to HSM. This parameter is initially encrypted just with the Datablink Management
API and in the return of the function will be encrypted with the key from HSM.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
const int blobSize = TOKEN_BLOB_SIZE + 1;
char authBlob[blobSize] = { 0 };//we use +1 because the string terminator
char authBlobHSM[TOKEN_BLOB_SIZE + 1] = { 0 };//we use +1 because the
string terminator
strncpy_s(authBlob,
"J1cSADJH959YIYWdhBSHve9mf56d8+iZ9SR+vtWHTqr+ijtkqxTZd9Y3ZgPrZDuSJRsx27nfw
sP4qWlK/i0xCEH2EuL4eKTQ/m8TtGgQiyogOnUuSJ82cwMLKluxf5Gw0qKUlHSlIB07DXD152f
q+vTT7Z1SV0T5cT5eSTsCt0CjhxKgEkv1TR6e7IITTofLD+9BnM1wXtoomPkJaUYxTiwW0eEzw
2pdji2X1bTzV1QB", blobSize);
uint32_t result = DatablinkBlobConversionHSM(authBlob, authBlobHSM);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(result, message, messageSize, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
printf("\n Blob converted = %s", authBlobHSM);
printf("\n Blob HSM Converted!");
}
Table 169 - DatablinkBlobConversionHSM C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
173
Java
DATABLINK_BLOB authBlob = new DATABLINK_BLOB(
"J1cSADJH959YIYWdhBSHve9mf56d8+iZ9SR+vtWHTqr+ijtkqxTZd9Y3ZgPrZDuSJRsx27nfw
sP4qWlK/i0xCEH2EuL4eKTQ/m8TtGgQiyogOnUuSJ82cwMLKluxf5Gw0qKUlHSlIB07DXD152f
q+vTT7Z1SV0T5cT5eSTsCt0CjhxKgEkv1TR6e7IITTofLD+9BnM1wXtoomPkJaUYxTiwW0eEzw
2pdji2X1bTzV1QB");
int result = DatablinkMgmtAPI.DatablinkBlobConversionHSM(authBlob);
if(result != DatablinkMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}else{
System.out.println("Blob Converted = " + authBlob.getBlob());
System.out.println("Blob HSM Converted!");
}
Table 170 - DatablinkBlobConversionHSM Java Sample Code
C#
DATABLINK_BLOB authBlob = new
DATABLINK_BLOB("J1cSADJH959YIYWdhBSHve9mf56d8+iZ9SR+vtWHTqr+ijtkqxTZd9Y3Zg
PrZDuSJRsx27nfwsP4qWlK/i0xCEH2EuL4eKTQ/m8TtGgQiyogOnUuSJ82cwMLKluxf5Gw0qKU
lHSlIB07DXD152fq+vTT7Z1SV0T5cT5eSTsCt0CjhxKgEkv1TR6e7IITTofLD+9BnM1wXtoomP
kJaUYxTiwW0eEzw2pdji2X1bTzV1QB");
int result = DatablinkMgmtAPI.DatablinkBlobConversionHSM(authBlob);
if (result != DatablinkMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error " + result + " = " +
DatablinkMgmtAPI.DatablinkErrorMessage(result,
DatablinkMgmtAPIConst.LANG_ENGLISH));
}
else
{
Console.WriteLine("Blob Converted = " + authBlob.Blob);
Console.WriteLine("Blob HSM Converted!");
}
Table 171 - DatablinkBlobConversionHSM C# Sample Code
5.2 Datablink Management Mobile 200 API
Datablink Management Mobile 200 API functions.
5.2.1 Management functions
In this section are presented all functions used for management the mobile blobs.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
174
5.2.1.1 DatablinkActivate
The DatablinkActivate function is used to activate and deactivate a mobile management
blob. By default, when a blob is first created its status is inactive
(STATUS_MOB200_MGMT_BLOB_INACTIVE).
When the mobile management blob is activated this function change the mobile
management blob status to waiting activation
(STATUS_MOB200_MGMT_BLOB_WAITING_ACTIVATION), this means that this blob is
enabled to realize the activation process. Otherwise if the mobile management blob is
deactivated, the mobile management blob status will be changed to inactive
(STATUS_MOB200_MGMT_BLOB_INACTIVE) again and all dynamic information stored
before in the blob will be erased.
Signature:
C++ int DatablinkActivate(const char* iBlob, const char* iSecurity, const bool
iActivate, char* oBlob, int* ioBlobSize);
Java public static int DatablinkActivate(MobileBlob ioBlob, String
iSecurity, boolean iActivate);
C# public static int DatablinkActivate(MobileBlob ioBlob, string iSecurity,
bool iActivate);
Table 172 - DatablinkActivate Signature
Parameter(s):
• iBlob (i): Input parameter that contains the token mobile blob (management blob
of the mobile app) to be activated/deactivated. Used only by implementations using
C and C++.
• iSecurity (i): Implementation security key defined during the mobile
implementation. This key is used as part of the secret to encrypt the mobile blob
and all communications generated by Datablink Management Mobile 200 API. This
key must be the same key used in mobile app developed.
This key must be defined as a hexadecimal 64-characters string.
• iActivate (i): If "true", activates the mobile management blob. If "false", deactivates.
• oBlob (o): Output parameter that contains the token mobile blob (iBlob) updated.
The value contained should be stored back into the database. Used only by
implementations using C and C++.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
175
• ioBlobSize (i/o): Size of the output blob. Since this blob has a variable size, this
parameter should indicate the maximum string size possible to be filled within the
oBlob variable. If there is no sufficient space to fill the blob inside the oBlob variable,
an error will be generated by this function. Used only by implementations using C
and C++.
• ioBlob (i/o): Parameter that contains the token mobile blob (management blob of
the mobile app) to be activated/deactivated. After calling this function, its contents
are changed and the blob should be stored back into the database. Used only by
implementations using C# and Java.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
char* inputMobBlob =
"OtA0Vuq4yabBDYxbggMAB23Z+HjyGiDr+JMmHnj/9hX5N/tGtNF0dFJw1G9YqKfybdtFGwMrw
EbIvIUe7W9vsHAZ6Wot7sA/EZ8xpcxLVoj0bqp1DIKWvH0EjVFLjt4DbxJFG+X1CQEpiXZFosp
V64HMAVMeBIzPAOAUhKUEXvO3J2eOZlbKOcPHwvB21XfqpsbQ7fJiZ7LnQBbpqkAzrdBxnU0yc
+3nWQrXCt4jZg5hvga4rSdcRLed+g/PqUxL";
const char* clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
bool activate = true;
int32_t outputMobBlobSize = 512;
char* outputMobBlob = (char*) malloc(outputMobBlobSize);
memset(outputMobBlob, 0, outputMobBlobSize);
int32_t result = DatablinkActivate(inputMobBlob, clientImplKey, activate,
outputMobBlob, &outputMobBlobSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(message, messageSize, result, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
outputMobBlob[outputMobBlobSize] = 0;
printf("\n Blob mobile updated = %s", outputMobBlob);
printf("\n Blob mobile Activated!");
}
free(outputMobBlob);
Table 173 - DatablinkActivate C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
176
Java
MobileBlob mobileBlob = new MobileBlob(
"OtA0Vuq4yabBDYxbggMAB23Z+HjyGiDr+JMmHnj/9hX5N/tGtNF0dFJw1G9YqKfybdtFGwMrwEbIvIUe7W9vsHAZ6Wot7sA/EZ8xpcxLVoj0bqp1DIKWvH0EjVFLjt4DbxJFG+X1CQEpiXZFosp
V64HMAVMeBIzPAOAUhKUEXvO3J2eOZlbKOcPHwvB21XfqpsbQ7fJiZ7LnQBbpqkAzrdBxnU0yc
+3nWQrXCt4jZg5hvga4rSdcRLed+g/PqUxL");
final String clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
boolean activate = true;
int result = DatablinkMobileMgmtAPI.DatablinkActivate(mobileBlob,
clientImplKey, activate);
if(result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}else{
System.out.println("Blob mobile updated = " + mobileBlob.getBlob());
}
Table 174 - DatablinkActivate Java Sample Code
C#
MobileBlob mobileBlob = new
MobileBlob("OtA0Vuq4yabBDYxbggMAB23Z+HjyGiDr+JMmHnj/9hX5N/tGtNF0dFJw1G9YqK
fybdtFGwMrwEbIvIUe7W9vsHAZ6Wot7sA/EZ8xpcxLVoj0bqp1DIKWvH0EjVFLjt4DbxJFG+X1
CQEpiXZFospV64HMAVMeBIzPAOAUhKUEXvO3J2eOZlbKOcPHwvB21XfqpsbQ7fJiZ7LnQBbpqk
AzrdBxnU0yc+3nWQrXCt4jZg5hvga4rSdcRLed+g/PqUxL");
const string clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
bool activate = true;
int result = DatablinkMobileMgmtAPI.DatablinkActivate(mobileBlob,
clientImplKey, activate);
if (result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error: " + result + " = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}
else
{
Console.WriteLine("Blob mobile updated = " + mobileBlob.Blob);
}
Table 175 - DatablinkActivate C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
177
5.2.1.2 DatablinkBlock
The DatablinkBlock function is used to block and unblock a mobile management blob.
When the mobile management blob is blocked this function change the mobile
management blob status to blocked (STATUS_MOB200_MGMT_BLOB_BLOCKED), this
means that this blob is blocked on server, but the mobile app is not blocked yet, this will
happens when the mobile app is synchronized with the server application or sends a block
communication.
If the function is used to unblock, the mobile management blob status will be changed to
active (STATUS_MOB200_MGMT_BLOB_ACTIVE), this means that the blob is unblocked on
server.
Signature:
C++ int DatablinkBlock(const char* iBlob, const char* iSecurity, bool iBlock, char*
oBlob, int* ioBlobSize);
Java public static int DatablinkBlock(MobileBlob ioBlob, String iSecurity,
boolean iBlock)
C# public static int DatablinkBlock(MobileBlob ioBlob, string iSecurity, bool
iBlock);
Table 176 - DatablinkBlock Signature
Parameter(s):
• iBlob (i): Input parameter that contains the token mobile blob (management blob
of the mobile app) to be blocked/unblocked. Used only by implementations using C
and C++.
• iSecurity (i): Implementation security key defined during the mobile
implementation. This key is used as part of the secret to encrypt the mobile blob
and all communications generated by Datablink Management Mobile 200 API. This
key must be the same key used in mobile app developed.
This key must be defined as a hexadecimal 64-characters string.
• iBlock (i): If "true", blocks the mobile management blob. If "false", unblocks.
• oBlob (o): Output parameter that contains the token mobile blob (iBlob) updated.
The value contained should be stored back into the database. Used only by
implementations using C and C++.
• ioBlobSize (i/o): Size of the output blob. Since this blob has a variable size, this
parameter should indicate the maximum string size possible to be filled within the
oBlob variable. If there is no sufficient space to fill the blob inside the oBlob variable,
an error will be generated by this function. Used only by implementations using C
and C++.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
178
• ioBlob (i/o): Parameter that contains the token mobile blob (management blob of
the mobile app) to be blocked/unblocked. After calling this function, its contents are
changed and the blob should be stored back into the database. Used only by
implementations using C# and Java.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
char* inputMobBlob =
"91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hkOIA7eAbxoOt
Wtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh9Wkg1sLsXqr
ekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+HxqmaQPohQhf
grTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO
+R74=";
const char* clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
bool block = true;
int32_t outputMobBlobSize = 512;
char* outputMobBlob = (char*) malloc(outputMobBlobSize);
memset(outputMobBlob, 0, outputMobBlobSize);
int32_t result = DatablinkBlock(inputMobBlob, clientImplKey, block,
outputMobBlob, &outputMobBlobSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(message, messageSize, result, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
outputMobBlob[outputMobBlobSize] = 0;
printf("\n Blob mobile updated = %s", outputMobBlob);
printf("\n Blob mobile Blocked!");
}
free(outputMobBlob);
Table 177 - DatablinkBlock C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
179
Java
MobileBlob mobileBlob = new MobileBlob(
"91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hkOIA7eAbxoOt
Wtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh9Wkg1sLsXqr
ekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+HxqmaQPohQhf
grTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO
+R74=");
final String clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
boolean block = true;
int result = DatablinkMobileMgmtAPI.DatablinkBlock(mobileBlob,
clientImplKey, block);
if(result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}else{
System.out.println("Blob mobile updated = " + mobileBlob.getBlob());
}
Table 178 - DatablinkBlock Java Sample Code
C#
MobileBlob mobileBlob = new
MobileBlob("91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hk
OIA7eAbxoOtWtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh
9Wkg1sLsXqrekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+H
xqmaQPohQhfgrTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+o
wfwMwovmAWO+R74=");
const string clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
bool block = true;
int result = DatablinkMobileMgmtAPI.DatablinkBlock(mobileBlob,
clientImplKey, block);
if (result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error: " + result + " = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}
Table 179 - DatablinkBlock C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink180
5.2.1.3 DatablinkBlockByPIN
The DatablinkBlockByPIN function is used to block a mobile management blob because of
too many consecutive errors of PIN. After this function be ran the mobile management blob
status is changed to blocked by PIN (STATUS_MOB200_MGMT_BLOB_BLOCKED_BY_PIN),
this
means that this blob is blocked on server, but the mobile app is not blocked yet, to do this
is also necessary to use the function DatablinkBlockMobile.
Signature:
C++ int DatablinkBlockByPIN(const char* iBlob, const char* iSecurity, char* oBlob,
int* ioBlobSize);
Java public static int DatablinkBlockByPIN(MobileBlob ioBlob, String
iSecurity);
C# public static int DatablinkBlockByPIN(MobileBlob ioBlob, string iSecurity);
Table 180 - DatablinkBlockByPIN Signature
Parameter(s):
• iBlob (i): Input parameter that contains the token mobile blob (management blob
of the mobile app) to be blocked/unblocked by PIN. Used only by implementations
using C and C++.
• iSecurity (i): Implementation security key defined during the mobile
implementation. This key is used as part of the secret to encrypt the mobile blob
and all communications generated by Datablink Management Mobile 200 API. This
key must be the same key used in mobile app developed.
This key must be defined as a hexadecimal 64-characters string.
• oBlob (o): Output parameter that contains the token mobile blob (iBlob) updated.
The value contained should be stored back into the database. Used only by
implementations using C and C++.
• ioBlobSize (i/o): Size of the output blob. Since this blob has a variable size, this
parameter should indicate the maximum string size possible to be filled within the
oBlob variable. If there is not sufficient space to fill the blob inside the oBlob variable,
an error will be generated by this function. Used only by implementations using C
and C++.
• ioBlob (i/o): After calling this function, its contents are changed and the blob should
be stored back into the database. Used only by implementations using C# and Java.
Returns: 0 (zero) – SUCCESS
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
181
<> 0 (not zero) – ERROR
Use example:
C++
char* inputMobBlob =
"91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hkOIA7eAbxoOt
Wtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh9Wkg1sLsXqr
ekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+HxqmaQPohQhf
grTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO
+R74=";
const char* clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
int32_t outputMobBlobSize = 512;
char* outputMobBlob = (char*) malloc(outputMobBlobSize);
memset(outputMobBlob, 0, outputMobBlobSize);
int32_t result = DatablinkBlockByPIN(inputMobBlob, clientImplKey,
outputMobBlob, &outputMobBlobSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(message, messageSize, result, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}else{
outputMobBlob[outputMobBlobSize] = 0;
printf("\n Blob mobile updated = %s", outputMobBlob);
printf("\n Blob mobile Blockeded by PIN!");
}
free(outputMobBlob);
Table 181 - DatablinkBlockByPIN C++ Sample Code
Java
MobileBlob mobileBlob = new MobileBlob(
"91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hkOIA7eAbxoOt
Wtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh9Wkg1sLsXqr
ekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+HxqmaQPohQhf
grTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO
+R74=");
final String clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
int result = DatablinkMobileMgmtAPI.DatablinkBlockByPIN(mobileBlob,
clientImplKey);
if(result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}else{
System.out.println("Blob mobile updated = " + mobileBlob.getBlob());
}
Table 182 - DatablinkBlockByPIN Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
182
C#
MobileBlob mobileBlob = new
MobileBlob("91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hk
OIA7eAbxoOtWtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh
9Wkg1sLsXqrekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+H
xqmaQPohQhfgrTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+o
wfwMwovmAWO+R74=");
const string clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
int result = DatablinkMobileMgmtAPI.DatablinkBlockByPIN(mobileBlob,
clientImplKey);
if (result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error: " + result + " = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}
else
{
Console.WriteLine("Blob mobile updated = " + mobileBlob.Blob);
}
Table 183 - DatablinkBlockByPIN C# Sample Code
5.2.1.4 DatablinkErrorMessage
Function responsible to get the message related to a return code of Datablink Management
Mobile 200 API.
Signature:
C++ void DatablinkErrorMessage(char* oMsg, const int iMsgSize, const int
iErrorCode, const int iLang);
Java public static String DatablinkErrorMessage(int iErrorCode, int iLang);
C# public static string DatablinkErrorMessage(int iErrorCode, int iLang);
Table 184 - DatablinkErrorMessage Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
183
Parameter(s):
• oMsg (o): Output parameter with the message related to the code (iErrorCode).
Used only by implementations using C and C++.
• iMsgSize (i): Size of the message. Since this message has a variable size, this
parameter should indicate the maximum size possible to be filled within the oMsg
variable. If there is no sufficient space to fill the message inside the oMsg variable,
the variable will be filled with the quantity of characters indicated by iMsgSize. Used
only by implementations using C and C++.
• iErrorCode (i): Code to get the message.
• iLang (i): Language in which the return message is desired.
Returns:
Java/C#
Text with the message related to the code iCode.
Table 185 - DatablinkErrorMessage Java / C# Return
Use example:
C++
int result = SUCCESS;
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(message, messageSize, result, LANG_EN);
printf("\n Error Message: %i = %s", result, message);
free(message);
Table 186 - DatablinkErrorMessage C++ Sample Code
Java
System.out.println("Error = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(DatablinkMobileMgmtAPIErrorCo
des.SUCCESS, DatablinkMobileMgmtAPIConst.LANG_EN));
Table 187 - DatablinkErrorMessage Java Sample Code
C#
Console.WriteLine("Error = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(DatablinkMobileMgmtAPIErrorCo
des.ERROR_BLOB, DatablinkMobileMgmtAPIConst.LANG_EN));
Table 188 - DatablinkErrorMessage C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.comwww.watchguard.com/wgrd-datablink
184
5.2.1.5 DatablinkGenActivationCredentialsQRCode
The DatablinkGenActivationCredentialsQRCode function is responsible to encrypt the
activation information that should be used to activate a mobile app inside a string that will
be transformed into a QR code.
Signature:
C++ int DatablinkGenActivationCredentialsQRCode(const char* iActivInfo, const
char* iSecurity, char* oQRCode, int* ioQRCodeSize);
Java public static int
DatablinkGenerateActivationCredentialsQRCode(List<String> iActivInfo,
String iSecurity, StringBuilder oQRCode);
C# public static int DatablinkGenerateActivationCredentialsQRCode(IList<string>
iActivInfo, string iSecurity, StringBuilder oQRCode);
Table 189 - DatablinkGenActivationCredentialsQRCode Signature
Parameter(s):
• iActivInfo (i): Activation information that should be inserted into QR code. In C and
C++ implementations the data must be a string separated by character ‘#’.
• iSecurity (i): Implementation security key defined during the mobile
implementation. This key is used as part of the secret to encrypt the mobile blob
and all communications generated by Datablink Management Mobile 200 API. This
key must be the same key used in mobile app developed.
This key must be defined as a hexadecimal 64-characters string.
• oQRCode (o): Output parameter containing a encrypt string with the data to be
transformed in a QR code image.
• ioQRCodeSize (i/o): Size of the encrypt string generated (oQRCode). Since this string
has a variable size, this parameter should indicate the maximum string size possible
to be filled within the oQRCode variable. If there is no sufficient space to fill the string
inside the oQRCode variable, an error will be generated by this function. Used only
by implementations using C and C++.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
185
Use example:
C++
int32_t qrCodeSize = 2048;
char* qrCode = (char*) malloc(qrCodeSize);
memset(qrCode, 0, qrCodeSize);
const char* clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
int activInfoSize = 512;
char* activInfo = (char*) malloc(activInfoSize);
memset(activInfo, 0, activInfoSize);
strcpy(activInfo, "127.0.0.1:8831/mobile_activ");
strcat(activInfo, SEPARATOR);
strcat(activInfo, "ACTIV_ID");
strcat(activInfo, SEPARATOR);
strcat(activInfo, "ACTIV_PWD");
int32_t result = DatablinkGenActivationCredentialsQRCode(activInfo,
clientImplKey, qrCode, &qrCodeSize);
if (result != SUCCESS){
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(message, messageSize, result, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}else{
qrCode[qrCodeSize] = 0;
printf("\n QR Code = %s", qrCode);
printf("\n QR Code Size = %d", qrCodeSize);
printf("\n Activation Credentials QR Code Command Generated!");
}
free(qrCode);
Table 190 - DatablinkGenActivationCredentialsQRCode C++ Sample Code
Java
StringBuilder sbQRCode = new StringBuilder();
final String clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
List<String> activInfo = new ArrayList<>();
activInfo.add("127.0.0.1:8831/mobile_activ");
activInfo.add("ACTIV_ID");
activInfo.add("ACTIV_PWD");
int result =
DatablinkMobileMgmtAPI.DatablinkGenerateActivationCredentialsQRCode(activI
nfo, clientImplKey, sbQRCode);
if(result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}else{
System.out.println("String to be transformed in a QR code = " +
sbQRCode.toString());
}
Table 191 - DatablinkGenActivationCredentialsQRCode Java Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
186
C#
StringBuilder sbQRCode = new StringBuilder();
const string clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
List<string> activInfo = new List<string>();
activInfo.Add("127.0.0.1:8831/mobile_activ");
activInfo.Add("ACTIV_ID");
activInfo.Add("ACTIV_PWD");
int result =
DatablinkMobileMgmtAPI.DatablinkGenerateActivationCredentialsQRCode(activI
nfo, clientImplKey, sbQRCode);
if (result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error: " + result + " = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}
else
{
Console.WriteLine("String to be transformed in a QR code = " +
sbQRCode.ToString());
}
Table 192 - DatablinkGenActivationCredentialsQRCode C# Sample Code
5.2.1.6 DatablinkGenActivationCredentialsQRCodeDefault
The DatablinkGenActivationCredentialsQRCodeDefault function is responsible to encrypt
the activation information that should be used to activate a Mobile 200 token inside a string
that will be transformed into a QR code.
This function differs of DatablinkGenActivationCredentialsQRCode because in this function is
used an internal implementation key, that is the same key used to the Mobile 200 token.
Signature:
C++ int DatablinkGenActivationCredentialsQRCodeDefault(const char* iActivInfo,
char* oQRCode, int* ioQRCodeSize);
Java public static int
DatablinkGenerateActivationCredentialsQRCodeDefault(List<String>
iActivInfo, StringBuilder oQRCode);
C# public static int
DatablinkGenerateActivationCredentialsQRCodeDefault(IList<string>
iActivInfo, StringBuilder oQRCode);
Table 193 - DatablinkGenActivationCredentialsQRCodeDefault Signature
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
187
Parameter(s):
• iActivInfo (i): Activation information that should be inserted into QR code. In C and
C++ implementations the data must be a string separated by character ‘#’.
• oQRCode (o): Output parameter containing a encrypt string with the data to be
transformed in a QR code image.
• ioQRCodeSize (i/o): Size of the encrypt string generated (oQRCode). Since this string
has a variable size, this parameter should indicate the maximum string size possible
to be filled within the oQRCode variable. If there is no sufficient space to fill the string
inside the oQRCode variable, an error will be generated by this function. Used only
by implementations using C and C++.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
Use example:
C++
int32_t qrCodeSize = 2048;
char* qrCode = (char*) malloc(qrCodeSize);
memset(qrCode, 0, qrCodeSize);
int activInfoSize = 512;
char* activInfo = (char*) malloc(activInfoSize);
memset(activInfo, 0, activInfoSize);
strcpy(activInfo, "127.0.0.1:8831/mobile_activ");
strcat(activInfo, SEPARATOR);
strcat(activInfo, "ACTIV_ID");
strcat(activInfo, SEPARATOR);
strcat(activInfo, "ACTIV_PWD");
int32_t result = DatablinkGenActivationCredentialsQRCodeDefault(activInfo,
qrCode, &qrCodeSize);
if (result != SUCCESS){
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(message, messageSize, result, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}else{
qrCode[qrCodeSize] = 0;
printf("\n QR Code = %s", qrCode);printf("\n QR Code Size = %d", qrCodeSize);
printf("\n Activation Credentials QR Code Default Command
Generated!");
}
free(qrCode);
Table 194 - DatablinkGenActivationCredentialsQRCodeDefault C++ Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
188
Java
StringBuilder sbQRCode = new StringBuilder();
List<String> activInfo = new ArrayList<>();
activInfo.add("127.0.0.1:8831/mobile_activ");
activInfo.add("ACTIV_ID");
activInfo.add("ACTIV_PWD");
int result =
DatablinkMobileMgmtAPI.DatablinkGenerateActivationCredentialsQRCodeDefault
(activInfo, sbQRCode);
if(result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}else{
System.out.println("String to be transformed in a QR code = " +
sbQRCode.toString());
}
Table 195 - DatablinkGenActivationCredentialsQRCodeDefault Java Sample Code
C#
StringBuilder sbQRCode = new StringBuilder();
List<string> activInfo = new List<string>();
activInfo.Add("127.0.0.1:8831/mobile_activ");
activInfo.Add("ACTIV_ID");
activInfo.Add("ACTIV_PWD");
int result =
DatablinkMobileMgmtAPI.DatablinkGenerateActivationCredentialsQRCodeDefault
(activInfo, sbQRCode);
if (result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error: " + result + " = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}
else
{
Console.WriteLine("String to be transformed in a QR code = " +
sbQRCode.ToString());
}
Table 196 - DatablinkGenActivationCredentialsQRCodeDefault C# Sample Code
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
189
5.2.1.7 DatablinkGenerateAuthorizationQRCodeCommand
The DatablinkGenerateAuthorizationQRCodeCommand function is responsible to encrypt
the authorization data inside a string that will be transformed into a QR code.
Signature:
C++ int DatablinkGenerateAuthorizationQRCodeCommand(const char* iBlobs, const
char* iSecurity, const char* iTitle, const char* iMsg, const char*
iTransactionData, const char* iCharSet, char* oQRCode, int* ioQRCodeSize);
Java public static int
DatablinkGenerateAuthorizationQRCodeCommand(List<MobileBlob>
iBlobs, String iSecurity, String iTitle, String iMsg, List<String>
iTransactionData, String iCharset, StringBuilder oQRCode);
C# public static int
DatablinkGenerateAuthorizationQRCodeCommand(IList<MobileBlob> iBlobs, string
iSecurity, string iTitle, string iMsg, IList<string> iTransactionData, string
iCharset, StringBuilder oQRCode);
Table 197 - DatablinkGenerateAuthorizationQRCodeCommand Signature
Parameter(s):
• iBlobs (i): Array of mobile management blobs that will be able to read the string
generated. In C and C++ implementations the blobs must be a string with all blobs
separated by character ‘#’.
• iSecurity (i): Implementation security key defined during the mobile
implementation. This key is used as part of the secret to encrypt the mobile blob
and all communications generated by Datablink Management Mobile 200 API. This
key must be the same key used in mobile app developed.
This key must be defined as a hexadecimal 64-characters string.
• iTitle (i): Title to the authorization request.
• iMsg (i): Message used to describe the authorization request.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
190
• iTransactionData (i): Input parameter containing all data to be authorized on this
transaction. These data must be in an ASCII charset as the data to be authorized by
Datablink Management API. On C and C++ implementations these data must be a
string with all data separated by character ‘#’.
Valid characters
‘ ’ (space) – 0x20 … ‘~’ (tild) – 0x7E
Table 198 - iTransactionData valid parameters
• iCharset (i): Input parameter containing the charset used on client implementation.
Possible values:
Values
utf-8
utf8
latin1
iso-8859-1
utf-16
utf16
Table 199 - iCharset possible values
• oQRCode (o): Output parameter containing a encrypt string with the data to be
transformed in a QR code image.
• ioQRCodeSize (i/o): Size of the encrypt string generated (oQRCode). Since this string
has a variable size, this parameter should to indicate the maximum string size
possible to be filled within the oQRCode variable. If there is no sufficient space to fill
the string inside the oQRCode variable, an error will be generated by this function.
Used only by implementations using C and C++.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
191
Use example:
C++
Using one mobile blob
char* mobileBlob =
"91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hkOIA7eAbxoOt
Wtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh9Wkg1sLsXqr
ekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+HxqmaQPohQhf
grTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO
+R74=";
int32_t qrCodeSize = 2048;
char* qrCode = (char*) malloc(qrCodeSize);
memset(qrCode, 0, qrCodeSize);
const char* clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
const char* title = "Hᠵma nova requisi磯 de autoriza磯 que requer sua aten
磯.";
const char* msg = "Vocꠡutoriza a opera磯 XYZ realizada atrav鳠do cart㯠de
cr餩to 0000.0000.0000.0000?";
int transactionDataSize = 512;
char* transactionData = (char*) malloc(transactionDataSize);
memset(transactionData, 0, transactionDataSize);
strcpy(transactionData, "XYZ");
strcat(transactionData, SEPARATOR);
strcat(transactionData, "0000.0000.0000.0000");
int32_t result = DatablinkGenerateAuthorizationQRCodeCommand(mobileBlob,
clientImplKey, title, msg, transactionData, CHASET_UTF8, qrCode,
&qrCodeSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(message, messageSize, result, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
qrCode[qrCodeSize] = 0;
printf("\n QR Code = %s", qrCode);
printf("\n QR Code Size = %d", qrCodeSize);
printf("\n Authorization QR Code Command Generated!");
}
free(transactionData);
free(qrCode);
return result;
Table 200- DatablinkGenerateAuthorizationQRCodeCommand C++ Sample Code - Using one mobile blob
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
192
C++
Using two mobile blobs
char* mobileBlob1 =
"91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hkOIA7eAbxoOt
Wtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh9Wkg1sLsXqr
ekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+HxqmaQPohQhf
grTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO
+R74=";
char* mobileBlob2 =
"Yl7gaSKkYvJ18g0/YA0ZpS4h8HRkQrSwN5C/v0xDRqKamIISHZtwtJllfadZNSiXYvtwA9yjl
+598tATq0VHzxzVvmLRC41e62uqhhDsIDx9qyuDjoqEf2jJ3wbnSNbvrt5ENHAYVxr2GM7ISrx
j598tATq0VHzxzVvmLRC41e62uqhhDsIDx9qyuDjoqEf2jJ3wbnSNbvrt5ENHAYVxr2GM7ISrxj/RtgD7LCFIDtV6RD2z/dtZac/sxZ98f68lfo4XInxP5mKOQn9pGLbtM3/8CWCnGCJNWZZkT5a
VpsW3Me/gKG5e1/gXd1Pr0hV3WKelVejbPOXhqvRWy9ZAtlaI/5V8r73xbNVolGP6ueSXbznbz
TAUc=";
int32_t qrCodeSize = 2048 * 2;
char* qrCode = (char*) malloc(qrCodeSize);
memset(qrCode, 0, qrCodeSize);
const char* clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
const char* title = "Hᠵma nova requisi磯 de autoriza磯 que requer sua aten
磯.";
const char* msg = "Vocꠡutoriza a opera磯 XYZ realizada atrav鳠do cart㯠de
cr餩to 0000.0000.0000.0000?";
int mobBlobsSize = 512 * 2;
char* mobBlobs = (char*) malloc(mobBlobsSize);
memset(mobBlobs, 0, mobBlobsSize);
strcpy(mobBlobs, mobileBlob1);
strcat(mobBlobs, SEPARATOR);
strcat(mobBlobs, mobileBlob2);
int transactionDataSize = 512;
char* transactionData = (char*) malloc(transactionDataSize);
memset(transactionData, 0, transactionDataSize);
strcpy(transactionData, "XYZ");
strcat(transactionData, SEPARATOR);
strcat(transactionData, "0000.0000.0000.0000");
int32_t result = DatablinkGenerateAuthorizationQRCodeCommand(mobBlobs,
clientImplKey, title, msg, transactionData, CHASET_UTF8, qrCode,
&qrCodeSize);
if (result != SUCCESS){
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(message, messageSize, result, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}else{
qrCode[qrCodeSize] = 0;
printf("\n QR Code = %s", qrCode);
printf("\n QR Code Size = %d", qrCodeSize);
printf("\n Authorization QR Code Command Generated!");
}
free(transactionData);
free(mobBlobs);
free(qrCode);
Table 201 - DatablinkGenerateAuthorizationQRCodeCommand C++ Sample Code - Using two mobile blobs
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
193
Java
Using one mobile blob
MobileBlob mobileBlob = new MobileBlob(
"91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hkOIA7eAbxoOt
Wtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh9Wkg1sLsXqr
ekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+HxqmaQPohQhf
grTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO
+R74=");
StringBuilder sbQRCode = new StringBuilder();
final String clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
String title = "Há uma nova requisição de autorização que requer sua
atenção.";
String msg = "Você autoriza a operação XYZ realizada através do cartão de
crédito 0000.0000.0000.0000?";
List<MobileBlob> mobBlobs = new ArrayList<>();
List<String> transactionData = new ArrayList<>();
mobBlobs.add(mobileBlob);
transactionData.add("XYZ");
transactionData.add("0000.0000.0000.0000");
int result =
DatablinkMobileMgmtAPI.DatablinkGenerateAuthorizationQRCodeCommand(mobBlob
s, clientImplKey, title, msg, transactionData,
DatablinkMobileMgmtAPIConst.CHARSET_UTF8, sbQRCode);
if(result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}else{
System.out.println("String to be transformed in a QR code = " +
sbQRCode.toString());
}
Table 202 - DatablinkGenerateAuthorizationQRCodeCommand Java Sample Code - Using one mobile blob
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
194
Java
Using two mobile blobs
MobileBlob mobileBlob1 = new MobileBlob(
"91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hkOIA7eAbxoOt
Wtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh9Wkg1sLsXqr
ekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+HxqmaQPohQhf
grTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO
+R74=");
MobileBlob mobileBlob2 = new MobileBlob(
"Yl7gaSKkYvJ18g0/YA0ZpS4h8HRkQrSwN5C/v0xDRqKamIISHZtwtJllfadZNSiXYvtwA9yjl
+598tATq0VHzxzVvmLRC41e62uqhhDsIDx9qyuDjoqEf2jJ3wbnSNbvrt5ENHAYVxr2GM7ISrx
j/RtgD7LCFIDtV6RD2z/dtZac/sxZ98f68lfo4XInxP5mKOQn9pGLbtM3/8CWCnGCJNWZZkT5a
VpsW3Me/gKG5e1/gXd1Pr0hV3WKelVejbPOXhqvRWy9ZAtlaI/5V8r73xbNVolGP6ueSXbznbz
TAUc=");
StringBuilder sbQRCode = new StringBuilder();
final String clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
String title = "Há uma nova requisição de autorização que requer sua
atenção.";
String msg = "Você autoriza a operação XYZ realizada através do cartão de
crédito 0000.0000.0000.0000?";
List<MobileBlob> mobBlobs = new ArrayList<>();
List<String> transactionData = new ArrayList<>();
mobBlobs.add(mobileBlob1);
mobBlobs.add(mobileBlob2);
transactionData.add("XYZ");
transactionData.add("0000.0000.0000.0000");
int result =
DatablinkMobileMgmtAPI.DatablinkGenerateAuthorizationQRCodeCommand(mobBlob
s, clientImplKey, title, msg, transactionData,
DatablinkMobileMgmtAPIConst.CHARSET_UTF8, sbQRCode);
if(result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS){
System.out.println("Error = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}else{
System.out.println("String to be transformed in a QR code = " +
sbQRCode.toString());
}
Table 203 - DatablinkGenerateAuthorizationQRCodeCommand Java Sample Code - Using two mobile blobs
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
195
C#
Using one mobile blob
MobileBlob mobileBlob = new
MobileBlob("91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hk
OIA7eAbxoOtWtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh
9Wkg1sLsXqrekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+H
xqmaQPohQhfgrTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+o
wfwMwovmAWO+R74=");
StringBuilder sbQRCode = new StringBuilder();
const string clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
string title = "Há uma nova requisição de autorização que requer sua
atenção.";
string msg = "Você autoriza a operação XYZ realizada através do cartão de
crédito 0000.0000.0000.0000?";
List<MobileBlob> mobBlobs = new List<MobileBlob>();
List<string> transactionData = new List<string>();
mobBlobs.Add(mobileBlob);
transactionData.Add("XYZ");
transactionData.Add("0000.0000.0000.0000");
int result =
DatablinkMobileMgmtAPI.DatablinkGenerateAuthorizationQRCodeCommand(mobBlob
s, clientImplKey, title, msg, transactionData,
DatablinkMobileMgmtAPIConst.CHARSET_UTF8, sbQRCode);
if (result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error: " + result + " = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}
else
{
Console.WriteLine("String to be transformed in a QR code = " +
sbQRCode.ToString());
}
Table 204 - DatablinkGenerateAuthorizationQRCodeCommand C# Sample Code - Using one mobile blobs
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
196
C#
Using two mobile blobs
MobileBlob mobileBlob1 = new
MobileBlob("91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hk
OIA7eAbxoOtWtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh
9Wkg1sLsXqrekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+H
xqmaQPohQhfgrTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO+R74=");
MobileBlob mobileBlob2 = new
MobileBlob("Yl7gaSKkYvJ18g0/YA0ZpS4h8HRkQrSwN5C/v0xDRqKamIISHZtwtJllfadZNS
iXYvtwA9yjl+598tATq0VHzxzVvmLRC41e62uqhhDsIDx9qyuDjoqEf2jJ3wbnSNbvrt5ENHAY
Vxr2GM7ISrxj/RtgD7LCFIDtV6RD2z/dtZac/sxZ98f68lfo4XInxP5mKOQn9pGLbtM3/8CWCn
GCJNWZZkT5aVpsW3Me/gKG5e1/gXd1Pr0hV3WKelVejbPOXhqvRWy9ZAtlaI/5V8r73xbNVolG
P6ueSXbznbzTAUc=");
StringBuilder sbQRCode = new StringBuilder();
const string clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
string title = "Há uma nova requisição de autorização que requer sua
atenção.";
string msg = "Você autoriza a operação XYZ realizada através do cartão de
crédito 0000.0000.0000.0000?";
List<MobileBlob> mobBlobs = new List<MobileBlob>();
List<string> transactionData = new List<string>();
mobBlobs.Add(mobileBlob1);
mobBlobs.Add(mobileBlob2);
transactionData.Add("XYZ");
transactionData.Add("0000.0000.0000.0000");
int result =
DatablinkMobileMgmtAPI.DatablinkGenerateAuthorizationQRCodeCommand(mobBlob
s, clientImplKey, title, msg, transactionData,
DatablinkMobileMgmtAPIConst.CHARSET_UTF8, sbQRCode);
if (result != DatablinkMobileMgmtAPIErrorCodes.SUCCESS)
{
Console.WriteLine("Error: " + result + " = " +
DatablinkMobileMgmtAPI.DatablinkErrorMessage(result,
DatablinkMobileMgmtAPIConst.LANG_EN));
}
else
{
Console.WriteLine("String to be transformed in a QR code = " +
sbQRCode.ToString());
}
Table 205 - DatablinkGenerateAuthorizationQRCodeCommand C# Sample Code - Using two mobile blobs
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
197
5.2.1.8 DatablinkGenerateChallengeResponseQRCodeCommand
The DatablinkGenerateChallengeResponseQRCodeCommand function is responsible to
encrypt the challenge inside a string that will be transformed into a QR code.
Signature:
C++ int DatablinkGenerateChallengeResponseQRCodeCommand(const char* iBlobs,
const char* iSecurity, const char* iChallenge, const char* iCharSet, char*
oQRCode, int* ioQRCodeSize);
Java public static int
DatablinkGenerateChallengeResponseQRCodeCommand(List<MobileBlob>
iBlobs, String iSecurity, String iChallenge, String iCharSet,
StringBuilder oQRCode);
C# public static int
DatablinkGenerateChallengeResponseQRCodeCommand(IList<MobileBlob> iBlobs,
string iSecurity, string iChallenge, string iCharSet, StringBuilder oQRCode);
Table 206 - DatablinkGenerateChallengeResponseQRCodeCommand Signature
Parameter(s):
• iBlobs (i): Array of mobile management blobs that will be able to read the string
generated. In C and C++ implementations the blobs must be a string with all blobs
separated by character ‘#’.
• iSecurity (i): Implementation security key defined during the mobile
implementation. This key is used as part of the secret to encrypt the mobile blob
and all communications generated by Datablink Management Mobile 200 API. This
key must be the same key used in mobile app developed.
This key must be defined as a hexadecimal 64-characters string.
• iChallenge (i): Challenge generated using Datablink Management API which should
be sent to mobile app using QR code.
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
198
• iCharset (i): Input parameter containing the charset used on client implementation.
Possible values:
Values
utf-8
utf8
latin1
iso-8859-1
utf-16
utf16
Table 207 - iCharset possible values
• oQRCode (o): Output parameter containing a encrypt string with the data to be
transformed in a QR code image.
• ioQRCodeSize (i/o): Size of the encrypt string generated (oQRCode). Since this string
has a variable size, this parameter should to indicate the maximum string size
possible to be filled within the oQRCode variable. If there is no sufficient space to fill
the string inside the oQRCode variable, an error will be generated by this function.
Used only by implementations using C and C++.
Returns: 0 (zero) – SUCCESS
<> 0 (not zero) – ERROR
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
199
Use example:
C++
Using one mobile blob
char* mobileBlob =
"91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hkOIA7eAbxoOt
Wtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh9Wkg1sLsXqr
ekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+HxqmaQPohQhf
grTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO
+R74=";
int32_t qrCodeSize = 2048;
char* qrCode = (char*) malloc(qrCodeSize);
memset(qrCode, 0, qrCodeSize);
const char* clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
const char* challenge = "1234";
int32_t result =
DatablinkGenerateChallengeResponseQRCodeCommand(mobileBlob, clientImplKey,
challenge, CHASET_UTF8, qrCode, &qrCodeSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(message, messageSize, result, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
qrCode[qrCodeSize] = 0;
printf("\n QR Code = %s", qrCode);
printf("\n QR Code Size = %d", qrCodeSize);
printf("\n Challenge Response QR Code Command Generated!");
}
free(qrCode);
Table 208 - DatablinkGenerateChallengeResponseQRCodeCommand C++ Sample Code - Using one mobile blobs
mailto:support@datablink.com
http://www.watchguard.com/wgrd-datablink
Brazil: +55 (11) 4935-5338 support@datablink.com
www.watchguard.com/wgrd-datablink
200
C++
Using two mobile blobs
char* mobileBlob1 =
"91tu0eo4hYdXiaeQhFjxtLMQRdyKexiFzXzDTfhaRNe+qnt5eT73lm+Yiba+hkOIA7eAbxoOt
Wtut0gcchISsqqDNX5fb1xqqlK852AszbBx/Vo6i6qxapIFCkEXKfrzIy5k1IYh9Wkg1sLsXqr
ekqvl9yz0zXlN0cTBFYAYvoT0SCkkTyQHtnTZObJw9lKgww8jXyAWk/Qh7ZZV+HxqmaQPohQhf
grTkSM0uOnz955nMjCpERkNGMhJH1xls1q/aCVCKWdTrmP9vjEiWttpU7SH+K+owfwMwovmAWO
+R74=";
char* mobileBlob2 =
"Yl7gaSKkYvJ18g0/YA0ZpS4h8HRkQrSwN5C/v0xDRqKamIISHZtwtJllfadZNSiXYvtwA9yjl
+598tATq0VHzxzVvmLRC41e62uqhhDsIDx9qyuDjoqEf2jJ3wbnSNbvrt5ENHAYVxr2GM7ISrx
j/RtgD7LCFIDtV6RD2z/dtZac/sxZ98f68lfo4XInxP5mKOQn9pGLbtM3/8CWCnGCJNWZZkT5a
VpsW3Me/gKG5e1/gXd1Pr0hV3WKelVejbPOXhqvRWy9ZAtlaI/5V8r73xbNVolGP6ueSXbznbz
TAUc=";
int32_t qrCodeSize = 2048 * 2;
char* qrCode = (char*) malloc(qrCodeSize);
memset(qrCode, 0, qrCodeSize);
const char* clientImplKey =
"0123456789012345678901234567890123456789012345678901234567890123";
const char* challenge = "1234";
int mobBlobsSize = 512 * 2;
char* mobBlobs = (char*) malloc(mobBlobsSize);
memset(mobBlobs, 0, mobBlobsSize);
strcpy(mobBlobs, mobileBlob1);
strcat(mobBlobs, SEPARATOR);
strcat(mobBlobs, mobileBlob2);
int32_t result = DatablinkGenerateChallengeResponseQRCodeCommand(mobBlobs,
clientImplKey, challenge, CHASET_UTF8, qrCode, &qrCodeSize);
if (result != SUCCESS)
{
int32_t messageSize = 256;
char* message = (char*) malloc(messageSize);
memset(message, 0, messageSize);
DatablinkErrorMessage(message, messageSize, result, LANG_EN);
printf("\n Error %i = %s", result, message);
free(message);
}
else
{
qrCode[qrCodeSize] = 0;
printf("\n QR Code = %s", qrCode);
printf("\n QR Code Size = %d", qrCodeSize);
printf("\n Challenge Response QR Code Command Generated!");
}
free(mobBlobs);
free(qrCode);
Table 209 - DatablinkGenerateChallengeResponseQRCodeCommand