A verification method and device

By loading JS modules and information security devices in the browser and using timer objects and blocking mode to process user input data, the problems of low user login verification strength and insufficient data security are solved, and a more robust and secure login process is achieved.

CN116232678BActive Publication Date: 2025-09-19FEITIAN TECHNOLOGIES CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211733815.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-09-19
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

In the prior art, the user login verification is weak and the data is not secure enough during transmission, making it easy to be stolen.

Method used

By loading JS modules and information security devices in the browser, using timer objects and blocking mode to process user input data, first encrypting and signing it locally before sending it to the server for verification, the verification strength and security are enhanced.

Benefits of technology

Without changing the user's operating method, the strength of login verification and the security of data transmission are improved, reducing the risk of data leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116232678B_ABST
    Figure CN116232678B_ABST
Patent Text Reader

Abstract

The present invention discloses a verification method and device, which includes: a current page and a JS module are loaded by a browser, the current page displays page elements including page function special tags, and a page native tag is created on the current page according to the page function special tags; the page native tag receives and executes a first click event message, the JS module sends the to-be-processed data input by the user to an information security device, creates a timer object, and calls the timer object to perform a polling operation, after receiving a first call result of a first interface, calls the timer object to terminate the polling operation, sends the first call result to the current page, creates a second click event message, executes the second click event message through the page function special tag, and the current page sends the first call result to a server for verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular to a verification method and device. Background Art

[0002] In the prior art, during a user login process, the user typically submits the data to be verified, such as a username and password, directly to the server for identity verification. Once the verification is successful, the login operation is performed. This verification method suffers from low verification strength and the data to be verified can be easily stolen while being sent to the server, resulting in low security. Summary of the Invention

[0003] The present invention provides a verification method and device to solve the above technical problems.

[0004] The present invention provides a verification method comprising the following steps:

[0005] Step 1001: The current page and the JS module are loaded by the browser. The current page displays page elements including page function-specific tags. The JS module's redraw interface interface is called by the browser. A page native tag is created on the current page based on the page function-specific tags. The attributes of the page function-specific tags are set to be hidden by the browser.

[0006] Step 1002: The native tag of the page receives and executes the first click event message. The first interface of the JS module is called after the current page is set to blocking mode. The JS module sends the to-be-processed data input by the user to the information security device, creates a timer object, and calls the timer object to perform a polling operation.

[0007] Step 1003: After receiving the first call result of the first interface, the JS module calls the timer object to terminate the polling operation;

[0008] Step 1004: The JS module sends the first call result to the current page;

[0009] Step 1005: The JS module creates a second click event message and executes the second click event message through a special page function tag.

[0010] Step 1006: The current page sends the first call result to the server for verification.

[0011] The present invention also provides a verification device, comprising:

[0012] Loading display creation module, used for the current page and JS module to be loaded by the browser, the current page displays page elements including page function special tags, the JS module's redraw interface interface is called by the browser, and page native tags are created on the current page according to the page function special tags. The attributes of the page function special tags are set to be hidden by the browser;

[0013] An execution calling module is used for the native tag of the page to receive and execute the first click event message. The first interface of the JS module is called after the current page is set to blocking mode. The JS module sends the user input data to be processed to the information security device, creates a timer object, and calls the timer object to perform a polling operation.

[0014] A call receiving module, configured to call a timer object to terminate the polling operation after the JS module receives the first call result of the first interface;

[0015] The first sending module is used for the JS module to send the first call result to the current page;

[0016] Create an execution module for the JS module to create a second click event message, and execute the second click event message through a special tag of the page function;

[0017] The second sending module is used for the current page to send the first call result to the server for verification.

[0018] The present invention also provides a verification device, which includes at least one processor, a memory, and instructions stored in the memory and executable by the at least one processor, and the at least one processor executes the instructions to implement the above-mentioned verification method.

[0019] The present invention also provides a computer-readable storage medium, which includes a computer program. When the computer program is run on a computer, the computer is enabled to execute the above verification method.

[0020] The present invention also provides a chip, which is coupled to a memory and is used to execute a computer program stored in the memory to perform the above verification method.

[0021] Beneficial effects of the present invention: The present invention provides a verification method and device, which improves the verification strength of the user login operation and the security of the data to be verified during the user login operation without changing the user's original operation mode. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flow chart of a verification method provided in Example 1 of the present invention;

[0023] Figure 2A flow chart of a verification method provided in Example 2 of the present invention;

[0024] Figure 3 A flow chart of a verification method provided in Example 3 of the present invention;

[0025] Figure 4 A flow chart of a verification method provided in Example 4 of the present invention. DETAILED DESCRIPTION

[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0027] Example 1

[0028] This embodiment provides a verification method, such as Figure 1 As shown, the method includes the following steps:

[0029] Step 1001: The current page and the JS module are loaded by the browser. The current page displays page elements including page function-specific tags. The JS module's redraw interface interface is called by the browser. A page native tag is created on the current page based on the page function-specific tags. The attributes of the page function-specific tags are set to be hidden by the browser.

[0030] Step 1002: The native tag of the page receives and executes the first click event message. The first interface of the JS module is called after the current page is set to blocking mode. The JS module sends the to-be-processed data input by the user to the information security device, creates a timer object, and calls the timer object to perform a polling operation.

[0031] Step 1003: After receiving the first call result of the first interface, the JS module calls the timer object to terminate the polling operation;

[0032] Step 1004: The JS module sends the first call result to the current page;

[0033] Step 1005: The JS module creates a second click event message and executes the second click event message through a special page function tag.

[0034] Step 1006: The current page sends the first call result to the server for verification.

[0035] In a possible implementation, step 1001 further includes: loading a hidden third tag on the current page;

[0036] Step 1002 specifically includes: the page native tag receives the first click event message, the JS module creates a third click event message, and executes the third click event message through the third tag. The first interface of the JS module is called after the current page is set to blocking mode, a timer object is created, and the timer object is called to perform a polling operation.

[0037] Step 1004 is specifically as follows:

[0038] 1004-1, the JS module generates data to be signed according to the first call result;

[0039] 1004-2, the JS module sends the data to be signed to the information security device for signing, obtains the signature result, and sends the signature result to the current page;

[0040] Step 1006 specifically includes: the current page sends the signature result to the server for verification.

[0041] In a possible implementation, it is characterized in that step 1001 further includes:

[0042] Load the hidden fourth tab;

[0043] Step 1004-1 specifically includes:

[0044] Step C1: The JS module determines whether the first call result includes credential data. If so, the JS module generates data to be signed based on the credential data in the first call result and executes step 1004-2. If not, executes step C2.

[0045] Step C2: The JS module calls the browser's interface, causing the server to search for the corresponding credential data based on the user name, and obtains the credential data returned by the server from the call result;

[0046] Step C3: The JS module creates a fourth click event message, and executes the fourth click event message through the fourth tag;

[0047] Step C4: The second interface of the JS module is called by the current page, and the current page notifies the server to perform a binding operation based on the credential data;

[0048] In step C5, the JS module generates data to be signed based on the credential data and executes step 1004-2.

[0049] In a possible implementation, the first interface is specifically a signature interface;

[0050] Step 1002 specifically includes: the page native tag executes the first click event message, the signature interface of the JS module is called after the current page is set to blocking mode, the JS module sends the data to be signed to the information security device, creates a timer object, and calls the timer object to perform a polling operation;

[0051] The first call result in step 1003 is specifically: the signature result data returned by the information security device;

[0052] Step 1006 is specifically as follows: the current page calls the signature verification interface of the server and sends the received signature result data to the server for verification.

