CN107241192B - A method and device for logging in using a fingerprint key - Google Patents
A method and device for logging in using a fingerprint key Download PDFInfo
- Publication number
- CN107241192B CN107241192B CN201710389097.3A CN201710389097A CN107241192B CN 107241192 B CN107241192 B CN 107241192B CN 201710389097 A CN201710389097 A CN 201710389097A CN 107241192 B CN107241192 B CN 107241192B
- Authority
- CN
- China
- Prior art keywords
- fingerprint
- function
- key
- login
- pin code
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3226—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN
- H04L9/3231—Biological data, e.g. fingerprint, voice or retina
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0853—Network architectures or network communication protocols for network security for authentication of entities using an additional device, e.g. smartcard, SIM or a different communication terminal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0861—Network architectures or network communication protocols for network security for authentication of entities using biometrical features, e.g. fingerprint, retina-scan
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3234—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving additional secure or trusted devices, e.g. TPM, smartcard, USB or software token
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biodiversity & Conservation Biology (AREA)
- Collating Specific Patterns (AREA)
- Storage Device Security (AREA)
Abstract
本发明公开一种使用指纹key进行登录的方法及装置,该方法包括:装置获取登录验证方式,并将其返回给操作系统;如装置获取第三函数参数中的登录验证方式为外部验证方式时获取第三函数参数中的登录界面窗口句柄并保存;装置根据保存的登录界面窗口句柄弹出指纹验证提示框,提示用户在指纹key上输入指纹进行验证;装置将待签名数据发送给指纹key,如指纹key的当前状态为指纹验证已通过则使用第五函数的参数定位签名私钥和签名算法,使用签名私钥根据签名算法对待签名数据进行运算生成登录操作系统所需的凭据信息,并将其返回给操作系统。本发明技术方案让指纹Key直接在Windows系统中能正常使用,方便用户使用。
The invention discloses a method and device for logging in using a fingerprint key. The method includes: the device acquires a login verification method and returns it to the operating system; if the device obtains the login verification method in the third function parameter as an external verification method Obtain and save the login interface window handle in the third function parameter; the device pops up a fingerprint verification prompt box according to the saved login interface window handle, prompting the user to enter the fingerprint on the fingerprint key for verification; the device sends the data to be signed to the fingerprint key, such as If the current state of the fingerprint key is that the fingerprint verification has passed, use the parameters of the fifth function to locate the signature private key and signature algorithm, use the signature private key to perform calculations on the data to be signed according to the signature algorithm to generate the credential information required to log in to the operating system, and send it returned to the operating system. The technical scheme of the invention allows the fingerprint Key to be used normally in the Windows system directly, which is convenient for users to use.
Description
技术领域technical field
本发明涉及信息安全领域,尤其涉及一种使用指纹key进行登录的方法及装置。The invention relates to the field of information security, in particular to a method and device for logging in using a fingerprint key.
背景技术Background technique
目前,应用程序调用Window函数使用USB Key时,会弹出PIN码输入框,提示用户输入PIN码进行验证,PIN码验证通过后,应用才能使用USB Key里保存的数据,进行签名、加解密、生成密钥、导入证书等操作。At present, when the application calls the Window function to use the USB Key, a PIN code input box will pop up, prompting the user to enter the PIN code for verification. After the PIN code verification is passed, the application can use the data stored in the USB Key to sign, encrypt and decrypt, and generate Key, import certificate and other operations.
在现有技术中,指纹Key与普通USB Key相比,操作更安全,但是指纹Key不能通过PIN码进行验证使用,只能通过指纹进行验证使用,目前的Window函数不支持指纹验证,导致指纹Key不能使用。因此,如何使Window函数支持使用指纹key,是亟待解决的问题。In the prior art, the fingerprint Key is safer to operate than the ordinary USB Key, but the fingerprint Key cannot be used for verification through the PIN code, but can only be used for verification through the fingerprint. The current Window function does not support fingerprint verification, resulting in fingerprint Key can not be used. Therefore, how to enable the Window function to support the use of the fingerprint key is an urgent problem to be solved.
发明内容Contents of the invention
本发明的目的是为了克服现有技术的不足,提供一种使用指纹key进行登录的方法及装置。The object of the present invention is to provide a method and device for logging in using a fingerprint key in order to overcome the deficiencies of the prior art.
本发明提供了一种使用指纹key进行登录的方法,包括:The invention provides a method for logging in using a fingerprint key, comprising:
当第二函数被调用时,装置获取登录验证方式,并将所述登录验证方式返回给操作系统;When the second function is called, the device acquires a login verification method, and returns the login verification method to the operating system;
当第三函数被调用时,所述装置获取所述第三函数参数中的登录验证方式,并判断所述登录验证方式是否为外部验证方式,是则所述装置获取所述第三函数参数中的登录界面窗口句柄并保存,所述第三函数返回成功信息,否则所述第三函数返回错误信息;When the third function is called, the device obtains the login verification method in the third function parameter, and judges whether the login verification method is an external verification method, and if so, the device obtains the login verification method in the third function parameter. The login interface window handle and save, the third function returns a success message, otherwise the third function returns an error message;
当第四函数被调用时,所述装置根据保存的登录界面窗口句柄弹出指纹验证提示框,提示用户在指纹key上输入指纹进行验证,如验证通过则所述指纹key设置自身当前状态为指纹验证已通过,如验证未通过则所述指纹key设置自身当前状态为指纹验证未通过;When the fourth function is called, the device pops up a fingerprint verification prompt box according to the saved login interface window handle, prompting the user to input the fingerprint on the fingerprint key for verification, and if the verification is passed, the fingerprint key sets its current state as fingerprint verification Passed, if the verification fails, the fingerprint key sets its current state as fingerprint verification failed;
当第五函数被调用时,所述装置将待签名数据发送给所述指纹key,所述指纹key检查自身当前状态是否为指纹验证已通过,是则使用所述第五函数的参数定位签名私钥和签名算法,使用所述签名私钥根据所述签名算法对所述待签名数据进行运算生成登录操作系统所需的凭据信息,所述第五函数将所述凭据信息返回给所述操作系统,否则结束操作。When the fifth function is called, the device sends the data to be signed to the fingerprint key, and the fingerprint key checks whether its current state is that the fingerprint verification has passed, and if so, uses the parameters of the fifth function to locate the signature private key. Key and signature algorithm, using the signature private key to perform operations on the data to be signed according to the signature algorithm to generate credential information required to log in to the operating system, and the fifth function returns the credential information to the operating system , otherwise end the operation.
进一步地,当所述第二函数被调用之前,还包括:Further, before the second function is called, it also includes:
当所述操作系统接收到登录触发信息时,提示用户插入指纹key;如所述操作系统检测到指纹key插入时,获取所述指纹key中的所有用户证书并显示,提示用户选择进行登录所使用的证书,当所述操作系统接收到用户选择的进行登录所使用的证书时调用第一函数;When the operating system receives the login trigger information, it prompts the user to insert the fingerprint key; when the operating system detects that the fingerprint key is inserted, it obtains all user certificates in the fingerprint key and displays them, prompting the user to select the user certificate used for login. When the operating system receives the certificate selected by the user for logging in, the first function is invoked;
当所述第一函数被调用时,所述装置将函数地址列表返回给所述操作系统,所述操作系统分别根据所述函数地址列表中的第二函数地址、第三函数地址、第四函数地址和第五函数地址调用所述第二函数、所述第三函数、所述第四函数和所述第五函数。When the first function is called, the device returns the function address list to the operating system, and the operating system uses the address of the second function, the address of the third function, and the address of the fourth function in the list of function addresses respectively. The address and the fifth function address call the second function, the third function, the fourth function, and the fifth function.
进一步地,所述装置获取登录验证方式具体为:所述装置将所述第二函数参数中的外部PIN码验证方式设置为第一预设值。Further, the acquisition of the login verification method by the device is specifically: the device sets the external PIN code verification method in the second function parameter as a first preset value.
进一步地,当第四函数被调用时,所述装置根据保存的登录界面窗口句柄弹出指纹验证提示框,提示用户在所述指纹key上输入指纹进行验证,如验证通过则所述指纹key设置自身当前状态为指纹验证已通过,如验证未通过则所述指纹key设置自身当前状态为指纹验证未通过,具体包括:Further, when the fourth function is called, the device pops up a fingerprint verification prompt box according to the saved login interface window handle, prompting the user to input the fingerprint on the fingerprint key for verification, and if the verification is passed, the fingerprint key sets itself The current state is that the fingerprint verification has passed. If the verification fails, the fingerprint key sets its current state as the fingerprint verification has not passed, specifically including:
步骤A1:当第四函数被调用时,所述装置判断是否需要生成会话PIN码,是则执行步骤A6,否则执行步骤A2;Step A1: When the fourth function is called, the device judges whether it is necessary to generate a session PIN code, if yes, execute step A6, otherwise execute step A2;
步骤A2:所述装置判断是否需要使用会话PIN码进行登录,是则执行步骤A3,否则所述第四函数返回错误信息;Step A2: The device judges whether a session PIN code needs to be used for login, and if so, execute step A3, otherwise, the fourth function returns an error message;
步骤A3:所述装置判断是否保存有合法的会话PIN码,是则执行步骤A4,否则所述第四函数返回错误信息;Step A3: The device judges whether there is a legal session PIN code, if yes, execute step A4, otherwise the fourth function returns an error message;
步骤A4:所述装置判断所述指纹key是否登录有效,是则执行步骤A5,否则所述第四函数返回错误信息;Step A4: The device judges whether the fingerprint key is valid for login, if so, execute step A5, otherwise the fourth function returns an error message;
步骤A5:所述装置设置指纹key的登录状态为已登录,所述第四函数返回成功信息;Step A5: The device sets the login status of the fingerprint key as logged in, and the fourth function returns success information;
步骤A6:所述装置判断生成PIN码的条件是否合法,是则执行步骤A7,否则所述第四函数返回错误信息;Step A6: The device judges whether the conditions for generating the PIN code are legal, if so, execute step A7, otherwise the fourth function returns an error message;
步骤A7:所述装置判断所述指纹key的登录状态是否为已登录,是则执行步骤A10,否则执行步骤A8;Step A7: The device judges whether the login status of the fingerprint key is logged in, if yes, execute step A10, otherwise execute step A8;
步骤A8:所述装置根据保存的所述登录界面窗口句柄弹出指纹验证提示框,提示用户在所述指纹key上输入指纹进行验证,如所述指纹key对输入的指纹验证通过则所述指纹key设置自身当前状态为指纹验证已通过,给所述装置返回验证成功信息,如所述指纹key对输入的指纹验证未通过则所述指纹key设置自身当前状态为指纹验证未通过,给所述装置返回验证失败信息;Step A8: The device pops up a fingerprint verification prompt box according to the stored login interface window handle, prompting the user to input a fingerprint on the fingerprint key for verification, if the fingerprint key passes the input fingerprint verification, the fingerprint key Set its own current state as the fingerprint verification has passed, return verification success information to the device, if the fingerprint key does not pass the input fingerprint verification, then the fingerprint key sets its own current state as the fingerprint verification failed, and send the device Return verification failure information;
步骤A9:所述装置根据接收到的所述指纹Key返回的信息判断所述指纹key是否验证成功,是则设置指纹key的登录状态为已登录,执行步骤A10,否则所述第四函数返回错误信息;Step A9: The device judges whether the fingerprint key has been verified successfully according to the received information returned by the fingerprint key, if yes, set the login status of the fingerprint key as logged in, and execute step A10, otherwise the fourth function returns an error information;
步骤A10:所述装置生成会话PIN码并保存,且保存登录时间,所述第四函数返回成功信息。Step A10: the device generates and saves the session PIN code, and saves the login time, and the fourth function returns success information.
进一步地,所述步骤A1中的所述装置判断是否需要生成会话PIN码包括:所述装置判断所述第四函数参数中的PIN码标志中的验证标识是否置位,是则需要生成会话PIN码,否则不需要生成会话PIN码。Further, the device in the step A1 judging whether it is necessary to generate a session PIN code includes: the device judges whether the verification flag in the PIN code flag in the fourth function parameter is set, and if so, it needs to generate a session PIN code, otherwise no session PIN code needs to be generated.
进一步地,所述步骤A2包括:所述装置判断所述第四函数参数中的PIN码标志中的登录标识是否置位,是则执行步骤A3,否则所述第四函数返回错误信息。Further, the step A2 includes: the device judges whether the login flag in the PIN code flag in the fourth function parameter is set, if yes, execute step A3, otherwise, the fourth function returns an error message.
进一步地,所述步骤A3包括:所述装置判断所述第四函数的参数中是否有会话PIN码且所述参数中的会话PIN码长度是否等于预设长度,是则执行步骤A4,否则所述第四函数返回错误信息。Further, the step A3 includes: the device judges whether there is a session PIN code in the parameter of the fourth function and whether the length of the session PIN code in the parameter is equal to the preset length, if yes, execute step A4, otherwise, the The fourth function described above returns an error message.
进一步地,所述步骤A4包括:所述装置判断当前时间减去保存的登录时间是否小于预设值,是则执行步骤A5,否则第四函数返回错误信息。Further, the step A4 includes: the device judges whether the current time minus the saved login time is less than a preset value, if yes, execute step A5, otherwise, the fourth function returns an error message.
进一步地,所述步骤A5包括:所述装置将登录标识置位并保存,所述第四函数返回成功信息。Further, the step A5 includes: the device sets and saves the login identifier, and the fourth function returns success information.
进一步地,所述步骤A6包括:所述装置判断所述第四函数的参数中的会话PIN码和会话PIN码长度是否均为空,是则所述第四函数返回错误信息,否则执行步骤A7。Further, the step A6 includes: the device judges whether the session PIN code and the length of the session PIN code in the parameters of the fourth function are both empty, if yes, the fourth function returns an error message, otherwise, execute step A7 .
进一步地,所述步骤A7包括:所述装置判断保存的登录标识是否置位,是则执行步骤A10,否则执行步骤A8。Further, the step A7 includes: the device judges whether the stored login flag is set, if yes, execute step A10, otherwise, execute step A8.
进一步地,所述步骤A8包括:所述装置根据保存的所述登录界面窗口句柄弹出指纹验证提示框,并给所述指纹key发送指纹验证指令,当所述指纹key接收到用户输入的指纹时,判断接收到的指纹是否与内部保存的指纹一致,是则所述指纹key设置自身当前状态为指纹验证已通过,给所述装置返回验证成功信息,否则所述指纹key设置自身当前状态为指纹验证未通过,给所述装置返回验证失败信息。Further, the step A8 includes: the device pops up a fingerprint verification prompt box according to the stored login interface window handle, and sends a fingerprint verification instruction to the fingerprint key, when the fingerprint key receives the fingerprint input by the user , to determine whether the received fingerprint is consistent with the internally stored fingerprint, if so, the fingerprint key sets its current state as fingerprint verification passed, and returns verification success information to the device, otherwise the fingerprint key sets its current state as fingerprint If the verification fails, return verification failure information to the device.
进一步地,所述步骤A9包括:所述装置根据接收到的所述指纹Key返回的信息判断所述指纹key是否验证成功,如接收到的信息为验证成功信息则所述指纹key验证成功,将所述登录标识置位,执行步骤A10,如接收到的信息为验证失败信息则所述第四函数返回错误信息。Further, the step A9 includes: the device judges whether the verification of the fingerprint key is successful according to the received information returned by the fingerprint key, if the received information is verification success information, the verification of the fingerprint key is successful, and the The login flag is set, and step A10 is executed, and if the received information is verification failure information, the fourth function returns error information.
进一步地,所述步骤A10包括:所述装置根据所述第四函数参数中的函数指针获取生成函数,通过所述生成函数生成对应的会话PIN码,保存所述会话PIN码和登录时间,所述第四函数返回成功信息。Further, the step A10 includes: the device acquires a generating function according to the function pointer in the fourth function parameter, generates a corresponding session PIN code through the generating function, and saves the session PIN code and login time, so The fourth function described above returns success information.
进一步地,所述指纹key使用所述第五函数的参数定位签名私钥和签名算法包括:所述指纹key分别根据所述第五函数的参数中的容器索引和签名算法标识获取对应容器中的签名私钥和签名算法。Further, the fingerprint key using the parameters of the fifth function to locate the signature private key and the signature algorithm includes: the fingerprint key obtains the corresponding container index and signature algorithm identifier in the parameters of the fifth function respectively. Signature private key and signature algorithm.
进一步地,所述方法还包括:当所述操作系统接收到所述凭据信息后,使用用户选择的证书对所述凭据信息进行验证,如验证成功则允许登录,如验证失败则拒绝登录。Further, the method further includes: after the operating system receives the credential information, verifying the credential information with the certificate selected by the user, allowing login if the verification is successful, and rejecting the login if the verification fails.
进一步地,所述使用用户选择的证书对所述凭据信息进行验证包括:所述操作系统使用所述用户选择的证书中的签名公钥对所述凭据信息进行解密,对所述待签名数据进行哈希计算,判断哈希计算结果和解密结果是否一致,是则验证成功,否则验证失败。Further, the verifying the credential information by using the certificate selected by the user includes: the operating system decrypts the credential information by using the signature public key in the certificate selected by the user, and performs Hash calculation, judging whether the hash calculation result is consistent with the decryption result, if yes, the verification succeeds, otherwise the verification fails.
本发明又提供了一种使用指纹key进行登录的装置,包括第二操作模块、第三操作模块、第四操作模块和第五操作模块;The present invention further provides a device for logging in using a fingerprint key, including a second operation module, a third operation module, a fourth operation module and a fifth operation module;
所述第二操作模块,用于获取登录验证方式,并将所述登录验证方式返回给操作系统;The second operation module is configured to acquire a login verification method, and return the login verification method to the operating system;
所述第三操作模块,用于获取所述第三函数参数中的登录验证方式,并判断所述登录验证方式是否为外部验证方式,是则获取所述第三函数参数中的登录界面窗口句柄并保存,返回成功信息,否则返回错误信息;The third operation module is used to obtain the login verification method in the third function parameter, and judge whether the login verification method is an external verification method, and if so, obtain the login interface window handle in the third function parameter And save, return a success message, otherwise return an error message;
所述第四操作模块,用于根据所述第三操作模块保存的登录界面窗口句柄弹出指纹验证提示框,提示用户在指纹key上输入指纹进行验证,如所述指纹key对输入的指纹验证通过则所述指纹key设置自身当前状态为指纹验证已通过,如所述指纹key对输入的指纹验证未通过则所述指纹key设置自身当前状态为指纹验证未通过;The fourth operation module is used to pop up a fingerprint verification prompt box according to the login interface window handle saved by the third operation module, prompting the user to input the fingerprint on the fingerprint key for verification, such as the fingerprint key passing the input fingerprint verification Then described fingerprint key setting self current state is that fingerprint verification has passed, as described fingerprint key to the fingerprint verification of input not passing through then described fingerprint key setting self current state is that fingerprint verification has not passed;
所述第五操作模块,用于将待签名数据发送给所述指纹key,所述指纹key检查自身当前状态是否为指纹验证已通过,是则指纹key使用所述第五函数的参数定位签名私钥和签名算法,使用所述签名私钥根据所述签名算法对所述待签名数据进行运算生成登录操作系统所需的凭据信息,所述第五操作模块还用于将所述凭据信息返回给所述操作系统,否则结束操作。The fifth operation module is used to send the data to be signed to the fingerprint key, and the fingerprint key checks whether its current state is that the fingerprint verification has passed, and if so, the fingerprint key uses the parameters of the fifth function to locate the signature private key. Key and signature algorithm, using the signature private key to perform operations on the data to be signed according to the signature algorithm to generate credential information required for logging into the operating system, and the fifth operation module is also used to return the credential information to the operating system, otherwise end the operation.
进一步地,所述装置还包括第一操作模块;Further, the device also includes a first operating module;
当所述操作系统接收到登录触发信息时,提示用户插入指纹key;如所述操作系统检测到指纹key插入时,获取所述指纹key中的所有用户证书并显示,提示用户选择进行登录所使用的证书,当所述操作系统接收到用户选择的进行登录所使用的证书时触发所述第一操作模块;When the operating system receives the login trigger information, it prompts the user to insert the fingerprint key; when the operating system detects that the fingerprint key is inserted, it obtains all user certificates in the fingerprint key and displays them, prompting the user to select the user certificate used for login. certificate, triggering the first operation module when the operating system receives the certificate selected by the user for logging in;
所述第一操作模块用于将函数地址列表返回给所述操作系统,所述操作系统分别根据所述函数地址列表中的第二函数地址、第三函数地址、第四函数地址和第五函数地址调用所述第二函数、所述第三函数、所述第四函数和所述第五函数。The first operation module is used to return the function address list to the operating system, and the operating system uses the second function address, the third function address, the fourth function address and the fifth function address in the function address list respectively. The address calls the second function, the third function, the fourth function, and the fifth function.
进一步地,所述第二操作模块具体用于将所述第二函数参数中的外部PIN码验证方式设置为第一预设值,并将第一预设值的外部PIN码验证方式返回给所述操作系统。Further, the second operation module is specifically configured to set the external PIN code verification method in the second function parameter as a first preset value, and return the external PIN code verification method of the first preset value to the operating system described above.
进一步地,所述第四操作模块包括:Further, the fourth operation module includes:
第一判断单元,用于当所述第四函数被调用时,判断是否需要生成会话PIN码;A first judging unit, configured to judge whether a session PIN code needs to be generated when the fourth function is called;
第二判断单元,用于当所述第一判断单元判断为否时,判断是否需要使用会话PIN码进行登录,当判断为否时返回错误信息;The second judging unit is used to judge whether the session PIN code needs to be used to log in when the first judging unit judges no, and returns an error message when judging no;
第三判断单元,用于当所述第二判断单元判断为是时,判断是否保存有合法的会话PIN码,当判断为否时返回错误信息;The third judging unit is used to judge whether a legal session PIN code is saved when the second judging unit judges yes, and returns an error message when judging no;
第四判断单元,用于当所述第三判断单元判断为是时,判断所述指纹key是否登录有效,当判断为否时返回错误信息;The fourth judging unit is used to judge whether the fingerprint key is valid for logging in when the third judging unit judges yes, and returns an error message when judging no;
第一设置单元,用于当所述第四判断单元判断为是时,设置指纹key的登录状态为已登录,返回成功信息;The first setting unit is used to set the login status of the fingerprint key as logged in when the fourth judging unit judges as yes, and return success information;
第五判断单元,用于当所述第一判断单元判断为是时,判断生成PIN码的条件是否合法,当判断为否时返回错误信息;The fifth judging unit is used to judge whether the condition for generating the PIN code is legal when the first judging unit judges yes, and returns an error message when judging no;
第六判断单元,用于当所述第五判断单元判断为是时,判断所述指纹key的登录状态是否为已登录;The sixth judging unit is used to judge whether the login status of the fingerprint key is logged in when the fifth judging unit judges yes;
弹出提示单元,用于当所述第六判断单元判断为否时,根据所述第三操作模块保存的所述登录界面窗口句柄弹出指纹验证提示框,提示用户在所述指纹key上输入指纹进行验证;如所述指纹key对输入的指纹验证通过则所述指纹key设置自身当前状态为指纹验证已通过,给所述装置返回验证成功信息,如所述指纹key对输入的指纹验证未通过则所述指纹key设置自身当前状态为指纹验证未通过,给所述装置返回验证失败信息;A pop-up prompt unit, configured to pop up a fingerprint verification prompt box according to the login interface window handle saved by the third operation module when the sixth judging unit judges as no, prompting the user to input the fingerprint on the fingerprint key for verification. Verification; if the fingerprint key to the input fingerprint verification is passed, then the fingerprint key sets its current state as the fingerprint verification has passed, and returns verification success information to the device, if the fingerprint key to the input fingerprint verification does not pass, then The current state of the fingerprint key setting itself is that the fingerprint verification has not passed, and the verification failure information is returned to the device;
接收单元,用于接收所述指纹key返回的验证成功信息或验证失败信息;A receiving unit, configured to receive verification success information or verification failure information returned by the fingerprint key;
第七判断单元,用于根据所述接收单元接收到的所述指纹key返回的信息判断所述指纹key是否验证成功,是则设置指纹key的登录状态为已登录,否则返回错误信息;The seventh judging unit is used to judge whether the fingerprint key is successfully verified according to the information returned by the fingerprint key received by the receiving unit, if yes, set the login status of the fingerprint key as logged in, otherwise return an error message;
生成保存单元,用于当第六判断单元和/或所述第七单元判断为是时生成会话PIN码并保存,且保存登录时间,返回成功信息。A saving unit is generated, configured to generate and save the session PIN code when the sixth judging unit and/or the seventh unit judges yes, save the login time, and return success information.
进一步地,所述第一判断单元具体用于判断所述第四函数参数中的PIN码标志中的验证标识是否置位,是则需要生成会话PIN码,否则不需要生成会话PIN码。Further, the first judging unit is specifically configured to judge whether the verification flag in the PIN code flag in the fourth function parameter is set, if yes, a session PIN code needs to be generated, otherwise, a session PIN code does not need to be generated.
进一步地,所述第二判断单元具体用于判断所述第四函数参数中的PIN码标志中的登录标识是否置位,当判断为否时返回错误信息。Further, the second judging unit is specifically configured to judge whether the login flag in the PIN code flag in the fourth function parameter is set, and return an error message if the judging is no.
进一步地,所述第三判断单元具体用于判断所述第四函数的参数中是否有会话PIN码且所述参数中的会话PIN码长度是否等于预设长度,当判断为否时返回错误信息。Further, the third judging unit is specifically used to judge whether there is a session PIN code in the parameter of the fourth function and whether the length of the session PIN code in the parameter is equal to a preset length, and returns an error message when the judgment is no .
进一步地,所述第四判断单元具体用于判断当前时间减去保存的登录时间是否小于预设值,当判断为否时返回错误信息。Further, the fourth judging unit is specifically configured to judge whether the current time minus the saved login time is less than a preset value, and return an error message if the judgment is no.
进一步地,所述第一设置单元具体用于将登录标识置位并保存,返回成功信息。Further, the first setting unit is specifically configured to set and save the login identifier, and return success information.
进一步地,所述第五判断单元具体用于判断所述第四函数的参数中的会话PIN码和会话PIN码长度是否均为空,是则返回错误信息。Further, the fifth judging unit is specifically configured to judge whether the session PIN code and the length of the session PIN code in the parameters of the fourth function are empty, and return an error message if yes.
进一步地,所述第六判断单元具体用于判断保存的登录标识是否置位,是则指纹key处于已登录状态,否则指纹key处于未登录状态。Further, the sixth judging unit is specifically used to judge whether the saved login flag is set, if yes, the fingerprint key is in the logged-in state, otherwise, the fingerprint key is in the unlogged state.
进一步地,所述弹出提示单元具体用于根据保存的登录界面窗口句柄弹出指纹验证提示框,并给所述指纹key发送指纹验证指令,当所述指纹key接收到用户输入的指纹时,判断接收到的指纹是否与内部保存的指纹一致,是则所述指纹key设置自身当前状态为指纹验证已通过,给所述装置返回验证成功信息,否则所述指纹key设置自身当前状态为指纹验证未通过,给所述装置返回验证失败信息。Further, the pop-up prompt unit is specifically used to pop up a fingerprint verification prompt box according to the saved login interface window handle, and send a fingerprint verification instruction to the fingerprint key, and when the fingerprint key receives the fingerprint input by the user, judge whether to receive Whether the received fingerprint is consistent with the internally stored fingerprint, if so, the fingerprint key sets its current state as fingerprint verification passed, and returns verification success information to the device, otherwise the fingerprint key sets its current state as fingerprint verification failed , returning verification failure information to the device.
进一步地,所述第七判断单元具体用于根据所述接收单元接收到的所述指纹key返回的信息判断所述指纹key是否验证成功,如接收到的信息为所述验证成功信息则将所登录标识置位,如接收到的信息为所述验证失败信息则返回错误信息。Further, the seventh judging unit is specifically configured to judge whether the fingerprint key is verified successfully according to the information returned by the fingerprint key received by the receiving unit, and if the received information is the verification success information, then the The login flag is set, and if the received information is the verification failure information, an error message is returned.
进一步地,所述生成保存单元具体用于根据所述第四函数的参数中的函数指针获取生成函数,通过所述生成函数生成对应的会话PIN码,保存所述会话PIN码和登录时间,返回成功信息。Further, the generation and storage unit is specifically configured to obtain a generation function according to the function pointer in the parameter of the fourth function, generate a corresponding session PIN code through the generation function, save the session PIN code and login time, and return success message.
本发明与现有技术相比,具有以下优点:Compared with the prior art, the present invention has the following advantages:
本发明提供的技术方案在Window函数中通过使用外部验证密码方式,用指纹验证代替PIN验证,只需要修改厂商的Windows函数来弹出指纹提示框而不弹出PIN码框,让指纹Key直接在Windows系统中能正常使用,方便用户使用。The technical scheme provided by the present invention uses the external verification password mode in the Window function, replaces the PIN verification with fingerprint verification, only needs to modify the Windows function of the manufacturer to pop up the fingerprint prompt box instead of popping up the PIN code box, so that the fingerprint key can be directly displayed on the Windows system. It can be used normally and is convenient for users to use.
附图说明Description of drawings
图1为本发明实施例二提供的一种使用指纹key进行登录的方法流程图;FIG. 1 is a flow chart of a method for logging in using a fingerprint key provided in Embodiment 2 of the present invention;
图2为本发明实施例二中的步骤107的具体实现过程流程图;FIG. 2 is a flowchart of a specific implementation process of step 107 in Embodiment 2 of the present invention;
图3为本发明实施例三提供的一种使用指纹key进行登录的装置的模块组成框图。FIG. 3 is a block diagram of modules of a device for logging in using a fingerprint key provided by Embodiment 3 of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts belong to the protection scope of the present invention.
实施例一Embodiment one
本发明实施例一提供一种使用指纹key进行登录的方法,包括:Embodiment 1 of the present invention provides a method for logging in using a fingerprint key, including:
当第二函数被调用时,装置获取登录验证方式,并将登录验证方式返回给操作系统;When the second function is called, the device obtains the login verification method, and returns the login verification method to the operating system;
具体的,在本实施例中,当第二函数被操作系统调用时还包括:操作系统通过第二函数的返回值判断获取登录验证方式是否成功,如第二函数返回登录验证方式则获取登录验证方式成功,否则获取登录验证方式失败。Specifically, in this embodiment, when the second function is called by the operating system, it also includes: the operating system judges whether the acquisition of the login verification method is successful through the return value of the second function, and if the second function returns the login verification method, then the login verification method is obtained. The method is successful, otherwise, the login verification method fails to be obtained.
在本实施例中,装置获取登录验证方式具体为:装置将第二函数参数中的外部PIN码验证方式设置为第一预设值;优选的,装置将第二函数参数中的第三数据结构中的外部PIN码验证方式设置为第一预设值。In this embodiment, the device obtains the login verification method specifically as follows: the device sets the external PIN code verification method in the second function parameter as the first preset value; preferably, the device sets the third data structure in the second function parameter The external PIN code verification method in is set to the first preset value.
当第三函数被调用时,装置获取第三函数参数中的登录验证方式,并判断登录验证方式是否为外部验证方式,是则装置获取第三函数参数中的登录界面窗口句柄并保存,第三函数返回成功信息,否则第三函数返回错误信息;When the third function is called, the device obtains the login verification method in the third function parameter, and judges whether the login verification method is an external verification method, if yes, the device obtains the login interface window handle in the third function parameter and saves it, and the third The function returns a success message, otherwise the third function returns an error message;
优选的,本实施例中装置将获取的登录界面窗口句柄保存到第二数据结构中;Preferably, the device in this embodiment saves the acquired login interface window handle in the second data structure;
具体的,在本实施例中,当第三函数被操作系统调用时还包括:操作系统通过第三函数的返回值判断登录界面窗口句柄是否保存成功,如第三函数返回成功信息则登录界面窗口句柄保存成功,否则登录界面窗口句柄保存失败。Specifically, in this embodiment, when the third function is called by the operating system, it also includes: the operating system judges whether the login interface window handle is saved successfully through the return value of the third function, and if the third function returns success information, the login interface window The handle is saved successfully, otherwise the window handle of the login interface fails to be saved.
当第四函数被调用时,装置根据保存的登录界面窗口句柄弹出指纹验证提示框,提示用户在指纹key上输入指纹进行验证,如验证通过则指纹key设置自身当前状态为指纹验证已通过,如验证未通过则指纹key设置自身当前状态为指纹验证未通过。When the fourth function is called, the device pops up a fingerprint verification prompt box according to the saved login interface window handle, prompting the user to enter the fingerprint on the fingerprint key for verification. If the verification is passed, the fingerprint key sets its current state as the fingerprint verification has passed, such as If the verification fails, the fingerprint key sets its current status as fingerprint verification failed.
在本实施例中,当第四函数被调用时,装置执行的步骤具体包括:In this embodiment, when the fourth function is called, the steps performed by the device specifically include:
步骤A1:当第四函数被调用时,装置判断是否需要生成会话PIN码,是则执行步骤A6,否则执行步骤A2;Step A1: When the fourth function is called, the device judges whether it is necessary to generate a session PIN code, if yes, execute step A6, otherwise execute step A2;
具体的,在本实施例中,步骤A1包括:装置判断第四函数参数中的PIN码标志中的验证标识是否置位,是则需要生成会话PIN码,否则不需要生成会话PIN码。Specifically, in this embodiment, step A1 includes: the device judges whether the verification flag in the PIN code flag in the fourth function parameter is set, if yes, it needs to generate a session PIN code, otherwise, it does not need to generate a session PIN code.
步骤A2:装置判断是否需要使用会话PIN码进行登录,是则执行步骤A3,否则第四函数返回错误信息;Step A2: The device judges whether the session PIN code needs to be used for login, if yes, execute step A3, otherwise the fourth function returns an error message;
具体的,在本实施例中,步骤A2包括:装置判断第四函数参数中的PIN码标志中的登录标识是否置位,是则需要使用会话PIN码进行登录,否则不需要使用会话PIN码进行登录。Specifically, in this embodiment, step A2 includes: the device judges whether the login flag in the PIN code flag in the fourth function parameter is set, if yes, it needs to use the session PIN code to log in, otherwise it does not need to use the session PIN code to log in; Log in.
步骤A3:装置判断是否保存有合法的会话PIN码,是则执行步骤A4,否则第四函数返回错误信息;Step A3: The device judges whether there is a legal session PIN code, if yes, execute step A4, otherwise the fourth function returns an error message;
具体的,在本实施例中,步骤A3包括:装置判断第四函数的参数中是否有会话PIN码且参数中的会话PIN码长度是否等于预设长度,是则执行步骤A4,否则第四函数返回错误信息。Specifically, in this embodiment, step A3 includes: the device judges whether there is a session PIN code in the parameter of the fourth function and whether the length of the session PIN code in the parameter is equal to the preset length, if yes, execute step A4, otherwise the fourth function Return an error message.
步骤A4:装置判断指纹key是否登录有效,是则执行步骤A5,否则第四函数返回错误信息;Step A4: The device judges whether the fingerprint key is valid for login, if yes, execute step A5, otherwise the fourth function returns an error message;
具体的,在本实施例中,步骤A4包括:装置判断当前时间减去保存的登录时间是否小于预设值,是则执行步骤A5,否则第四函数返回错误信息。Specifically, in this embodiment, step A4 includes: the device judges whether the current time minus the stored login time is less than a preset value, and if yes, execute step A5; otherwise, the fourth function returns an error message.
步骤A5:装置设置指纹key的登录状态为已登录,第四函数返回成功信息;Step A5: The device sets the login status of the fingerprint key as logged in, and the fourth function returns success information;
具体的,在本实施例中,步骤A5包括:装置将登录标识置位并保存,第四函数返回成功信息。Specifically, in this embodiment, step A5 includes: the device sets and saves the login identifier, and the fourth function returns success information.
步骤A6:装置判断生成PIN码的条件是否合法,是则执行步骤A7,否则第四函数返回错误信息;Step A6: The device judges whether the conditions for generating the PIN code are legal, if so, execute step A7, otherwise the fourth function returns an error message;
具体的,在本实施例中,步骤A6包括:装置判断第四函数的参数中的会话PIN码和会话PIN码长度是否均为空,是则不合法,否则合法。Specifically, in this embodiment, step A6 includes: the device judges whether the session PIN code and the length of the session PIN code in the parameters of the fourth function are empty, if yes, it is invalid, otherwise, it is legal.
步骤A7:装置判断指纹key的登录状态是否为已登录,是则执行步骤A10,否则执行步骤A8;Step A7: The device judges whether the login status of the fingerprint key is logged in, if yes, execute step A10, otherwise execute step A8;
具体的,在本实施例中,步骤A7包括:装置判断保存的登录标识是否置位,是则指纹key处于已登录状态,否则指纹key处于未登录状态。优选的,登录标识保存在第二数据结构中;Specifically, in this embodiment, step A7 includes: the device judges whether the saved login flag is set, if yes, the fingerprint key is in the logged-in state, otherwise, the fingerprint key is in the unregistered state. Preferably, the login identifier is stored in the second data structure;
步骤A8:装置根据保存的登录界面窗口句柄弹出指纹验证提示框,提示用户在指纹key上输入指纹进行验证,如指纹key对输入的指纹验证通过则指纹key设置自身当前状态为指纹验证已通过,给装置返回验证成功信息,如指纹key对输入的指纹验证未通过则指纹key设置自身当前状态为指纹验证未通过,给装置返回验证失败信息;Step A8: The device pops up a fingerprint verification prompt box according to the saved login interface window handle, prompting the user to input the fingerprint on the fingerprint key for verification. If the fingerprint key passes the input fingerprint verification, the fingerprint key sets its current status as fingerprint verification passed. Return verification success information to the device. If the fingerprint key fails to pass the input fingerprint verification, the fingerprint key sets its current state as fingerprint verification failure, and returns verification failure information to the device;
具体的,在本实施例中,步骤A8包括:装置根据保存的登录界面窗口句柄弹出指纹验证提示框,并给指纹key发送指纹验证指令,当指纹key接收到用户输入的指纹时,判断接收到的指纹是否与内部保存的指纹一致,是则指纹key设置自身当前状态为指纹验证已通过,给装置返回验证成功信息,否则指纹key设置自身当前状态为指纹验证未通过,给装置返回验证失败信息;Specifically, in this embodiment, step A8 includes: the device pops up a fingerprint verification prompt box according to the saved login interface window handle, and sends a fingerprint verification instruction to the fingerprint key, and when the fingerprint key receives the fingerprint input by the user, it judges that the If the fingerprint is consistent with the internally stored fingerprint, then the fingerprint key sets its current status as fingerprint verification passed, and returns a verification success message to the device; otherwise, the fingerprint key sets its current status as fingerprint verification failed, and returns a verification failure message to the device ;
步骤A9:装置根据接收到的指纹Key返回的信息判断指纹key是否验证成功,是则设置指纹key的登录状态为已登录,执行步骤A10,否则第四函数返回错误信息;Step A9: The device judges whether the verification of the fingerprint key is successful according to the information returned by the received fingerprint Key, and if so, sets the login status of the fingerprint key as logged in, and executes step A10, otherwise the fourth function returns an error message;
具体的,在本实施例中,步骤A9包括:装置根据接收到的指纹Key返回的信息判断指纹key是否验证成功,如接收到的信息为验证成功信息则指纹key验证成功,将登录标识置位,执行步骤A10,如接收到的信息为验证失败信息则第四函数返回错误信息。Specifically, in this embodiment, step A9 includes: the device judges whether the verification of the fingerprint key is successful according to the information returned by the received fingerprint Key, if the received information is verification success information, the verification of the fingerprint key is successful, and the login flag is set , execute step A10, and if the received information is verification failure information, the fourth function returns an error message.
步骤A10:装置生成会话PIN码并保存,且保存登录时间,第四函数返回成功信息;Step A10: The device generates and saves the session PIN code, and saves the login time, and the fourth function returns success information;
具体的,在本实施例中,步骤A10包括:装置根据第四函数参数中的函数指针获取生成函数,通过生成函数生成对应的会话PIN码,保存会话PIN码和登录时间,第四函数返回成功信息。优选的,装置根据第四函数参数中的第一数据结构中的函数指针获取生成函数;Specifically, in this embodiment, step A10 includes: the device obtains the generation function according to the function pointer in the fourth function parameter, generates the corresponding session PIN code through the generation function, saves the session PIN code and login time, and the fourth function returns success information. Preferably, the device acquires the generation function according to the function pointer in the first data structure in the fourth function parameter;
在本实施例中,当第四函数被操作系统调用时还包括:操作系统通过第四函数的返回值判断指纹key是否验证成功,如第四函数返回成功信息则指纹key验证成功,否则指纹key验证失败。In this embodiment, when the fourth function is called by the operating system, it also includes: the operating system judges whether the fingerprint key verification is successful through the return value of the fourth function. If the fourth function returns success information, the fingerprint key verification is successful, otherwise the fingerprint key verification is successful. verification failed.
当第五函数被调用时,装置将待签名数据发送给指纹key,指纹key检查自身当前状态是否为指纹验证已通过,是则使用第五函数的参数定位签名私钥和签名算法,使用签名私钥根据签名算法对待签名数据进行运算生成登录操作系统所需的凭据信息并将其返回给操作系统,否则结束操作;When the fifth function is called, the device sends the data to be signed to the fingerprint key. The fingerprint key checks whether its current status is that the fingerprint verification has passed. If so, use the parameters of the fifth function to locate the signature private key and signature algorithm. The key performs operations on the data to be signed according to the signature algorithm to generate the credential information required to log in to the operating system and returns it to the operating system, otherwise the operation ends;
其中,指纹key使用第五函数的参数定位签名私钥和签名算法包括:指纹key分别根据第五函数的参数中的容器索引和签名算法标识获取对应容器中的签名私钥和签名算法;Wherein, the fingerprint key uses the parameters of the fifth function to locate the signature private key and the signature algorithm, including: the fingerprint key obtains the signature private key and the signature algorithm in the corresponding container according to the container index and the signature algorithm identifier in the parameters of the fifth function;
具体的,在本实施例中,当第五函数被操作系统调用时还包括:操作系统通过第五函数的返回值判断计算签名是否成功,如第五函数返回凭据信息则计算签名成功,否则计算签名失败;当操作系统接收到凭据信息后,使用用户选择的证书对凭据信息进行验证,如验证成功则允许登录,如验证失败则拒绝登录。具体的,使用用户选择的证书对签名结果进行验证包括:操作系统使用用户选择的证书中的签名公钥对签名结果进行解密,对待签名数据进行哈希计算,判断哈希计算结果和解密结果是否一致,是则验证成功,否则验证失败。Specifically, in this embodiment, when the fifth function is called by the operating system, it also includes: the operating system judges whether the signature calculation is successful through the return value of the fifth function. If the fifth function returns credential information, the signature calculation is successful; otherwise, the calculation The signature fails; when the operating system receives the credential information, it uses the certificate selected by the user to verify the credential information. If the verification is successful, the login is allowed, and if the verification fails, the login is refused. Specifically, using the certificate selected by the user to verify the signature result includes: the operating system uses the signature public key in the certificate selected by the user to decrypt the signature result, performs hash calculation on the data to be signed, and determines whether the hash calculation result and the decrypted result are If they are consistent, the verification is successful, otherwise the verification fails.
在本实施例中,当第二函数被调用之前,还包括:In this embodiment, before the second function is called, it also includes:
当操作系统接收到登录触发信息时,提示用户插入指纹key;如操作系统检测到指纹key插入时,获取指纹key中的所有用户证书并显示,提示用户选择进行登录所使用的证书,当操作系统接收到用户选择的进行登录所使用的证书时调用第一函数;When the operating system receives the login trigger information, it prompts the user to insert the fingerprint key; if the operating system detects that the fingerprint key is inserted, it obtains all user certificates in the fingerprint key and displays them, prompting the user to select the certificate used for login. When the operating system The first function is called when the certificate used for login selected by the user is received;
当第一函数被调用时,装置将函数地址列表返回给操作系统,操作系统分别根据函数地址列表中的第二函数地址、第三函数地址、第四函数地址和第五函数地址调用第二函数、第三函数、第四函数和第五函数;具体地,装置将函数地址列表返回给操作系统具体为:装置初始化第一数据结构,获取第二函数指针、第三函数指针、第四函数指针、第五函数指针,创建第二数据结构并将其保存到第一数据结构中;When the first function is called, the device returns the function address list to the operating system, and the operating system calls the second function according to the second function address, the third function address, the fourth function address and the fifth function address in the function address list respectively , the third function, the fourth function, and the fifth function; specifically, the device returns the function address list to the operating system as follows: the device initializes the first data structure, obtains the second function pointer, the third function pointer, and the fourth function pointer , the fifth function pointer, creating a second data structure and storing it in the first data structure;
具体的,在本实施例中,当第一函数被操作系统调用时还包括:操作系统通过第一函数的返回值判断初始化是否成功,如第一函数返回函数地址列表则初始化成功,否则初始化失败。Specifically, in this embodiment, when the first function is called by the operating system, it also includes: the operating system judges whether the initialization is successful through the return value of the first function. If the first function returns a function address list, the initialization is successful; otherwise, the initialization fails. .
实施例二Embodiment two
本发明实施例二提供一种使用指纹key进行登录的方法,如图1所示,包括:Embodiment 2 of the present invention provides a method for logging in using a fingerprint key, as shown in FIG. 1 , including:
当操作系统接收到登录触发信息时,提示用户插入指纹key;如检测到指纹key插入时,获取指纹key中的所有用户证书并显示,提示用户选择进行登录所使用的证书;当操作系统接收到用户选择的进行登录所使用的证书时调用第一函数;When the operating system receives the login trigger information, it prompts the user to insert the fingerprint key; if it detects that the fingerprint key is inserted, it obtains all user certificates in the fingerprint key and displays them, prompting the user to select the certificate used for login; when the operating system receives The first function is called when the user selects the certificate used for login;
步骤101:当第一函数被调用时,装置将函数地址列表返回给所述操作系统;Step 101: when the first function is called, the device returns the function address list to the operating system;
具体的,在本实施例中,第一函数为CardAcquireContext,其中,传入的参数包括:第一数据结构;装置将函数地址列表返回给所述操作系统包括:初始化第一数据结构,获取第二函数地址、第三函数地址、第四函数地址、第五函数地址,创建自定义的第二数据结构并将其保存到第一数据结构中;操作系统会根据第二函数地址、第三函数地址、第四函数地址、第五函数地址调用对应的函数;优选的,第二函数地址、第三函数地址、第四函数地址、第五函数地址为第二函数指针、第三函数指针、第四函数指针、第五函数指针;Specifically, in this embodiment, the first function is CardAcquireContext, wherein the parameters passed in include: the first data structure; the device returning the function address list to the operating system includes: initializing the first data structure, obtaining the second Function address, third function address, fourth function address, fifth function address, create a custom second data structure and save it in the first data structure; the operating system will use the second function address, third function address , the fourth function address, and the fifth function address call the corresponding function; preferably, the second function address, the third function address, the fourth function address, and the fifth function address are the second function pointer, the third function pointer, the fourth function pointer, fifth function pointer;
步骤102:操作系统通过第一函数的返回值判断初始化是否成功,是则操作系统根据第二函数指针调用对应的第二函数,执行步骤103,否则结束;Step 102: the operating system judges whether the initialization is successful through the return value of the first function, if yes, the operating system calls the corresponding second function according to the second function pointer, and executes step 103, otherwise ends;
在本实施例中,步骤102具体为:操作系统判断第一函数的返回值,如为函数地址列表则初始化成功,否则初始化失败;In this embodiment, step 102 is specifically: the operating system judges the return value of the first function, if it is a function address list, the initialization is successful; otherwise, the initialization fails;
步骤103:当第二函数被调用时,装置获取登录验证方式,并将其返回给操作系统;Step 103: When the second function is called, the device obtains the login verification method and returns it to the operating system;
具体的,在本实施例中,第二函数为CardGetProperty,传入的参数包括第三数据结构,装置获取登录验证方式具体为:将第三数据结构中的外部PIN码验证方式设置为第一预设值,表示登录验证方式为指纹验证;Specifically, in this embodiment, the second function is CardGetProperty, the incoming parameters include the third data structure, and the device obtains the login verification method specifically as follows: setting the external PIN code verification method in the third data structure to the first predetermined Set the value to indicate that the login verification method is fingerprint verification;
步骤104:操作系统通过第二函数的返回值判断获取登录验证方式是否成功,是则操作系统根据第三函数指针调用对应的第三函数,执行步骤105,否则结束;Step 104: the operating system judges whether the acquisition of the login verification method is successful through the return value of the second function, if yes, the operating system calls the corresponding third function according to the third function pointer, and executes step 105, otherwise ends;
在本实施例中,步骤104具体为:操作系统判断第二函数的返回值,如为登录验证方式则获取登录验证方式成功,执行步骤105;否则获取登录验证方式失败,结束;In this embodiment, step 104 is specifically: the operating system judges the return value of the second function, if it is a login verification method, the login verification method is obtained successfully, and step 105 is performed; otherwise, the login verification method fails to be obtained, and ends;
步骤105:当第三函数被调用时,装置获取第三函数参数中的登录验证方式,判断登录验证方式是否为外部验证方式,是则获取第三函数参数中的登录界面窗口句柄,并将登录界面窗口句柄保存到第二数据结构中,第三函数返回成功信息;否则第三函数返回错误信息;Step 105: When the third function is called, the device obtains the login verification method in the third function parameter, judges whether the login verification method is an external verification method, and if so, obtains the login interface window handle in the third function parameter, and logs in The interface window handle is stored in the second data structure, and the third function returns a success message; otherwise, the third function returns an error message;
具体的,在本实施例中,第三函数为CardSetProperty,传入的参数为第一数据结构和登录界面窗口句柄,将登录界面窗口句柄保存到第二数据结构中具体为:装置将登录界面窗口句柄保存到第一数据结构中的第二数据结构中;Specifically, in this embodiment, the third function is CardSetProperty, and the parameters passed in are the first data structure and the handle of the login interface window, and saving the handle of the login interface window into the second data structure is specifically: the device saves the handle of the login interface window saving the handle to the second data structure in the first data structure;
步骤106:操作系统通过第三函数的返回值判断登录界面窗口句柄是否保存成功,是则操作系统根据第四函数指针调用对应的第四函数,执行步骤107,否则结束;Step 106: the operating system judges whether the login interface window handle is saved successfully by the return value of the third function, if yes, the operating system calls the corresponding fourth function according to the fourth function pointer, and executes step 107, otherwise ends;
在本实施例中,步骤106具体为:操作系统判断第三函数的返回值,如为成功信息则登录界面窗口句柄保存成功,执行步骤107;如为失败信息则登录界面窗口句柄保存失败,结束;In the present embodiment, step 106 is specifically: the operating system judges the return value of the third function, if it is a success message, then the login interface window handle is saved successfully, and step 107 is performed; if it is a failure message, then the login interface window handle fails to be saved, and ends ;
步骤107:当第四函数被调用时,装置根据第二数据结构中的登录界面窗口句柄弹出指纹验证提示框,提示用户在指纹key上输入指纹进行验证,如指纹key对输入的指纹验证成功则第四函数返回成功信息,执行步骤108,如指纹key对输入的指纹验证失败则第四函数返回错误信息;Step 107: When the fourth function is called, the device pops up a fingerprint verification prompt box according to the login interface window handle in the second data structure, prompting the user to input the fingerprint on the fingerprint key for verification, if the fingerprint key verifies the input fingerprint successfully, then The fourth function returns success information, and executes step 108, if the fingerprint key fails to verify the input fingerprint, then the fourth function returns an error message;
具体的,在本实施例中,第四函数为CardAuthenticateEx,传入的参数包括:第一数据结构、PIN码标志、会话密码、会话密码长度,步骤107的具体实现过程如图2所示,包括:Specifically, in the present embodiment, the fourth function is CardAuthenticateEx, and the incoming parameters include: the first data structure, the PIN code sign, the session password, and the length of the session password. The specific implementation process of step 107 is shown in Figure 2, including :
步骤A1:当第四函数被调用时,装置根据PIN码标志判断是否需要生成会话PIN码,是则执行步骤A6,否则执行步骤A2;Step A1: When the fourth function is called, the device judges whether a session PIN code needs to be generated according to the PIN code flag, if yes, execute step A6, otherwise execute step A2;
具体的,在本实施例中,步骤A1包括:当第四函数被调用时,装置判断PIN码标志中的验证标识是否置位,是则需要生成会话PIN码,执行步骤A6;否则不需要生成会话PIN码,执行步骤A2。例如,PIN码标志中第8位的值为1则表示需要生成会话PIN码;Specifically, in this embodiment, step A1 includes: when the fourth function is called, the device judges whether the verification flag in the PIN code flag is set, if yes, it needs to generate a session PIN code, and executes step A6; otherwise, it does not need to generate Session PIN code, go to step A2. For example, if the value of the eighth bit in the PIN code flag is 1, it means that a session PIN code needs to be generated;
步骤A2:装置判断是否需要使用会话PIN码进行登录,是则执行步骤A3,否则第四函数返回错误信息;Step A2: The device judges whether the session PIN code needs to be used for login, if yes, execute step A3, otherwise the fourth function returns an error message;
具体的,在本实施例中,步骤A2包括:装置判断PIN码标志中的登录标识是否置位,是则需要使用会话PIN码进行登录,执行步骤A3;否则不需要使用会话PIN码进行登录,第四函数返回错误信息;例如PIN码标志中第7位或第6位的值为1则表示需要使用会话PIN码进行登录;Specifically, in this embodiment, step A2 includes: the device judges whether the login flag in the PIN code flag is set, if yes, it needs to use the session PIN code to log in, and executes step A3; otherwise, it does not need to use the session PIN code to log in, The fourth function returns an error message; for example, if the value of the 7th or 6th bit in the PIN code flag is 1, it means that the session PIN code is required to log in;
步骤A3:装置判断是否保存有合法的会话PIN码,是则执行步骤A4,否则第四函数返回错误信息;Step A3: The device judges whether there is a legal session PIN code, if yes, execute step A4, otherwise the fourth function returns an error message;
具体的,在本实施例中,步骤A3包括:装置判断第四函数的参数中是否有会话PIN码且参数中的会话PIN码长度是否等于预设长度,是则执行步骤A4,否则第四函数返回错误信息;Specifically, in this embodiment, step A3 includes: the device judges whether there is a session PIN code in the parameter of the fourth function and whether the length of the session PIN code in the parameter is equal to the preset length, if yes, execute step A4, otherwise the fourth function return an error message;
步骤A4:装置判断指纹key是否登录有效,是则执行步骤A5,否则第四函数返回错误信息;Step A4: The device judges whether the fingerprint key is valid for login, if yes, execute step A5, otherwise the fourth function returns an error message;
具体的,在本实施例中,步骤A4包括:装置判断当前时间减去第二数据结构中的登录时间是否小于预设值,是则执行步骤A5,否则第四函数返回错误信息;Specifically, in this embodiment, step A4 includes: the device judges whether the current time minus the login time in the second data structure is less than the preset value, if yes, execute step A5, otherwise, the fourth function returns an error message;
步骤A5:装置设置指纹Key的登录状态为已登录,第四函数返回成功信息;Step A5: The device sets the login status of the fingerprint Key as logged in, and the fourth function returns success information;
具体的,在本实施例中,装置设置登录状态为已登录包括:装置将登录标识置位并保存;优选的,将登录标识保存到第二数据结构中;Specifically, in this embodiment, setting the login status of the device as logged in includes: the device sets and saves the login identifier; preferably, saves the login identifier into the second data structure;
步骤A6:装置判断生成PIN码的条件是否合法,是则执行步骤A7,否则第四函数返回错误信息;Step A6: The device judges whether the conditions for generating the PIN code are legal, if so, execute step A7, otherwise the fourth function returns an error message;
具体的,在本实施例中,步骤A6包括:装置判断第四函数的参数中的会话PIN码和会话PIN码长度是否均为空,是则不合法,第四函数返回错误信息;否则合法,执行步骤A7;Specifically, in this embodiment, step A6 includes: the device judges whether the session PIN code and the length of the session PIN code in the parameters of the fourth function are empty, if yes, it is invalid, and the fourth function returns an error message; otherwise, it is legal, Execute step A7;
步骤A7:装置判断指纹key的登录状态是否为已登录,是则执行步骤A10,否则执行步骤A8;Step A7: The device judges whether the login status of the fingerprint key is logged in, if yes, execute step A10, otherwise execute step A8;
具体的,在本实施例中,步骤A7包括:装置判断第二数据结构中保存的登录标识是否置位,是则指纹key处于已登录状态,执行步骤A10;否则指纹key处于未登录状态,执行步骤A8;Specifically, in this embodiment, step A7 includes: the device judges whether the login flag stored in the second data structure is set, if yes, the fingerprint key is in the logged-in state, and then executes step A10; otherwise, the fingerprint key is in the unregistered state, executes Step A8;
步骤A8:装置根据第一数据结构中的登录界面窗口句柄弹出指纹验证提示框,提示用户在指纹key上输入指纹进行验证,如指纹key对输入的指纹验证通过则指纹key设置自身当前状态为指纹验证已通过,给装置返回验证成功信息;如指纹key对输入的指纹验证未通过则指纹key设置自身当前状态为指纹验证未通过,给装置返回验证失败信息;Step A8: The device pops up a fingerprint verification prompt box according to the login interface window handle in the first data structure, prompting the user to input the fingerprint on the fingerprint key for verification. If the fingerprint key passes the verification of the input fingerprint, the fingerprint key sets its current state as fingerprint If the verification has passed, the verification success information is returned to the device; if the fingerprint key fails to pass the input fingerprint verification, the fingerprint key sets its current state as the fingerprint verification failed, and the verification failure information is returned to the device;
具体的,在本实施例中,步骤A8具体为:装置根据保存的登录界面窗口句柄弹出指纹验证提示框,并给指纹key发送指纹验证指令,当指纹key接收到用户输入的指纹时,判断接收到的指纹是否与内部保存的指纹是否相同,是则指纹key设置自身当前状态为指纹验证已通过,给装置返回指纹验证成功信息,否则指纹key设置自身当前状态为指纹验证未通过,给装置返回指纹验证失败信息;Specifically, in this embodiment, step A8 is specifically: the device pops up a fingerprint verification prompt box according to the saved login interface window handle, and sends a fingerprint verification instruction to the fingerprint key. Whether the received fingerprint is the same as the internally saved fingerprint, if yes, the fingerprint key sets its current status as fingerprint verification passed, and returns the fingerprint verification success message to the device, otherwise, the fingerprint key sets its current status as fingerprint verification failed, and returns to the device Fingerprint verification failure information;
步骤A9:装置根据接收到的指纹Key返回的信息判断指纹key是否验证成功,是则设置指纹key的登录状态为已登录,执行步骤A10,否则第四函数返回错误信息;Step A9: The device judges whether the verification of the fingerprint key is successful according to the information returned by the received fingerprint Key, and if so, sets the login status of the fingerprint key as logged in, and executes step A10, otherwise the fourth function returns an error message;
具体的,在本实施例中,步骤A9包括:装置根据接收到的信息判断指纹验证是否成功,如接收到的信息为指纹验证成功信息则指纹key验证成功,将第二数据结构中的登录标识置位,执行步骤A10,如接收到的信息为指纹验证失败信息则指纹key验证失败,第四函数返回错误信息;Specifically, in this embodiment, step A9 includes: the device judges whether the fingerprint verification is successful according to the received information, if the received information is the fingerprint verification success information, then the fingerprint key verification is successful, and the login identification in the second data structure Set, execute step A10, if the received information is the fingerprint verification failure information, then the fingerprint key verification fails, and the fourth function returns an error message;
步骤A10:装置生成会话PIN码并保存,且保存登录时间,第四函数返回成功信息;Step A10: The device generates and saves the session PIN code, and saves the login time, and the fourth function returns success information;
具体的,在本实施例中,步骤A10包括:装置根据第四函数的参数中的第一数据结构中的函数指针获取生成函数,通过生成函数生成对应的会话PIN码,保存生成的会话PIN码和本次登录时间,第四函数返回成功信息;优选的,将生成的会话PIN码和本次登录时间保存在第二数据结构中;Specifically, in this embodiment, step A10 includes: the device obtains the generation function according to the function pointer in the first data structure in the parameter of the fourth function, generates the corresponding session PIN code through the generation function, and saves the generated session PIN code and this login time, the fourth function returns success information; preferably, the generated session PIN code and this login time are stored in the second data structure;
步骤108:操作系统通过第四函数的返回值判断指纹key是否验证成功,是则操作系统根据第五函数指针调用对应的第五函数,执行步骤109,否则结束;Step 108: the operating system judges whether the fingerprint key has been verified successfully by the return value of the fourth function, if so, the operating system calls the corresponding fifth function according to the fifth function pointer, and executes step 109, otherwise ends;
具体的,在本实施例中,如第四函数返回成功信息则指纹key验证成功,否则指纹key验证失败;Specifically, in this embodiment, if the fourth function returns success information, the fingerprint key verification is successful, otherwise the fingerprint key verification fails;
在本实施例中,装置将容器索引、签名算法标识、待签名数据作为参数调用第五函数;In this embodiment, the device uses the container index, signature algorithm identifier, and data to be signed as parameters to call the fifth function;
步骤109:当第五函数被调用时,装置将待签名数据发送给指纹key,指纹key使用第五函数的参数定位签名私钥和签名算法,使用签名私钥根据签名算法对待签名数据进行运算生成登录操作系统所需的凭据信息,第五函数将凭据信息返回给操作系统;Step 109: When the fifth function is called, the device sends the data to be signed to the fingerprint key, and the fingerprint key uses the parameters of the fifth function to locate the signature private key and signature algorithm, and uses the signature private key to perform operations on the data to be signed according to the signature algorithm to generate Credential information required to log in to the operating system, the fifth function returns the credential information to the operating system;
具体的,在本实施例中,其中,指纹key使用第五函数的参数定位签名私钥和签名算法包括:指纹key分别根据第五函数的参数中的容器索引和签名算法标识获取对应容器中的签名私钥和签名算法;如指纹key签名不成功则给操作系统返回签名失败信息,第五函数返回错误信息;Specifically, in this embodiment, wherein the fingerprint key uses the parameters of the fifth function to locate the signature private key and signature algorithm includes: the fingerprint key obtains the corresponding container index and signature algorithm identifier in the parameters of the fifth function respectively. Signature private key and signature algorithm; if the fingerprint key signature is unsuccessful, the signature failure message will be returned to the operating system, and the fifth function will return an error message;
例如,本实施例中的待签名数据可以包括:用户名、域名、随机数等;For example, the data to be signed in this embodiment may include: user name, domain name, random number, etc.;
步骤110:操作系统通过第五函数的返回值判断计算签名是否成功,是则执行步骤111,否则结束;Step 110: The operating system judges whether the calculation signature is successful through the return value of the fifth function, if yes, execute step 111, otherwise end;
具体的,在本实施例中,如第五函数返回凭据信息则计算签名成功,否则计算签名失败;Specifically, in this embodiment, if the fifth function returns credential information, the calculation of the signature is successful; otherwise, the calculation of the signature fails;
步骤111:操作系统使用用户选择的证书对凭据信息进行验证,如验证成功则允许登录,如验证失败则拒绝登录;Step 111: the operating system uses the certificate selected by the user to verify the credential information, if the verification is successful, the login is allowed, and if the verification fails, the login is refused;
具体的,在本实施例中,使用用户选择的证书对签名结果进行验证,具体为:操作系统使用用户选择的证书中的签名公钥对签名结果进行解密,对待签名数据进行哈希计算,判断哈希计算结果和解密结果是否一致,是则验证成功,否则验证失败。Specifically, in this embodiment, the certificate selected by the user is used to verify the signature result, specifically: the operating system uses the signature public key in the certificate selected by the user to decrypt the signature result, performs hash calculation on the data to be signed, and determines Whether the hash calculation result is consistent with the decryption result, if yes, the verification succeeds, otherwise the verification fails.
实施例三Embodiment three
本发明实施例三提供一种使用指纹key进行登录的装置,如图3所示,包括第二操作模块302、第三操作模块303、第四操作模块304和第五操作模块305;Embodiment 3 of the present invention provides a device for logging in using a fingerprint key, as shown in FIG. 3 , including a second operating module 302, a third operating module 303, a fourth operating module 304, and a fifth operating module 305;
第二操作模块302,用于获取登录验证方式,并将登录验证方式返回给操作系统;The second operation module 302 is configured to obtain a login verification method, and return the login verification method to the operating system;
在本实施例中,第二操作模块302具体用于将第二函数参数中的外部PIN码验证方式设置为第一预设值,并将第一预设值的外部PIN码验证方式返回给操作系统;优选的,第二操作模块302具体用于将第二函数参数中的第三数据结构中的外部PIN码验证方式设置为第一预设值,并将第一预设值的外部PIN码验证方式返回给操作系统;In this embodiment, the second operation module 302 is specifically configured to set the external PIN code verification method in the second function parameter to the first preset value, and return the external PIN code verification method of the first preset value to the operation System; preferably, the second operation module 302 is specifically configured to set the external PIN code verification method in the third data structure in the second function parameter as the first preset value, and set the external PIN code of the first preset value The verification method is returned to the operating system;
第三操作模块303,用于获取第三函数参数中的登录验证方式,并判断登录验证方式是否为外部验证方式,是则获取第三函数参数中的登录界面窗口句柄并保存,返回成功信息,否则返回错误信息;The third operation module 303 is used to obtain the login verification method in the third function parameter, and judge whether the login verification method is an external verification method, if yes, obtain the login interface window handle in the third function parameter and save it, and return success information, Otherwise return an error message;
第四操作模块304,用于根据第三操作模块303保存的登录界面窗口句柄弹出指纹验证提示框,提示用户在指纹key上输入指纹进行验证,如指纹key对输入的指纹验证通过则指纹key设置自身当前状态为指纹验证已通过,如指纹key对输入的指纹验证未通过则指纹key设置自身当前状态为指纹验证未通过;The fourth operation module 304 is used for popping up a fingerprint verification prompt box according to the login interface window handle saved by the third operation module 303, prompting the user to input a fingerprint on the fingerprint key for verification, and if the fingerprint key passes the input fingerprint verification, then the fingerprint key is set The current state of itself is that the fingerprint verification has passed. If the fingerprint key fails to pass the input fingerprint verification, the fingerprint key sets its current state as the fingerprint verification failed;
具体的,在本实施例中,第四操作模块304包括:Specifically, in this embodiment, the fourth operation module 304 includes:
第一判断单元,用于当第四函数被调用时,判断是否需要生成会话PIN码;The first judging unit is used to judge whether a session PIN code needs to be generated when the fourth function is called;
在本实施例中,第一判断单元具体用于判断第四函数参数中的PIN码标志中的验证标识是否置位,是则需要生成会话PIN码,否则不需要生成会话PIN码;In this embodiment, the first judging unit is specifically used to judge whether the verification flag in the PIN code flag in the fourth function parameter is set, if yes, a session PIN code needs to be generated, otherwise, a session PIN code does not need to be generated;
第二判断单元,用于当第一判断单元判断为否时,判断是否需要使用会话PIN码进行登录,当判断为否时返回错误信息;The second judging unit is used to judge whether the session PIN code needs to be used to log in when the first judging unit judges no, and returns an error message when judging no;
在本实施例中,第二判断单元具体用于判断第四函数参数中的PIN码标志中的登录标识是否置位,当判断为否时返回错误信息;In this embodiment, the second judgment unit is specifically used to judge whether the login flag in the PIN code flag in the fourth function parameter is set, and return an error message when the judgment is no;
第三判断单元,用于当第二判断单元判断为是时,判断是否保存有合法的会话PIN码,当判断为否时返回错误信息;The third judging unit is used to judge whether a legal session PIN code is stored when the second judging unit judges yes, and returns an error message when judging no;
在本实施例中,第三判断单元具体用于判断第四函数的参数中是否有会话PIN码且参数中的会话PIN码长度是否等于预设长度,当判断为否时返回错误信息;In this embodiment, the third judging unit is specifically used to judge whether there is a session PIN code in the parameter of the fourth function and whether the length of the session PIN code in the parameter is equal to the preset length, and returns an error message when the judgment is no;
第四判断单元,用于当第三判断单元判断为是时,判断指纹key是否登录有效,当判断为否时返回错误信息;The fourth judging unit is used for judging whether the fingerprint key is valid for logging in when the third judging unit judges yes, and returns an error message when judging no;
在本实施例中,第四判断单元具体用于判断当前时间减去保存的登录时间是否小于预设值,当判断为否时返回错误信息;优选的,登录时间保存在第二数据结构中;In this embodiment, the fourth judging unit is specifically used to judge whether the current time minus the stored login time is less than a preset value, and return an error message when the judgment is no; preferably, the login time is stored in the second data structure;
第一设置单元,用于当第四判断单元判断为是时,设置指纹key的登录状态为已登录,返回成功信息;The first setting unit is used to set the login status of the fingerprint key as logged in when the fourth judging unit judges as yes, and return success information;
在本实施例中,第一设置单元具体用于将登录标识置位并保存,返回成功信息;优选的,将登录标识保存到到第二数据结构中;In this embodiment, the first setting unit is specifically configured to set and save the login identifier, and return success information; preferably, save the login identifier into the second data structure;
第五判断单元,用于当第一判断单元判断为是时,判断生成PIN码的条件是否合法,当判断为否时返回错误信息;The fifth judging unit is used to judge whether the condition for generating the PIN code is legal when the first judging unit judges yes, and returns an error message when judging no;
在本实施例中,第五判断单元具体用于判断第四函数的参数中的会话PIN码和会话PIN码长度是否均为空,是则返回错误信息;In this embodiment, the fifth judging unit is specifically used to judge whether the session PIN code and the length of the session PIN code in the parameters of the fourth function are empty, and if so, return an error message;
第六判断单元,用于当第五判断单元判断为是时,判断指纹key的登录状态是否为已登录;The sixth judging unit is used to judge whether the login status of the fingerprint key is logged in when the fifth judging unit judges yes;
在本实施例中,第六判断单元具体用于判断第二数据结构中保存的登录标识是否置位,是则指纹key处于已登录状态,否则指纹key处于未登录状态;In this embodiment, the sixth judging unit is specifically used to judge whether the login flag stored in the second data structure is set, if yes, the fingerprint key is in the logged-in state, otherwise the fingerprint key is in the unregistered state;
弹出提示单元,用于当第六判断单元判断为否时,根据第三操作模块保存的登录界面窗口句柄弹出指纹验证提示框,提示用户在指纹key上输入指纹进行验证;如指纹key对输入的指纹验证通过则指纹key设置自身当前状态为指纹验证已通过,给装置返回验证成功信息;如指纹key对输入的指纹验证未通过则指纹key设置自身当前状态为指纹验证未通过,给装置返回验证失败信息;A pop-up prompt unit is used to pop up a fingerprint verification prompt box according to the login interface window handle saved by the third operation module when the sixth judging unit judges as No, prompting the user to input the fingerprint on the fingerprint key for verification; If the fingerprint verification is passed, the fingerprint key sets its current state as fingerprint verification passed, and returns verification success information to the device; if the fingerprint key fails to pass the input fingerprint verification, the fingerprint key sets its current state as fingerprint verification failed, and returns verification to the device failure message;
在本实施例中,弹出提示单元具体用于根据保存的登录界面窗口句柄弹出指纹验证提示框,并给指纹key发送指纹验证指令,当指纹key接收到用户输入的指纹时,判断接收到的指纹是否与内部保存的指纹一致,是则指纹key设置自身当前状态为指纹验证已通过,给装置返回验证成功信息;否则指纹key设置自身当前状态为指纹验证未通过,给装置返回验证失败信息;In this embodiment, the pop-up prompt unit is specifically used to pop up a fingerprint verification prompt box according to the saved login interface window handle, and send a fingerprint verification instruction to the fingerprint key, and when the fingerprint key receives the fingerprint input by the user, judge the received fingerprint Whether it is consistent with the internally stored fingerprint, if so, the fingerprint key sets its current status as fingerprint verification passed, and returns verification success information to the device; otherwise, the fingerprint key sets its current status as fingerprint verification failed, and returns verification failure information to the device;
接收单元,用于接收指纹key返回的验证成功信息或验证失败信息;The receiving unit is used to receive the verification success information or the verification failure information returned by the fingerprint key;
第七判断单元,用于根据接收单元接收到的指纹key返回的信息判断指纹key是否验证成功,是则设置指纹key的登录状态为已登录,否则返回错误信息;The seventh judging unit is used to judge whether the verification of the fingerprint key is successful according to the information returned by the fingerprint key received by the receiving unit, if so, the login status of the fingerprint key is set as logged in, otherwise an error message is returned;
在本实施例中,第七判断单元具体用于根据接收单元接收到的指纹key返回的信息判断指纹key是否验证成功,如接收到的信息为验证成功信息则将登录标识置位,如接收到的信息为验证失败信息则返回错误信息;优选的,本实施例中的登录标识保存在第二数据结构中;In this embodiment, the seventh judging unit is specifically used to judge whether the fingerprint key is verified successfully according to the information returned by the fingerprint key received by the receiving unit. If the information is verification failure information, an error message is returned; preferably, the login ID in this embodiment is stored in the second data structure;
生成保存单元,用于当第六判断单元和/或第七单元判断为是时生成会话PIN码并保存,且保存登录时间,返回成功信息。A saving unit is generated, configured to generate and save the session PIN code when the sixth judging unit and/or the seventh unit judges yes, save the login time, and return success information.
在本实施例中,生成保存单元具体用于根据第四函数的参数中的函数指针获取生成函数,通过生成函数生成对应的会话PIN码,保存会话PIN码和登录时间,返回成功信息;优选的,生成保存单元将会话PIN码和登录时间保存在第二数据结构中;In this embodiment, the generation and storage unit is specifically used to obtain the generation function according to the function pointer in the parameter of the fourth function, generate a corresponding session PIN code through the generation function, save the session PIN code and login time, and return success information; preferably , generating a saving unit to save the session PIN code and login time in the second data structure;
第五操作模块305,用于将待签名数据发送给指纹key,指纹key检查自身当前状态是否为指纹验证已通过,是则指纹key使用第五函数的参数定位签名私钥和签名算法,使用签名私钥根据签名算法对待签名数据进行运算生成登录操作系统所需的凭据信息,第五操作模块还用于将凭据信息返回给操作系统;否则结束操作。The fifth operation module 305 is used to send the data to be signed to the fingerprint key. The fingerprint key checks whether its current state is that the fingerprint verification has passed. If so, the fingerprint key uses the parameters of the fifth function to locate the signature private key and signature algorithm, and uses the The private key performs operations on the data to be signed according to the signature algorithm to generate credential information required for logging in to the operating system, and the fifth operation module is also used to return the credential information to the operating system; otherwise, end the operation.
在本实施例中的装置还可以包括第一操作模块,当操作系统接收到登录触发信息时,提示用户插入指纹key;如操作系统检测到指纹key插入时,获取指纹key中的所有用户证书并显示,提示用户选择进行登录所使用的证书,当操作系统接收到用户选择的进行登录所使用的证书时触发第一操作模块;第一操作模块用于将函数地址列表返回给操作系统,操作系统分别根据函数地址列表中的第二函数地址、第三函数地址、第四函数地址和第五函数地址调用第二函数、第三函数、第四函数和第五函数。在本实施例中,第一操作模块具体用于初始化第一数据结构,获取第二函数地址、第三函数地址、第四函数地址、第五函数地址,创建第二数据结构并将第二数据结构保存到第一数据结构中。优选的,第二函数地址、第三函数地址、第四函数地址、第五函数地址为第二函数指针、第三函数指针、第四函数指针、第五函数指针。The device in this embodiment may also include a first operating module, which prompts the user to insert the fingerprint key when the operating system receives the login trigger information; if the operating system detects that the fingerprint key is inserted, obtains all user certificates in the fingerprint key and display, prompting the user to select the certificate used for login, and triggering the first operation module when the operating system receives the certificate used for login selected by the user; the first operation module is used to return the function address list to the operating system, and the operating system The second function, the third function, the fourth function and the fifth function are respectively called according to the second function address, the third function address, the fourth function address and the fifth function address in the function address list. In this embodiment, the first operation module is specifically used to initialize the first data structure, obtain the address of the second function, the address of the third function, the address of the fourth function, and the address of the fifth function, create the second data structure and store the second data The structure is saved into the first data structure. Preferably, the second function address, the third function address, the fourth function address, and the fifth function address are the second function pointer, the third function pointer, the fourth function pointer, and the fifth function pointer.
本发明技术方案在Window函数中通过使用外部验证密码方式,用指纹验证代替PIN验证,只需要修改厂商的Windows函数来弹出指纹提示框而不弹出PIN码框,让指纹Key直接在Windows系统中能正常使用,方便用户使用。In the technical solution of the present invention, by using the external verification password mode in the Window function, the fingerprint verification is used instead of the PIN verification, and only the Windows function of the manufacturer needs to be modified to pop up the fingerprint prompt box instead of the PIN code box, so that the fingerprint Key can be used directly in the Windows system. Normal use, user-friendly.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明公开的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto, any changes or variations that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
Claims (29)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710389097.3A CN107241192B (en) | 2017-05-27 | 2017-05-27 | A method and device for logging in using a fingerprint key |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710389097.3A CN107241192B (en) | 2017-05-27 | 2017-05-27 | A method and device for logging in using a fingerprint key |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107241192A CN107241192A (en) | 2017-10-10 |
CN107241192B true CN107241192B (en) | 2019-08-30 |
Family
ID=59984664
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710389097.3A Active CN107241192B (en) | 2017-05-27 | 2017-05-27 | A method and device for logging in using a fingerprint key |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107241192B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107808082B (en) * | 2017-10-13 | 2021-08-24 | 平安科技(深圳)有限公司 | Electronic device, data access verification method, and computer-readable storage medium |
CN107609362B (en) * | 2017-10-19 | 2020-02-11 | 飞天诚信科技股份有限公司 | Method for logging in Windows system by smart card and private credential providing device |
CN108256309B (en) * | 2018-01-10 | 2020-01-03 | 飞天诚信科技股份有限公司 | Method and device for realizing system logging in windows10 or above |
CN109391615A (en) * | 2018-09-27 | 2019-02-26 | 深圳互联先锋科技有限公司 | A kind of server exempts from close login method and system |
CN110460965B (en) * | 2019-06-27 | 2021-09-07 | 星贝瑞有限公司 | System and method for dynamically identifying mobile devices responding by radio signals |
CN111563247A (en) * | 2020-07-14 | 2020-08-21 | 飞天诚信科技股份有限公司 | Method and device for logging in system by intelligent key equipment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1556449A (en) * | 2004-01-08 | 2004-12-22 | 中国工商银行 | Device and method for proceeding encryption and identification of network bank data |
CN101430808A (en) * | 2007-11-09 | 2009-05-13 | 王巍 | Fingerprint credit pen payment system, method and apparatus |
CN101447010A (en) * | 2008-12-30 | 2009-06-03 | 北京飞天诚信科技有限公司 | Login system and method for logging in |
CN101587519A (en) * | 2008-05-21 | 2009-11-25 | 北京飞天诚信科技有限公司 | System and method for realizing multifunctional information security device |
CN101662469A (en) * | 2009-09-25 | 2010-03-03 | 浙江维尔生物识别技术股份有限公司 | Method and system based on USBKey online banking trade information authentication |
CN103186736A (en) * | 2013-04-01 | 2013-07-03 | 深圳市亚略特生物识别科技有限公司 | Fingerprint key device |
CN104239762A (en) * | 2014-09-16 | 2014-12-24 | 浪潮电子信息产业股份有限公司 | Method for realizing secure login in Windows system |
-
2017
- 2017-05-27 CN CN201710389097.3A patent/CN107241192B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1556449A (en) * | 2004-01-08 | 2004-12-22 | 中国工商银行 | Device and method for proceeding encryption and identification of network bank data |
CN101430808A (en) * | 2007-11-09 | 2009-05-13 | 王巍 | Fingerprint credit pen payment system, method and apparatus |
CN101587519A (en) * | 2008-05-21 | 2009-11-25 | 北京飞天诚信科技有限公司 | System and method for realizing multifunctional information security device |
CN101447010A (en) * | 2008-12-30 | 2009-06-03 | 北京飞天诚信科技有限公司 | Login system and method for logging in |
CN101662469A (en) * | 2009-09-25 | 2010-03-03 | 浙江维尔生物识别技术股份有限公司 | Method and system based on USBKey online banking trade information authentication |
CN103186736A (en) * | 2013-04-01 | 2013-07-03 | 深圳市亚略特生物识别科技有限公司 | Fingerprint key device |
CN104239762A (en) * | 2014-09-16 | 2014-12-24 | 浪潮电子信息产业股份有限公司 | Method for realizing secure login in Windows system |
Non-Patent Citations (1)
Title |
---|
基于指纹加密保护的USB Key安全方案;王明波 等;《微计算机信息》;20090927;第25卷(第7-3期);30-31 |
Also Published As
Publication number | Publication date |
---|---|
CN107241192A (en) | 2017-10-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107241192B (en) | A method and device for logging in using a fingerprint key | |
TWI686075B (en) | Identity verification method and device, electronic equipment | |
CN106487511B (en) | Identity authentication method and device | |
CN104506321B (en) | A kind of method of seed data in renewal dynamic token | |
CN109714303A (en) | BIOS starts method and data processing method | |
WO2020035009A1 (en) | Authentication system and working method therefor | |
CN106612180A (en) | Method and device for realizing session identifier synchronization | |
CN111064743B (en) | Method and system for safely inputting password | |
CN109144552A (en) | A kind of boot firmware method for refreshing and device | |
CN103312519B (en) | A kind of dynamic password device and method of work thereof | |
CN102571355B (en) | Method and device for importing secret key without landing | |
CN109547451A (en) | The method of authentic authentication service authentication based on TEE | |
CN103684782A (en) | Method for activating token equipment in token authentication system | |
CN107124279A (en) | The method and device of erasing terminal data | |
CN106161031A (en) | Server password generates method, verification method and device | |
CN107563186A (en) | A kind of safe starting method and device | |
US9210134B2 (en) | Cryptographic processing method and system using a sensitive data item | |
CN110166471A (en) | A kind of portal authentication method and device | |
CN107919963B (en) | Authenticator and implementation method thereof | |
TW201035799A (en) | A method of protecting a secure USB key | |
CN112287312A (en) | Method and system for logging in Windows operating system | |
CN105871557B (en) | Email signature method, apparatus and system | |
CN110210831B (en) | Office examination and approval method and system based on data short message technology | |
CN114117388A (en) | Device registration method, device registration device, electronic device, and storage medium | |
CN106301790B (en) | Confidential information interaction method, mobile terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
OL01 | Intention to license declared | ||
OL01 | Intention to license declared | ||
OL01 | Intention to license declared |