[0053] In a possible implementation, the third tag is specifically: Get Credential ID Tag; the first interface is specifically: Get Credential ID Interface;

[0054] Step 1002 specifically includes: the page native tag receives the first click event message, the JS module creates a third click event message, executes the third click event message through the third tag, the JS module's credential ID acquisition interface is called after the current page is set to blocking mode, the JS module sends a credential ID acquisition notification to the server, creates a timer object, and calls the timer object to perform a polling operation;

[0055] The first call result in step 1003 is specifically: the credential ID returned by the server;

[0056] Step 1004-1 is specifically as follows: the JS module generates data to be signed based on the credential ID and user name;

[0057] Step 1004-2 is specifically as follows: the JS module calls the verification confirmation interface to send the data to be signed to the information security device for signing, obtains the signature result, and sends the signature result to the current page.

[0058] In a possible implementation, the third tag is specifically: obtain credential ID tag; the fourth tag is specifically: set binding credential ID tag; the credential data is specifically the credential ID;

[0059] The first interface in step 1002 is specifically: obtaining a credential ID interface;

[0060] Step C1 specifically includes: the JS module receives the response to the Get Credential ID notification sent by the server, terminates the timer object to perform the polling operation, and determines whether the credential ID exists in the response to the Get Credential ID notification. If so, the JS module generates the data to be signed based on the credential ID and the user name and executes step 1004-2. If not, executes step C2.

[0061] Step C2 is specifically as follows: the JS module calls the registration credential interface, causing the server to search for the corresponding credential data according to the user name, and receive the public key and credential ID of the key pair sent by the server;

[0062] C3 specifically includes: the JS module creates a fourth click event message, and executes the fourth click event message by setting a binding credential ID tag;

[0063] Step C4 is as follows: the JS module's credential ID setting interface is called by the current page, and the current page notifies the server to bind the user name to the credential ID and store it in correspondence with the public key of the key pair;

[0064] Step C5 specifically includes: the JS module generates data to be signed based on the credential ID and the user name; and executing step 1004-2;

[0065] Step 1006 is specifically as follows: the current page calls the signature verification interface of the server and sends the signature result to the server for verification.

[0066] In a possible implementation, the process before step 1002 includes: the third interface of the JS module is called by the current page, and the Websocket client object of the JS module establishes a connection with the Websocket server of the information security device.

[0067] In one possible implementation, step 1002 includes step M before: the fourth interface of the JS module is called by the current page, and the JS module sends the call result of the fourth interface to the current page for the current page to determine whether the call result of the fourth interface meets the requirements. If yes, execute step 1002; if not, the current page performs a prompt operation.

[0068] In a possible implementation, the fourth interface is specifically an interface for obtaining device information, and step M specifically includes:

[0069] Step m1: After the JS module's device information acquisition interface is set to blocking mode by the current page, the JS module's websocket client object sends a device status acquisition instruction to the websocket server object of the information security device driver module, creates a timer object, and calls the timer object to perform a polling operation;

[0070] In step m2, the websocket client object of the JS module receives the response of the get device status instruction returned by the websocket server of the information security device driver module, obtains the device status value from the response, calls the timer object to terminate the polling operation, and sends the device status value to the current page. If the device status value indicates that the information security device has been inserted, execute step 1002. If the device status value indicates that the information security device has not been inserted, the current page prompts that the information security device has not been inserted.

[0071] In a possible implementation, the fourth interface is specifically a PIN verification interface, and step M specifically includes:

[0072] Step m01: After the JS module's device information acquisition interface is set to blocking mode by the current page, the JS module's websocket client object sends the acquired PIN code data to the websocket server of the information security device driver module, creates a timer object, and calls the timer object to perform a polling operation;

[0073] In step m02, the websocket client object of the JS module receives the PIN code verification result returned by the websocket server object of the information security device driver module, calls the timer object to terminate the polling operation, and sends the PIN code verification result to the current page. If the PIN code verification result is successful, execute step 1002. If not, if the PIN code verification result is failed, the current page prompts that the PIN code verification failed.

[0074] Example 2

[0075] This embodiment provides a verification method, including: installing an information security device driver module on a local host and automatically starting a Websocket server object of the information security device driver module, such as Figure 2 As shown, the method includes the following steps:

[0076] Step 201: When the current page and the JS module are loaded by the browser, the JS module is initialized.

[0077] In this embodiment, the JS (JavaScript) module is a custom JS module.

[0078] In this step, the current page and JS module loaded by the browser include:

[0079] The current page displays page elements including special tags for page functions; the redraw interface interface of the JS module is called by the browser, the tag attributes of the special tags for page functions are obtained by the browser so that the browser can create a native tag for the page based on the obtained tag attributes, the hidden attributes of the special tags for page functions are set to be hidden by the browser, and the native tag of the page is set to execute the operation of calling the signature interface when a click event is received.

[0080] The current page displays the page elements including the special tags for page functions as follows: after the current page is parsed by the browser using the HTML language, the page elements including the special tags for page functions are displayed;

[0081] The current page may be a login page, and the page function special label may be a click button. In this embodiment, the page function special label is described as an example of a click button.

[0082] The specific implementation is as follows:

[0083] <asp:ImageButton ID="ImageButton1"runat="server"ImageUrl=" / Account / btLogin.png"

[0084] OnClick="ImageButton1_Click"OnClientClick="return VerifyUserPin();" / >

[0085] ,

[0086] Among them, ImageButton1 is the identifier of the click button, and Account / btLogin.png is the background address of the click button. After the current page is parsed by the browser using HTML language, the click button is displayed according to the identifier of the click button ImageButton1 and the background address of the click button Account / btLogin.png.

[0087] In this embodiment, the redraw interface interface is specifically: RePaintShowUI interface.

[0088] Specifically, in this embodiment, the tag attributes of the page function special tag include tag attributes such as size, position, and background of the page function special tag.

[0089] For example, the specific implementation of the redraw interface interface of the JS module is as follows:

[0090] function RePaintShowUI(){

[0091] var LoginDiv=document.getElementById('DIV_LOGIN');

[0092] var element=document.getElementById('ImageButton1');

[0093] varbtn=document.createElement("input");

[0094] btn.id='FT_VerfyPin'

[0095] btn.type="button";

[0096] var strstyle="top:"+element.style.top+";bottom:"+element.style.bottom+";width:"+element.style.width+";height:"+element.style.height+";border:"+element.style.border+";background:"+element.style.background+";";

[0097] btn.style = strstyle;

[0098] btn.addEventListener("click",FT_VerifyUserPin);

[0099] element.style.display="none";

[0100] LoginDiv.appendChild(btn); return true;

[0101] }

[0102] Among them, the RePaintShowUI() interface of the JS module is called by the browser, the getElementById interface of the RePaintShowUI() interface is called, and the click button object is obtained according to the identifier of the click button ImageButton1. The createElement interface of the RePaintShowUI() interface is called, and the page native label, that is, the new click button, is created according to the properties of the obtained click button, namely top, bottom, width, height, border, and background. The click button is hidden by setting the style.dislay attribute parameter of the click button to none, and the system's addEventListener interface is called to set the new click button. When the new click button executes the click event message, the signature interface is called by the browser.

[0103] The JS module initialization in this step is as follows: the JS module initializes the Websocket client object and the Websocket initialization interface;

[0104] In this embodiment, the JS module initializes the Websocket client object specifically as follows: the JS module sets the IP address and port number of the local machine according to preset data.

[0105] The JS module calls the constructor of the Websocket client to set the local IP address and port number according to the preset data, for example:

[0106] var ws = new WebSocket("ws: / / 127.0.0.1:9446"), where the constructor is newWebSocket, the IP address is 127.0.0.1, and the port number is 9446;

[0107] Step 202: The WebSocket initialization interface of the JS module is called by the current page. The JS module calls the WebSocket client object to send a connection request to the WebSocket server object of the information security device driver module, and initializes the property methods of the WebSocket client object of the JS module.

[0108] Specifically, the connection request sent by the WebSocket client object to the WebSocket server object of the information security device driver module includes the local IP address and port number.

[0109] In this embodiment, the property methods of the WebSocket client object of the JS module include: an onopen method and an onmessage method.

[0110] For example, in this embodiment, the property method of the WebSocket client object of the JS module is specifically implemented as follows: For example:

[0111]

[0112] Among them, the Websocket initialization interface of the JS module, namely the initWebsocket interface, is called by the current page, and the Websocket client object is connected to the WebSocket server object of the information security device driver module by calling the onopen method. The response information callback function is set by calling the onmessage method: after receiving the response information returned by the WebSocket server object, the MessageResult(ev) function is called to convert the string of the response information returned by the WebSocket server object into json format data.

[0113] In step 203, the JS module determines whether the connection status attribute of the WebSocket client object of the JS module indicates a successful connection. If so, the JS module returns a successful connection result to the current page, and step 204 is executed. If not, the JS module returns a failed connection result to the current page based on the connection status attribute of the WebSocket client object, and the process ends.

[0114] In this embodiment, specifically, the connection properties of the WebSocket client object of the JS module may include: connection successful, connection failed, connecting;

[0115] This step is as follows: the JS module determines the value of the connection state attribute readyState of the WebSocket client object ws of the JS module,

[0116] When the JS module determines that the value of the connection state attribute readyState of the JS module's WebSocket client object ws is 1, it indicates that the connection is successful. The JS module returns a connection result of successful connection to the current page, and step 204 is executed;

[0117] When the JS module determines that the value of the connection state attribute readyState of the JS module's WebSocket client object ws is 0, it indicates that the connection is in progress. The JS module returns the connection result of the connection to the current page, prompts the user to refresh the page after a predetermined time, and returns to step 203.

[0118] The current page displays the connection results being connected. The specific implementation examples are as follows:

[0119] document.getElementById("lbMsg").innerText="Establishing a connection with the server. Please wait."

[0120] lbMsg is displayed on the current page as "Establishing connection with the server, please wait."

[0121] When the JS module determines that the value of the connection status attribute readyState of the JS module's WebSocket client object ws is other than 0 or 1, it means that the connection has failed. The JS module returns the connection result of the connection failure to the current page.

[0122] The current page displays the connection result of the failed connection. The specific implementation example is as follows:

[0123] document.getElementById("lbMsg").innerText="Failed to establish a connection with the server. Please check your environment or press F5 to refresh the page."

[0124] lbMsg is displayed on the current page, indicating "Failed to establish a connection with the server. Please check the environment or press F5 to refresh the page."

[0125] In step 204, the device information acquisition interface of the JS module is called by the current page. Based on the call result, it is determined whether an information security device is inserted. If so, the JS module returns a result indicating that the information security device is inserted to the current page, and step 205 is executed. Otherwise, the JS module returns a result indicating that the information security device is not inserted to the current page.

[0126] In this embodiment, this step is specifically as follows:

[0127] m1, the JS module's device information acquisition interface is called by the current page, and the JS module organizes the device status acquisition instruction;

[0128] In this step, the device information acquisition interface of the JS module is called by the current page specifically as follows: the device information acquisition interface of the JS module is called after the current page is set to a blocking mode.

[0129] In this embodiment, the interface for obtaining device information is specifically a GetDevState interface.

[0130] m2, the WebSocket client object of the JS module sends the device status acquisition instruction to the WebSocket server object of the information security device driver module, creates a timer object, and calls the timer object to perform the polling operation;

[0131] For example, steps m1-m2 are implemented as follows:

[0132]

[0133]

[0134] Among them, the GetDevState interface is set to blocking mode through the await keyword, and the device status instruction is composed of: "type": GY_GetDevState, where type is the verification code, GY_GetDevState represents the content of the device status instruction, var strMsg = JSON.stringify(msg) indicates that the JS module converts the device status instruction object into a json string, ws.send(strMsg) indicates that the device status instruction converted into a json string is sent to the WebSocket server object of the information security device driver module; the JS module creates a timer object by calling the setInterval function and starts the polling operation.

[0135] m3, the WebSocket server object of the information security device driver module receives the Get Device Status instruction, uses the Get Device Status instruction as a parameter to call the driver library monitoring interface of the information security device driver module to obtain the status of the information security device;

[0136] In this step, the status of the information security device is obtained by organizing the response data according to the status of the information security device and converting the response data into JSON format to generate a response to the instruction to obtain the device status;

[0137] For example, the response to the Get Device State command is: "{\"type\":\"GetDevState\",\"code\":\"\",\"data\":\"1\"}"

[0138] Among them, type corresponds to the verification code type requested by the WebSocket client, and data indicates that the obtained device status value is 1, that is, the information security device is in the inserted state.

[0139] m4, the WebSocket server object of the information security device driver module sends the status of the information security device to the WebSocket client object of the JS module;

[0140] This step is specifically as follows: the WebSocket server object of the information security device driver module sends the response to the device status instruction to the WebSocket client object of the JS module;

[0141] m5, the WebSocket client object of the JS module receives the status of the information security device, calls the timer object to terminate the polling operation, and sends the status of the information security device as the call result of the device information acquisition interface to the current page;

[0142] This step specifically includes:

[0143] In step m5-1, after the WebSocket client object of the JS module receives the response to the Get Device Status instruction, the WebSocket client object ws.onmessage message response callback function MessageResult(ev) is triggered, and the response to the Get Device Status instruction is parsed to obtain parsed data.

[0144] For example, after the WebSocket client object ws.onmessage message response callback function MessageResult(ev) is triggered, it parses the response to the Get Device Status instruction and obtains the parsed data. The specific implementation is as follows:

[0145] varret = ev.data;

[0146] GY_gResponse=JSON.parse(ret);

[0147] Among them, ev.data is the response data of the GetDevState command: {type:"GetDevState",code:"0",data:"1"}, which is JSON format data. JSON.parse(ret) converts the JSON format data into a JSON object;

[0148] In step m5-2, the WebSocket client object of the JS module determines that the type of the parsed data is the device status type data, obtains the device status value from the parsed data, calls the timer object to terminate the polling operation, and sends the status value of the information security device as the call result of the device information acquisition interface to the current page.

[0149] For example, the WebSocket client object of the JS module determines that the type of parsed data is device status data, obtains the device status value from the parsed data, and calls the timer object to terminate the polling operation. The specific implementation is as follows:

[0150]

[0151]

[0152] Among them, if (GY_GetDevState == GY_gResponse.type) is to determine if the type value in the json object is GetDevState, resolve (data) is to obtain the value 1 of the device status data from the json object; clearInterval (check) calls the timer object to terminate the polling operation;

[0153] In this embodiment, after receiving the status of the information security device sent by the JS module, if the status of the information security device is inserted, step 205 is executed; if the status of the information security device is not inserted, the current page prompts the user to insert the information security device.

[0154] Step 205: The signature interface of the JS module is called by the current page. The WebSocket client object of the JS module sends the data to be signed to the WebSocket server of the information security device driver module, creates a timer object, and calls the timer object to perform a polling operation.

[0155] In this step, the signature interface of the JS module is called by the current page specifically as follows: when the native tag of the page receives a click event, the signature interface of the JS module is called after being set to blocking mode by the current page.

[0156] In this embodiment, the signature interface is specifically: Signdata interface function.

[0157] For example, the signature interface of the JS module is called after the current page is set to blocking mode. The specific implementation is as follows:

[0158]

[0159] Among them, the Signdata interface is set to blocking mode through the await keyword;

[0160] In this step, the WebSocket client object of the JS module sends the data to be signed to the WebSocket server object of the information security device driver module, creates a timer object, and calls the timer object to perform the polling operation. The specific implementation is as follows:

[0161]

[0162]

[0163] Among them, lAlgID is the algorithm identifier for signing the data to be signed, lSignMode is the signature mode, bstrInData is the data to be signed, and lInDataLen is the length of the data to be signed; setInterval means creating a timer object and starting the polling operation.

[0164] In this embodiment, the data to be signed is the data to be signed input by the user through the current page. For example, the data to be signed may be the user name and password input by the user on the current page.

[0165] In this embodiment, before the signature interface of the JS module is called by the current page, the following may also be included:

[0166] Step b1: The PIN verification interface of the JS module is called by the current page, and the JS module obtains the PIN code data;

[0167] In this step, the PIN verification interface of the JS module is called by the current page specifically as follows: when the native tag of the page receives a click event, the PIN verification interface of the JS module is called after being set to blocking mode by the current page.

[0168] In this embodiment, the PIN verification interface is specifically: VerifyUserPin interface, the parameter is the PIN code. The PIN code data is preset or obtained according to the data entered by the user on the current page.

[0169]

[0170]

[0171] Among them, the VerifyUserPin interface is set to blocking mode through the await keyword;

[0172] Step b2: The WebSocket client object of the JS module sends the PIN code data to the WebSocket server object of the information security device driver module, creates a timer object, and calls the timer object to perform a polling operation;

[0173] For example, this step is specifically implemented as follows:

[0174]

[0175]

[0176] Where strPin is the PIN code data. The PIN code data is used as a parameter of the VerifyUserPin interface and is sent to the WebSocket server object of the information security device driver module by calling the VerifyUserPin interface.

[0177] Step b3: The WebSocket server object of the information security device driver module verifies the PIN code data and sends the PIN code verification result to the WebSocket client object of the JS module;

[0178] Step b4: After receiving the verification result, the WebSocket client object of the JS module calls the timer object to terminate the polling operation and returns the PIN code verification result to the current page as the call result of the PIN verification interface of the JS module;

[0179] This step specifically includes:

[0180] Step b4-1: After the WebSocket client object of the JS module receives the verification result, the WebSocket client object ws.onmessage message response callback function MessageResult(ev) is triggered, and the verification result is parsed to obtain the parsed data of the verification result.

[0181] For example, the specific implementation is as follows:

[0182] varret = ev.data;

[0183] GY_gResponse=JSON.parse(ret);

[0184] Among them, ev.data is the verification result data: {type: "VerifyUserPin", code: "0", data: "1"}, which is JSON format data. JSON.parse(ret) converts the JSON format data into a JSON object;

[0185] In step b4-2, the WebSocket client object of the JS module determines that the type of the parsed data is verification result data, obtains the verification result from the verification result data, calls the timer object to terminate the polling operation, and sends the verification result as the call result of the VerifyUserPin interface to the current page.

[0186] For example, this step is specifically implemented as follows:

[0187]

[0188] Among them, if (GY_VerifyUserPin == GY_gResponse.type) is to determine if the type value in the json object is VerifyUserPin, resolve (data) is to verify the value of the result data from the json object is 1, that is, the verification result is successful; clearInterval means calling the timer object to terminate the polling operation;

[0189] In this embodiment, specifically, after the current page receives the PIN code verification result returned by the JS module, if the PIN code verification result is successful, step 205 is executed; if the PIN code verification result is failed, a PIN code verification error is prompted and the process ends;

[0190] Step 206: The WebSocket server object of the information security device driver module receives the data to be signed, uses the data to be signed as a parameter, and calls the driver library export interface of the information security device driver module to obtain signature result data.

[0191] This step is specifically as follows: after the WebSocket server object of the information security device driver module receives the data to be signed, the WebSocket server object of the information security device driver module calls the serial number acquisition interface of the driver library to obtain the serial number of the information security device, and calls the driver library export interface of the information security device driver module with the data to be signed and the serial number of the information security device as parameters to obtain the signature result data including the signature data and the public key of the information security device.

[0192] In this embodiment, when the driver library export interface of the information security device driver module is called, the information security device obtains the private key of the information security device stored in itself and signs the signature data and the serial number of the information security device according to a preset algorithm to obtain the signature result data including the signature data and the public key signature result data of the information security device, and returns the signature result data as the result of the driver library export interface to the WebSocket server object of the information security device driver module.

[0193] For example, the serial number of the information security device obtained is: GY0000000011. The information security device obtains the private key of the information security device stored in itself, and signs the signature data and the serial number of the information security device: user00001|test1234|GY0000000011 according to the algorithm specified by the JS module: RSA2048 / sha256, and obtains the signature result data: 83F68B1D12F86A829EAB 2C211161FD2D6E970AFF59123F7782EDB6EB9DA44D82DC66E9C4B676DF6DFD4F27F4D2644018CFC69D 83848B6C853348FCC7F7C798B7023CE2A8A5237AD72A0E8003A73950B6FECCDF088AC58FA16AAFCF6C B4B935CF659BCE9AC05A6ACA8807E4E3ADBD5751B9650397C30A698B00B729CD9CD0B582837A8962D8 9CAF2630931141904A15A1D5FC8A858925781622A0F5F29ED563FD7BEDEE8B5BE81711BF9E492AEDEF 19FA9478D95098473150D936FE5D1FC7B7D3F182589C1A69F5A2FD2B70F126FE3774C9EAE376EF0D44 8775D333F80DB2464805DA35957509AA65490E242B83772DC90E39FF02F50B3557F25C23F5455BB4C2,For example, the public key of an information security device is: c4e012f55724ac287e5b1c0dde9715bde249b3d2471e2e90f06f206022efaa2c4be9a6cd1c0ad9050968515b7bec5935d58d9d2fe0678f54ed20b09188d0d35e031b36d7bb1e549fb85c9b971d740783a04c2d9c791618b7ed50445fe33e50587044a76fd1af41e74abf20a9a4a242db2a9ef94a34de1644c563000cb3 1f57922d6994d55e0cef230724775d1245b31bcfd49119172ae6393f835d244b3 5feae5b660903d3e33cdd0ecf5a12742a64312e523c58028463bd293c4f0e455c8 22d66c67c536ea2c10b77204b2ded2d871f903e06df9f344b2257272e423c1f280 e6eb432075804644d6d1214af9dc76fe9b7ac53db5d01bb108aa2edab8dfd636b. ,

[0194] Step 207: The WebSocket server object of the information security device driver module sends the signature result data to the WebSocket client object of the JS module;

[0195] This step is specifically as follows: the WebSocket server object of the information security device driver module sends the signature result data to the WebSocket client object of the JS module;

[0196] Step 208: The WebSocket client object of the JS module receives the signature result data. The JS module calls the timer object to terminate the polling operation and sends the signature result data as the call result of the signature interface to the current page.

[0197] This step specifically includes:

[0198] Step c1: After the WebSocket client object of the JS module receives the signature result data, the WebSocket client object ws.onmessage message response callback function MessageResult(ev) is triggered to obtain the signature result data;

[0199] The specific implementation is as follows:

[0200] varret=ev.data;

[0201] GY_gResponse=JSON.parse(ret);

[0202] Among them, ev.data is the signature result data: {type: "Signdata", code: "0", data: "83F68B1D12F86A829EAB2C211161FD2D6E970AFF59123F7782EDB6EB9DA44D82DC66E9C4B676DF6DFD4F27F4D2644018CFC69D83848B6C853348FC C7F7C798B7023CE2A8A5237AD72A0E8003A73950B6FECCDF088AC58FA16AAFCF6CB4B935CF659BCE9AC05A6ACA8807E4E3ADBD5751B9650397C30A698B\00B729CD9CD0B582837A8962D89CAF2630931141904A15A1D5FC8A85892 5781622A0F5F29ED563FD7BEDEE8B5BE81711BF9E492AEDEF19FA9478D950 98473150D936FE5D1FC7B7D3F182589C1A69F5A2FD2B70F126FE3774C9EAE376EF0D448775D333F80DB2464805DA35957509AA65490E242B83772DC90E39FF02F50B3557F25C23F5455BB4C2|c4e012f55724ac287e5b1c0dde9715bde249b3d2471e2e90f06f206022efaa2c4be9a6cd1c0ad9050968515b7bec5935d58d9d2fe0678f54ed20b09188d0d35e031b36d7bb1e549fb85c9b971d740783a04c2d9c791618b7ed50445fe33e50587044a76fd1af41e74abf20a9a4a242db2a9ef94a34de1644c563000cb31f57922d6994d55e0cef230724775d1245b31bcfd49119172ae6393f835d244b35feae5b660903d3e33cdd0ecf5a12742a64312e523c58028463bd293c4f0e455c822d66c67c536ea2c10b77204b2ded2d871f903e06df9f344b2257272e423c1f280e6eb432075804644d6d1214af9dc76fe9b7ac53db5d01bb108aa2edab8dfd636b”}, which is JSON format data. JSON.parse(ret) is used to convert the signature result data in JSON format into a JSON object.

[0203] Step c2: The WebSocket client object of the JS module determines whether the type of the signature result data is the signature type. If so, the JS module calls the timer object to terminate the polling operation and send the signature result data to the current page. If not, the JS module calls the timer object to continue the polling operation.

[0204] For example, step c2 is specifically implemented as follows:

[0205]

[0206]

[0207] Among them, if (GY_Signdata == GY_gResponse.type) is when the WebSocket client object of the JS module determines that the type of the signature result data is the signature type GY_Signdata, resolve (data) is the WebSocket client object of the JS module obtaining the signature result data, and clearInterval is the JS module calling the timer to terminate the polling operation.

[0208] Step 209: The JS module creates a click event message and executes the click event message through a special tag of the page function.

[0209] For example, this step is specifically implemented as follows:

[0210] var e=document.createEvent("MouseEvents");

[0211] e.initEvent("click",true,true);

[0212] document.getElementById("ImageButton1").dispatchEvent(e);

[0213] Among them, ImageButton1 is a special tag of the page function, that is, the identifier of the click button. The JS module creates a click event message Onclick, and executes the click event message by clicking the button according to the identifier of the click button.

[0214] In this embodiment, specifically, when the button is clicked to execute the click event message, the current page calls the signature verification interface of the server, sends the signature result data to the server for verification, receives the verification result returned by the server, and displays the verification result returned by the server.

[0215] Example 3

[0216] This embodiment provides a verification method, such as Figure 3 Shown, including:

[0217] Step 301: When the current page and the JS module are loaded by the browser, the JS module is initialized;

[0218] In this embodiment, the JS (JavaScript) module is a custom JS module.

[0219] In this step, the current page and JS module loaded by the browser include:

[0220] The current page and JS module are loaded by the browser. The current page displays page elements including the special tags for page functions, and loads the hidden tags for obtaining credential ID and setting binding credential ID. The redraw interface interface of the JS module is called by the browser, and the tag attributes of the special tags for page functions are obtained by the browser so that the browser can create native tags for the page based on the obtained tag attributes. The hidden attributes of the special tags for page functions are set to hidden by the browser.

[0221] The current page displays page elements including special tags for page functions, and loads hidden tags for obtaining credential ID and setting binding credential ID. Specifically, after the current page is parsed by the browser using HTML language, it displays page elements including special tags for page functions, and loads hidden tags for obtaining credential ID and setting binding credential ID.

[0222] In this embodiment, the current page is a login page, and the special label of the page function is a click button.

[0223] Specifically, in this embodiment, the redraw interface interface is specifically: RePaintShowUI interface;

[0224] The tag attributes of the page function special tag include: tag attributes such as size, position, background, etc. of the page function special tag.

[0225] The specific example implemented in this step is as follows:

[0226] function RePaintShowUI(){

[0227] var LoginDiv = document.getElementById('DIV_LOGIN');

[0228] var element = document.getElementById('ImageButton1');

[0229] var btn = document.createElement("input");

[0230] btn.id = 'FT_VerfyPin';

[0231] btn.type = "button";

[0232] var strstyle = "top:" + element.style.top + ";bottom:" + element.style.bottom + ";width:" + element.style.width + ";height:" + element.style.height + ";border:" + element.style.border + ";background:" + element.style.background + ";";

[0233] btn.style = strstyle;

[0234] btn.addEventListener("click", FT_VerifyUserPin);

[0235] element.style.display = "none";

[0236] LoginDiv.appendChild(btn); return true;

[0237] }

[0238] Among them, the RePaintShowUI() interface of the JS module is called by the browser, the getElementById interface of the RePaintShowUI() interface is called, and the page function special label, that is, the click button object, is obtained according to the identifier ImageButton1 of the click button. The createElement interface of the RePaintShowUI() interface is called, and the page native label, that is, the new click button, is created according to the obtained properties of the click button, that is, top, bottom, width, height, border, and background. The click button is hidden by setting the style.dislay attribute parameter of the click button to none.

[0239] In this step, the JS module initialization specifically includes: JS module initialization obtains the credential ID interface, the verification confirmation interface and the registration credential interface;

[0240] Step 302: The JS module's credential ID acquisition interface is called by the current page. The JS module notifies the server to acquire the credential ID, creates a timer object, and calls the timer object to perform a polling operation.

[0241] In this embodiment, after the native tag of the current page is triggered by the user, the JS module creates a click event message, executes the click event message through the Get Credential ID tag, and the Get Credential ID interface of the JS module is called by the current page. The JS module sends a Get Credential ID notification to the server. After receiving the Get Credential ID notification, the server searches for the Credential ID based on the username entered by the user on the current page.

[0242] In this embodiment, the JS module's credential ID acquisition interface is called by the current page specifically as follows: the JS module's credential ID acquisition interface is called after the current page is set to blocking mode;

[0243] Specifically, the interface for obtaining the credential ID is the GetCredentialID interface;

[0244] This step is as follows: when the GetCredentialID interface of the JS module is called by the current page, the JS module sends a notification to the server to obtain the credential ID, creates a timer object, and calls the timer object to perform the polling operation;

[0245] For example, the specific implementation is as follows:

[0246]

[0247]

[0248] Among them, after the native tag of the current page is triggered by the user, the JS module creates a click event message, and executes the click event message by getting the credential ID tag according to the hidden GetCredentialID tag identifier. The JS module calls the GetCredentialID interface, sets the GetCredentialID interface to blocking mode through the await keyword, creates a timer object through setInterval, and calls the timer object to perform polling operations.

[0249] Step 303: The JS module receives the response to the Get Credential ID notification sent by the server, stops the timer object from performing the polling operation, and obtains the credential ID from the response to the Get Credential ID notification;

[0250] In this embodiment, this step is specifically as follows: the JS module receives the response to the Get Credential ID notification sent by the server, and determines whether a credential ID corresponding to the user name exists based on the response to the Get Credential ID notification. If so, the credential ID is obtained from the response to the Get Credential ID notification, the polling operation of the timer object is terminated, and step 304 is executed. If not, steps F1-F2 are executed.

[0251] In this step, the JS module receives the following response from the server:

[0252] When the JS module determines that the tag value of the tag identified as CredentialIDData is data with a data length greater than 0, it calls the clearInterval interface to terminate the timer object from performing the polling operation;

[0253] Determine whether there is a credential ID corresponding to the user name based on the response to the credential ID notification: Determine whether the tag value of the tag identified as CredentialIDData is null. If not, obtain the tag value, which is the credential ID. If so, execute steps F1-F2.

[0254] Step F1: The JS module calls the registration credential interface to enable the information security device to create a corresponding credential ID and key pair according to the user name, and obtain the key pair public key and credential ID;

[0255] In this embodiment, the registration credential interface may be the returnnavigator.credentials.create interface;

[0256] In this embodiment, this step is specifically implemented as follows:

[0257]

[0258] UserName is the user name.

[0259] In step F2 , when the JS module's credential ID setting interface is called by the current page, the JS module notifies the server to bind the user name to the credential ID and store it in correspondence with the public key of the key pair, and then executes step 304 .

[0260] This step is specifically as follows: the JS module creates a click event message, executes the click event message by setting the binding credential ID tag, sets the credential ID interface to be called by the current page, and notifies the server to bind the user name to the credential ID and store it in correspondence with the public key of the key pair.

[0261] In this embodiment, the credential ID setting interface is specifically: SetCredentialID interface;

[0262] The specific implementation is as follows:

[0263]

[0264]

[0265] Among them, the JS module receives the key pair public key and credential ID sent by the server, calls the createEvent interface to create a click event message, executes the click event by setting the binding credential ID tag according to the identifier SetCredentialID of the binding credential ID tag, calls the credential ID setting interface SetCredentialID, and notifies the server to bind the user name with the credential ID and store it corresponding to the key pair public key.

[0266] Step 304: The JS module calls the verification and confirmation interface, generates data to be signed based on the credential ID and user name, and sends the data to be signed to the information security device by sending a signature request;

[0267] Specifically, in this embodiment, the verification confirmation interface is: returnnavigator.credentials.get interface.

[0268] Step 305: The information security device searches for the corresponding key pair and private key according to the user name, signs the data to be signed using the private key to obtain a signature result, and sends the signature result to the JS module;

[0269] For example, steps 304 and 305 are specifically implemented as follows:

[0270]

[0271]

[0272] Among them, CredentialID is the credential ID, UserName is the user name, getAssertionOptions is used to generate the data to be signed based on the credential ID and user name, and the result of calling the returnnavigator.credentials.get interface with getAssertionOptions as the parameter is the signature result obtained after the information security device uses the key to sign the private key.

[0273] Step 306: The JS module receives the signature result sent by the information security device and sends the signature result to the current page;

[0274] For example, this step is specifically implemented as follows:

[0275] EnData=getAssertionReal(challenge);

[0276] DigestID.innerHTML=" <input type='hidden'name='EncData'Value='"+EnData+"'> "

[0277] Among them, Endata is the signature result sent by the information security device. After the JS module receives the signature result sent by the information security device, it sends the signature result to the current page. Hidden indicates that the display attribute of the signature result on the current page is hidden.

[0278] Step 307: The JS module creates a click event message and executes the click event message through a special tag of the page function;

[0279] For example, this step is specifically implemented as follows:

[0280] var e=document.createEvent("MouseEvents");

[0281] e.initEvent("click",true,true);

[0282] document.getElementById("ImageButton1").dispatchEvent(e);

[0283] Among them, the JS module calls the createEvent interface to create a click event message Onclick, and executes the click event message through the page function special tag according to the identifier ImageButton1 of the page function special tag.

[0284] Step 308: The current page calls the signature verification interface of the server and sends the signature result sent by the JS module to the server for verification.

[0285] Example 4

[0286] This embodiment provides a verification method, including: installing an information security device driver module on the local machine and automatically starting the Websocket server object of the information security device driver module, such as Figure 4 As shown, the method includes the following steps:

[0287] Step 401: When the current page and the JS module are loaded by the browser, the JS module is initialized;

[0288] In this embodiment, the process of the current page and the JS module being loaded by the browser is the same as that in the second embodiment and will not be repeated here.

[0289] In step 402, the JS module waits to be called by the current page. When the Websocket initialization interface of the JS module is called by the current page, steps A1-A2 are executed. When the device information acquisition interface of the JS module is called by the current page, steps B1-B5 are executed. When the PIN verification interface of the JS module is called by the current page, steps C1-C4 are executed. When the signature interface of the JS module is called by the current page, steps D1-D3 are executed.

[0290] Step A1: The JS module calls the WebSocket client object to send a connection request to the WebSocket server object of the information security device driver module, and initializes the property methods of the WebSocket client object of the JS module;

[0291] Step A2: The JS module obtains a connection result based on the value of the connection property of the JS module's WebSocket client object, and sends the obtained connection result to the current page, and then returns to step 402;

[0292] Step B1: The JS module obtains the device status instruction sent by the current page;

[0293] Step B2: The WebSocket client object of the JS module sends a device status acquisition instruction to the WebSocket server object of the information security device driver module, creates a timer object, and calls the timer object to perform a polling operation;

[0294] Step B3: The WebSocket server object of the information security device driver module receives the Get Device Status instruction, uses the Get Device Status instruction as a parameter to call the driver library monitoring interface of the information security device driver module to obtain the status of the information security device;

[0295] Step B4: The WebSocket server object of the information security device driver module sends the status of the information security device to the WebSocket client object of the JS module;

[0296] Step B5: The WebSocket client object of the JS module receives the status of the information security device, calls the timer object to terminate the polling operation, sends the status of the information security device as the call result of the device information acquisition interface to the current page, and returns to step 402;

[0297] Step C1, the JS module obtains the PIN code data;

[0298] Step C2: The WebSocket client object of the JS module sends the PIN code data to the WebSocket server object of the information security device driver module, creates a timer object, and calls the timer object to perform a polling operation;

[0299] Step C3: The WebSocket server object of the information security device driver module verifies the PIN code data and sends the verification result to the WebSocket client object of the JS module;

[0300] Step C4: After receiving the verification result, the WebSocket client object of the JS module calls the timer object to terminate the polling operation, and returns the verification result to the current page as the call result of the PIN verification interface of the JS module, and returns to step 402;

[0301] Step D1, the JS module receives the data to be signed sent by the current page;

[0302] Step D2: The WebSocket client object of the JS module sends the data to be signed to the WebSocket server object of the information security device driver module, creates a timer object, and calls the timer object to perform a polling operation;

[0303] In this embodiment, the WebSocket server object of the information security device driver module receives the data to be signed, uses the data to be signed as a parameter to call the driver library export interface of the information security device driver module to obtain the signature result data of the data to be signed; the WebSocket server object of the information security device driver module sends the signature result data to the WebSocket client object of the JS module;

[0304] In step D3, the WebSocket client object of the JS module receives the signature result data, the JS module calls the timer object to terminate the polling operation, sends the signature result data as the call result of the signature interface to the current page, and returns to step 402.

[0305] Example 5

[0306] This embodiment provides a verification device, including:

[0307] Loading display creation module, used for the current page and JS module to be loaded by the browser, the current page displays page elements including page function special tags, the JS module's redraw interface interface is called by the browser, and page native tags are created on the current page according to the page function special tags. The attributes of the page function special tags are set to be hidden by the browser;

[0308] An execution calling module is used for the native tag of the page to receive and execute the first click event message. The first interface of the JS module is called after the current page is set to blocking mode. The JS module sends the user input data to be processed to the information security device, creates a timer object, and calls the timer object to perform a polling operation.

[0309] A call receiving module, configured to call a timer object to terminate the polling operation after the JS module receives the first call result of the first interface;

[0310] The first sending module is used for the JS module to send the first call result to the current page;

[0311] Create an execution module for the JS module to create a second click event message, and execute the second click event message through a special tag of the page function;

[0312] The second sending module is used for the current page to send the first call result to the server for verification.

[0313] Load and display the creation module, and also load the hidden third label on the current page;

[0314] The execution calling module is specifically used for the native tag of the page to receive the first click event message, the JS module to create a third click event message, and execute the third click event message through the third tag. The first interface of the JS module is called after the current page is set to blocking mode, a timer object is created, and the timer object is called to perform a polling operation;

[0315] The first sending module specifically includes:

[0316] A generating unit, configured for the JS module to generate data to be signed according to the first call result;

[0317] The signature sending unit is used for the JS module to send the data to be signed to the information security device for signing, obtain the signature result, and send the signature result to the current page;

[0318] The second sending module is specifically used for the current page to send the signature result to the server for verification.

[0319] Loads the display creation module and is also used to load the hidden fourth tab;

[0320] The first sending module also includes:

[0321] A judgment generating unit, configured for the JS module to determine whether the first call result includes credential data. If so, the JS module generates data to be signed based on the credential data in the first call result and triggers the signature sending unit; if not, triggers the search and acquisition unit;

[0322] The search and acquisition unit is used for the JS module to call the browser interface, so that the server searches for the corresponding credential data according to the user name and obtains the credential data returned by the server from the call result;

[0323] An execution unit is created, and is also used for the JS module to create a fourth click event message and execute the fourth click event message through the fourth tag; the second interface of the JS module is called by the current page, and the current page notifies the server to perform a binding operation according to the credential data;

[0324] The generation unit is specifically used by the JS module to generate data to be signed based on the credential data and trigger the signature sending unit.

[0325] The first interface is specifically a signature interface;

[0326] The execution calling module is specifically used to execute the first click event message of the page native tag. The signature interface of the JS module is called after the current page is set to blocking mode. The JS module sends the data to be signed to the information security device, creates a timer object, and calls the timer object to perform the polling operation;

[0327] The first call result is specifically: the signature result data returned by the information security device, wherein the encryption result data includes the signature data of the data to be signed and the device public key;

[0328] The second sending module is specifically used for the current page to call the signature verification interface of the server and send the received signature result data to the server for verification.

[0329] The third tag is specifically: Get Credential ID Tag; the first interface is specifically: Get Credential ID Interface;

[0330] The execution call interface is specifically used for the page native tag to receive the first click event message, the JS module to create a third click event message, and execute the third click event message through the third tag. The JS module's credential ID acquisition interface is called after the current page is set to blocking mode. The JS module sends a notification to the server to obtain the credential ID, creates a timer object, and calls the timer object to perform a polling operation;

[0331] The first call result is specifically: the credential ID returned by the server;

[0332] The generation unit is specifically used by the JS module to generate the data to be signed based on the credential ID and user name;

[0333] The signature sending unit is specifically used for the JS module to call the verification confirmation interface to send the data to be signed to the information security device for signing, obtain the signature result, and send the signature result to the current page.

[0334] The third tag is specifically: Get credential ID tag; the fourth tag is specifically: Set binding credential ID tag; the credential data is specifically the credential ID;

[0335] The first interface is specifically: Get credential ID interface;

[0336] The judgment and generation unit is specifically configured to receive the response of the credential ID acquisition notification sent by the server in the JS module, terminate the timer object to perform the polling operation, and determine whether the credential ID exists in the response of the credential ID acquisition notification. If so, the JS module generates the data to be signed based on the credential ID and the user name, triggering the signature sending unit; if not, triggering the search and acquisition unit;

[0337] The search and acquisition unit is specifically used for the JS module to call the registration credential interface, so that the server searches for the corresponding credential data according to the user name and receives the public key and credential ID of the key pair sent by the server;

[0338] An execution unit is created, specifically used for the JS module to create a fourth click event message, and execute the fourth click event message by setting a binding credential ID tag; the JS module's credential ID setting interface is called by the current page, and the current page notifies the server to bind the user name to the credential ID and store it in correspondence with the public key of the key pair;

[0339] The generation unit is specifically used by the JS module to generate the data to be signed based on the credential ID and user name; triggering the signature sending unit;

[0340] The second sending unit is specifically configured to call the signature verification interface of the server on the current page and send the signature result to the server for verification.

[0341] The connection module is called, and the third interface of the JS module is called by the current page, and the Websocket client object of the JS module establishes a connection with the Websocket server of the information security device.

[0342] The calling judgment module is used for the fourth interface of the JS module to be called by the current page. The JS module sends the calling result of the fourth interface to the current page for the current page to judge whether the calling result of the fourth interface meets the requirements. If yes, the execution calling unit is triggered; if not, the prompt module is triggered.

[0343] The prompt module is used to perform prompt operations on the current page.

[0344] The fourth interface is specifically: Get device information interface,

[0345] The calling judgment module is specifically used for: after the JS module's device information acquisition interface is set to blocking mode by the current page, the JS module's websocket client object sends the device status acquisition instruction to the websocket server object of the information security device driver module, creates a timer object, and calls the timer object to perform the polling operation;

[0346] The websocket client object of the JS module receives the response of the get device status instruction returned by the websocket server of the information security device driver module, obtains the device status value from the response, calls the timer object to terminate the polling operation, and sends the device status value to the current page. If the device status value indicates that the information security device has been inserted, the execution calling module is triggered. If the device status value indicates that the information security device has not been inserted, the prompt module is triggered.

[0347] The prompt module is specifically used to prompt that the information security device is not inserted on the current page.

[0348] The fourth interface is specifically: PIN verification interface, calling the judgment module specifically for:

[0349] The JS module's device information acquisition interface is called after the current page is set to blocking mode. The JS module's websocket client object sends the acquired PIN code data to the websocket server of the information security device driver module, creates a timer object, and calls the timer object to perform the polling operation.

[0350] The websocket client object of the JS module receives the PIN code verification result returned by the websocket server object of the information security device driver module, calls the timer object to terminate the polling operation, and sends the PIN code verification result to the current page. If the PIN code verification result is successful, the call module is triggered to execute. If not, if the PIN code verification result is failed, the prompt module is triggered.

[0351] The prompt module is specifically used to prompt that the PIN code verification fails on the current page.

[0352] Optionally, an embodiment of the present application further provides a verification device, which includes at least one processor, a memory, and instructions stored in the memory and executable by the at least one processor, and the at least one processor executes the instructions to implement the method in the above embodiment. When the device is a chip system, it can be composed of a chip, or it can include a chip and other discrete devices, which is not specifically limited in the embodiment of the present application; the chip is coupled to the memory and is used to execute the computer program stored in the memory to execute the method disclosed in the above embodiment; this embodiment also provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a computer program, and when the computer program is run on a computer, the computer executes the method disclosed in the above embodiment.

[0353] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A verification method, characterized in that: The method comprises the following steps: Step 1001: The current page and the JS module are loaded by the browser. The current page displays page elements including page function-specific tags. The browser calls the JS module's redraw interface interface to create a page native tag on the current page based on the page function-specific tags. The browser sets the attributes of the page function-specific tags to be hidden. Step 1002: The native tag of the page receives and executes the first click event message. The first interface of the JS module is called after the current page is set to blocking mode. The JS module sends the to-be-processed data input by the user to the information security device, creates a timer object, and calls the timer object to perform a polling operation. Step 1003: After receiving the first call result of the first interface, the JS module calls the timer object to terminate the polling operation; Step 1004: The JS module sends the first call result to the current page; Step 1005: The JS module creates a second click event message, and executes the second click event message through the page function special tag; Step 1006: When the current page detects that the page function special tag executes the second click event, the first call result is sent to the server for verification; The step 1001 further includes: loading a hidden fourth tag; The step 1004 specifically includes: Step C1: The JS module determines whether the first call result includes credential data. If so, the JS module generates data to be signed based on the credential data in the first call result, sends the data to be signed to the information security device for signing, obtains a signature result, and sends the signature result to the current page. If not, execute step C2. Step C2: the JS module calls the browser interface, causing the information security device to create corresponding credential data according to the user name, and obtain the credential data from the call result; Step C3, the JS module creates a fourth click event message, and executes the fourth click event message through the fourth tag; Step C4: the second interface of the JS module is called by the current page, and the current page notifies the server to perform a binding operation according to the credential data; In step C5, the JS module generates data to be signed based on the credential data, sends the data to be signed to the information security device for signing to obtain a signature result, and sends the signature result to the current page.

2. The method according to claim 1, wherein The step 1001 further includes: loading a hidden third tag on the current page; Step 1002 specifically includes: the native tag of the page receives the first click event message, the JS module creates a third click event message, executes the third click event message through the third tag, the first interface of the JS module is called after the current page is set to blocking mode, creates a timer object, and calls the timer object to perform a polling operation; The step 1006 is specifically as follows: the current page sends the signature result to the server for verification.

3. The method according to claim 1, wherein: The first interface is specifically a signature interface; Step 1002 specifically includes: the native tag of the page receives and executes the first click event message, the signature interface of the JS module is called after the current page is set to blocking mode, the JS module sends the data to be signed to the information security device, creates a timer object, and calls the timer object to perform a polling operation; The first call result in step 1003 is specifically: the signature result data returned by the information security device; The step 1006 is specifically as follows: the current page calls the signature verification interface of the server and sends the received signature result data to the server for verification.

4. The method according to claim 2, wherein: The third tag is specifically: Get Credential ID Tag; the first interface is specifically: Get Credential ID Interface; Step 1002 specifically includes: the native tag of the page receives the first click event message, the JS module creates a third click event message, executes the third click event message through the third tag, the JS module's credential ID acquisition interface is called after the current page is set to blocking mode, the JS module sends a credential ID acquisition notification to the server, creates a timer object, and calls the timer object to perform a polling operation; The first call result in step 1003 is specifically: the credential ID returned by the server.

5. The method according to claim 2, wherein: The third tag is specifically: Get credential ID tag; the fourth tag is specifically: Set bind credential ID tag; the credential data is specifically the credential ID; The first interface in step 1002 is specifically: obtaining a credential ID interface; The step C1 specifically comprises: the JS module receives a response to the credential ID acquisition notification sent by the server, terminates the timer object to perform a polling operation, and determines whether a credential ID exists in the response to the credential ID acquisition notification; if so, the JS module generates data to be signed based on the credential ID and the user name, sends the data to be signed to the information security device for signing, obtains a signature result, and sends the signature result to the current page; if not, executes step C2; Step C2 is specifically as follows: the JS module calls the registration credential interface, causing the information security device to create corresponding credential data according to the user name, and obtain the key pair public key and credential ID from the call result; Specifically, C3 includes: the JS module creating a fourth click event message, and executing the fourth click event message by setting the binding credential ID tag; The step C4 is specifically as follows: the JS module's credential ID setting interface is called by the current page, and the current page notifies the server to bind the user name to the credential ID and store them in correspondence with the public key of the key pair; The step C5 specifically comprises: the JS module generates data to be signed according to the credential ID and the user name, sends the data to be signed to the information security device for signing to obtain a signature result, and sends the signature result to the current page; The step 1006 is specifically as follows: the current page calls the signature verification interface of the server and sends the signature result to the server for verification.

6. The method according to claim 3, wherein: The process before step 1002 also includes: the third interface of the JS module is called by the current page, and the Websocket client object of the JS module establishes a connection with the Websocket server object of the information security device driver module.

7. The method according to claim 3, wherein: Before step 1002, step M is also included: the fourth interface of the JS module is called by the current page, and the JS module sends the calling result of the fourth interface to the current page for the current page to determine whether the calling result of the fourth interface meets the requirements. If yes, step 1002 is executed; if not, the current page performs a prompt operation.

8. The method according to claim 7, wherein: The fourth interface is specifically: obtaining device information interface, and the step M specifically includes: Step m1: After the JS module's device information acquisition interface is set to blocking mode by the current page, the JS module's Websocket client object sends a device status acquisition instruction to the Websocket server object of the information security device driver module, creates a timer object, and calls the timer object to perform a polling operation; In step m2, the Websocket client object of the JS module receives the response of the instruction to obtain the device status returned by the Websocket server object of the information security device driver module, obtains the device status value from the response, calls the timer object to terminate the polling operation, and sends the device status value to the current page. If the device status value indicates that the information security device has been inserted, execute step 1002. If the device status value indicates that the information security device has not been inserted, the current page prompts that the information security device has not been inserted.

9. The method according to claim 7, wherein: The fourth interface is specifically a PIN verification interface, and the step M specifically includes: Step m01: After the PIN verification interface of the JS module is set to blocking mode by the current page, the Websocket client object of the JS module sends the obtained PIN code data to the Websocket server object of the information security device driver module, creates a timer object, and calls the timer object to perform a polling operation; In step m02, the Websocket client object of the JS module receives the PIN code verification result returned by the Websocket server object of the information security device driver module, calls the timer object to terminate the polling operation, and sends the PIN code verification result to the current page. If the PIN code verification result is successful, step 1002 is executed. If not, if the PIN code verification result is failed, the current page prompts that the PIN code verification failed.

10. A verification device, characterized in that: The device is implemented by the verification method according to any one of claims 1 to 9, and the device includes: A loading display creation module is used to load the current page and the JS module by the browser, the current page displays page elements including page function special tags, the JS module's redraw interface interface is called by the browser, and a page native tag is created on the current page according to the page function special tags, and the attributes of the page function special tags are set to be hidden by the browser; An execution calling module is configured to receive and execute a first click event message by the native tag of the page, wherein the first interface of the JS module is called after the current page is set to a blocking mode, the JS module sends the to-be-processed data input by the user to the information security device, creates a timer object, and calls the timer object to perform a polling operation; A call receiving module, configured to call a timer object to terminate the polling operation after the JS module receives the first call result of the first interface; A first sending module, configured for the JS module to send the first call result to the current page; Create an execution module, which is used for the JS module to create a second click event message, and execute the second click event message through the special tag of the page function; The second sending module is used for the current page to send the first call result to the server for verification.

11. A verification device, characterized in that: The device includes at least one processor, a memory, and instructions stored in the memory and executable by the at least one processor, and the at least one processor executes the instructions to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that The computer-readable storage medium comprises a computer program, and when the computer program is run on a computer, the computer is caused to perform the method according to any one of claims 1 to 9.

13. A chip, characterized in that: The chip is coupled to a memory and is configured to execute a computer program stored in the memory to perform the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • A method and apparatus for page refresh

    CN109101310A

  • A method for realizing signature through a script device and the script device

    CN109726573A

  • Message generation

    GB2382008B