WO2021128988A1 - 鉴权方法和设备 - Google Patents

鉴权方法和设备 Download PDF

Info

Publication number
WO2021128988A1
WO2021128988A1 PCT/CN2020/116535 CN2020116535W WO2021128988A1 WO 2021128988 A1 WO2021128988 A1 WO 2021128988A1 CN 2020116535 W CN2020116535 W CN 2020116535W WO 2021128988 A1 WO2021128988 A1 WO 2021128988A1
Authority
WO
WIPO (PCT)
Prior art keywords
certificate
authentication
information
public key
verification
Prior art date
Application number
PCT/CN2020/116535
Other languages
English (en)
French (fr)
Inventor
唐甜
乔立忠
张梦楠
曹斌
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021128988A1 publication Critical patent/WO2021128988A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic 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/3263Cryptographic 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 certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • H04L9/3268Cryptographic 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 certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements using certificate validation, registration, distribution or revocation, e.g. certificate revocation list [CRL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0823Network architectures or network communication protocols for network security for authentication of entities using certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic 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/3236Cryptographic 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 cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic 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/3236Cryptographic 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 cryptographic hash functions
    • H04L9/3239Cryptographic 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 cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic 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/3247Cryptographic 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 digital signatures

Definitions

  • This application relates to the technical field of secure communication, and in particular, to an authentication method and device.
  • the method is used to authenticate the device or the interface on the device when there is a need to open the use right of the device or the interface on the device.
  • the device is usually authenticated by a codebook to ensure the security of the device and the information on it. Specifically, multiple passwords are stored in the codebook, and one or more passwords are preset on the device.
  • designated personnel such as debuggers, operation and maintenance personnel, production Personnel, etc.
  • the matching is successful, the device is deemed to have passed the authentication, and the device will open the use rights corresponding to the successfully matched password. Access the corresponding important information through the use permissions that have been opened on the device.
  • the embodiments of the present application provide an authentication method and device, as well as a method and device for authenticating the use authority of the first device, through a certificate authority with a higher security level (English: Certificate Authority, abbreviated as: The CA) server and other devices digitally sign the certificate and the device to be authenticated performs the integrity verification of the signed certificate, which realizes the more secure authentication of the device to be authenticated.
  • a certificate authority with a higher security level (English: Certificate Authority, abbreviated as: The CA) server and other devices digitally sign the certificate and the device to be authenticated performs the integrity verification of the signed certificate, which realizes the more secure authentication of the device to be authenticated.
  • the CA Certificate Authority
  • an authentication method is provided, which is applied in a scenario including a first device and a second device, with the first device as the execution subject, the authentication method may include, for example, the first device obtains from the second device The first certificate digitally signed with the first private key can verify the first certificate and obtain the first verification result. Then, the first device can determine the use authority of the first device based on the first verification result . Specifically, when the first verification result indicates that the verification is passed, the first device opens the corresponding use right, and when the first verification result indicates that the verification fails, the first device does not open the corresponding use right.
  • the first certificate is digitally signed by a second device with a certificate issuance function and a digital signature function and a higher security level, and the first device to be authenticated verifies the first certificate after the digital signature.
  • the authentication of the first device to be authenticated overcomes the current security risks that exist when the first device is protected by the codebook or the exposed pads of the interface.
  • the certificate and the digital number issued by the second device with a high security level are used to protect the security of the first device.
  • the signature technology ensures that the protection of the first device to be authenticated is more secure and reliable.
  • the first device may be any device to be authenticated, for example: it may refer to a network device or a single board, for example: it may also refer to a debugging interface or a service interface on the device.
  • the second device may refer to an authentication server with a higher security level and a certificate issuance function and a digital signature function, for example, a certificate authority (English: Certificate Authority, abbreviated as: CA) server.
  • CA Certificate Authority
  • the first device verifies the first certificate may specifically include: the first device verifies the first certificate according to the first public key corresponding to the first private key stored locally. Specifically, it includes two parts: integrity verification and legality verification of the first certificate. What the first device receives is the first certificate and the signature of the first certificate. The first device can perform the signature on the received signature through the first public key. Decrypt to obtain the first digest. The first device can also calculate the received hash value of the first certificate and record it as the second digest of the first certificate. The first device passes the matching verification of the first digest and the second digest, Determine the first verification result of the first certificate.
  • the first verification result indicates that the verification of the first certificate is passed; when the first digest and the second digest do not match, then the first The verification result indicates that the verification of the first certificate failed.
  • the certificate is verified by the public key stored locally in the first device, and the first device is guided to manage its use authority, and reliable and safe authentication of the first device is realized.
  • the first certificate may include a certificate type
  • verifying the first certificate by the first device may also include: verifying the certificate type.
  • the first device can read this field, and when it is determined that the field indicates that the first certificate is an authentication certificate, The first verification result may indicate that the verification of the first certificate is passed; otherwise, when it is determined that the field indicates that the first certificate is not an authentication certificate, the first verification result may indicate that the verification of the first certificate is not passed.
  • the first device can also instruct the first device to manage its use authority by verifying the certificate type of the received first certificate, so as to realize reliable and safe authentication of the first device.
  • the first certificate may also include first device identification information, and then verifying the first certificate may also include: checking the first device identification information based on the locally stored second device identification information of the first device.
  • the first device identification information carried in a certificate is matched and verified, wherein the second device identification information is used to uniquely identify the first device.
  • the first device identification information may be a first device identification (English: Identification, abbreviation: ID)
  • the first device verifies the first certificate
  • the second device ID is used to perform matching verification on the first device ID carried in the first certificate, where the second device ID is used to uniquely identify the first device.
  • the first device identification information may also be a hash value of the first device ID.
  • the first device to verify the first certificate may also include: the first device based on the locally stored The hash value of the second device ID of the first device performs matching verification on the hash value of the first device ID carried in the first certificate, where the second device ID is used to uniquely identify the first device.
  • the first certificate may extend a field used to carry the first device ID or the hash value of the first device ID in its extension field.
  • the device ID in this embodiment of the application is a non-public ID that can uniquely identify the device, for example: the second device ID is the hardware unique key (in English) defined when the first device leaves the factory.
  • HUK Hardware Unique Key
  • the second device ID is based on the chip identification of the first device (English: die Identification, referred to as die ID) and the unique device identification (English: Unique Device Identification, referred to as UDI) ) Processed.
  • die ID the chip identification of the first device
  • UDI Unique Device Identification
  • the first device ID or the hash value of the first device ID carried in the first certificate is verified through the second device ID or the hash value of the second device ID stored locally by the first device, and the first device is guided
  • the management of its use authority realizes reliable and safe authentication of the first device.
  • the first certificate may further include a first certificate identification ID
  • the first device verifies the first certificate, and may also include: the first device performs verification on the first certificate ID according to the locally stored second certificate ID. Match verification.
  • the first certificate may extend the field used to carry the first certificate ID in its extension field.
  • the first device does not store the certificate ID of the first certificate locally.
  • a certificate ID that is, it is considered that the matching verification of the first certificate ID is passed, and the first certificate can be used for authentication.
  • the first device when the first device has used the first certificate for authentication, then the first device locally stores the second certificate ID of the first certificate. In this case, when the first device determines to store locally The second certificate ID matches the first certificate ID in the first certificate, that is, it is considered that the matching verification of the first certificate ID is passed, and the first certificate can be used for authentication. In another case, when the first device has used the first certificate for authentication, the first device locally stores the second certificate ID of the first certificate, but because the number of times the first certificate has been used exceeds the upper limit or The usage time exceeds the upper limit, and the second certificate ID is marked as invalid.
  • the first device determines that the locally stored second certificate ID matches the first certificate ID in the first certificate, but the status of the second certificate ID is If it is invalid, it is considered that the matching verification of the first certificate ID has not passed, and the first certificate can no longer be used to authenticate the first device.
  • the second certificate ID stored locally in the first device the first certificate ID carried in the first certificate is verified, and the first device is guided to manage its use authority, so as to realize reliable and safe authentication of the first device. .
  • the first certificate may also include target valid information, and the target valid information is used by the device 1 to determine whether the certificate 1 can continue to be used for authentication. Then, verifying the first certificate by the first device may also include: the first device verifies the target valid information according to actual use information, and the actual use information is used to characterize the current use of the first certificate on the first device.
  • the target effective information is the maximum number of times allowed to use the first certificate for authentication (for example: 5 times), then the actual use information is the actual number of times the first device has used the first certificate for authentication so far; or ,
  • the target valid information is the maximum time allowed to use the first certificate for authentication (for example: 20 hours), then the actual usage information is the actual usage time from the timing start time of the target valid information to the current moment.
  • the first certificate may extend the field used to carry the effective information of the target in its extension field.
  • the first device may revoke the first certificate, such as: corresponding to the first certificate stored locally by the first device
  • the ID of the second certificate is marked as invalid. In this way, the actual use information stored locally by the first device is used to verify the effective target information carried in the first certificate, guide the first device to manage its use authority, and achieve reliable and safe authentication of the first device.
  • the first certificate may further include a second public key
  • the first device to verify the first certificate may also include: the first device verifies the second public key according to the first public key stored locally. If the first device determines that the first public key and the second public key are inconsistent, the first device regards it as the second device and needs to update the first public key and the first private key that are not sufficiently secure. Then, the embodiment of this application also It may include: the first device replaces the locally stored first public key with the second public key. In this way, through the first public key stored locally in the first device, the second public key carried in the first certificate is verified, and when the public keys are consistent, the first device is guided to manage its usage rights, so as to realize the reliability of the first device. And secure authentication; when the public key is inconsistent, guide the first device to update the locally stored public key, complete the update of the authentication public and private key by the second device, so that subsequent authentication of the first device is more secure.
  • the embodiment of the present application also provides a method for authenticating the use authority of the first device, which is implemented by the second device, for example, may include: the second device uses the first private key to digitally perform the first certificate Signature, where the first private key and the first certificate are both generated by the second device to authenticate the first device; and the second device sends the first device digitally signed by the first private key to the first device
  • the certificate is used to authenticate the use authority of the first device.
  • the first certificate is digitally signed by a second device with a certificate issuance function and a digital signature function and a higher security level, and the digitally signed first certificate is sent to the first device to be authenticated.
  • the first device verifies the first certificate after the digital signature to realize the authentication of the first device to be authenticated, which overcomes the current problem of protecting the security of the first device by means of a codebook or exposed pads corresponding to the interface.
  • the certificate issued by the second device with a high security level and digital signature technology ensure that the protection of the first device to be authenticated is more secure and reliable.
  • the first device may be any device to be authenticated, such as a debugging interface, and the second device may be an authentication server.
  • the first certificate may also include first device identification information, and the first device identification information is used by the first device for identity verification.
  • the first device identification information may be the first device ID or the hash value of the first device ID.
  • the embodiment of the application may further include: the second device receives a certificate request message, the certificate request message includes the first device identification ID; the second device performs matching verification on the first device ID according to the locally stored second device ID .
  • the second device receives a certificate request message, the certificate request message includes the hash value of the first device ID; the second device checks the first device ID according to the hash value of the second device ID stored locally The hash value is matched and verified.
  • the second device may also carry the first device ID or the hash value of the first device ID in the first certificate and send it to the first device.
  • the device ID is a non-public ID that can uniquely identify the device.
  • the first device ID is the hardware unique key HUK defined when the first device leaves the factory, and for example: the first device ID is based on the first device The chip identification die ID and the unique device identification UDI are processed.
  • the second device verifies the first device ID or the hash value of the first device ID carried in the certificate request message through the locally stored second device ID or the hash value of the second device ID, and guides the second device Whether to issue the first certificate to the first device, so that the authentication of the first device is more reliable and safer.
  • the first certificate may also include target valid information, and the target valid information is used by the first device to determine whether the first certificate can continue to be used for authentication.
  • the target valid information may specifically be the maximum number of times allowed to use the first certificate for authentication, or the target valid information may also be the maximum time allowed to use the first certificate for authentication.
  • the embodiment of the present application may further include: the second device receives a certificate request message, and the certificate request message may also include target validity information.
  • the first certificate may also carry at least one of the certificate type, the first device identification information, and the first certificate ID.
  • the specific content carried in the first certificate and the corresponding verification method of the first device to the first certificate please refer to the related description of the first aspect.
  • this application also provides a first device, including a transceiver unit and a processing unit.
  • the transceiving unit is used to perform the transceiving operations in the method provided in the first aspect; the processing unit is used to perform other operations in addition to the transceiving operations in the first aspect.
  • the transceiving unit is used to obtain a first certificate that uses a first private key for digital signature; the processing unit is used to verify the first certificate Perform verification to obtain a first verification result; the processing unit is further configured to determine the use right of the first device according to the first verification result.
  • an embodiment of the present application also provides a second device, and the second device includes a transceiver unit and a processing unit.
  • the transceiving unit is used to perform the transceiving operation in the method provided in the above second aspect; the processing unit is used to perform other operations in addition to the transceiving operation in the above second aspect.
  • the transceiving unit is configured to send a first certificate digitally signed with a first private key to the first device; the processing unit is configured to Use the first private key to digitally sign the first certificate.
  • an embodiment of the present application also provides a first device, including a communication interface and a processor.
  • the communication interface is used to perform the transceiving operation in the method provided in the foregoing first aspect;
  • the processor is used to perform other operations except the transceiving operation in the method provided in the foregoing first aspect.
  • an embodiment of the present application also provides a second device, including a communication interface and a processor.
  • the communication interface is used to perform the transceiving operation in the method provided in the foregoing second aspect;
  • the processor is used to perform other operations in the method provided in the foregoing second aspect except for the transceiving operation.
  • an embodiment of the present application further provides a first device, and the first device includes a memory and a processor.
  • the memory is used to store program code; the processor is used to run instructions in the program code, so that the first device executes the method provided in the first aspect above.
  • an embodiment of the present application also provides a second device, the second device including a memory and a processor.
  • the memory is used to store program code; the processor is used to run instructions in the program code, so that the first device executes the method provided in the second aspect above.
  • the embodiments of the present application also provide a computer-readable storage medium that stores instructions in the computer-readable storage medium, which when run on a computer, causes the computer to execute the first aspect or the second aspect above.
  • the authentication method provided by the aspect is not limited to:
  • the embodiments of the present application also provide a computer program product, which when running on a computer, causes the computer to execute the authentication method provided in the first or second aspect.
  • an embodiment of the present application also provides a communication system, which includes the first device provided in the third, fifth, or seventh aspect and the fourth, sixth, or first device provided in the third, fifth, or seventh aspect.
  • the second device provided by the eighth aspect.
  • FIG. 1 is a schematic diagram of a network system framework involved in an application scenario in an embodiment of this application;
  • FIG. 2 is a schematic diagram of the authentication process of the device 12 in the scenario of FIG. 1 in an embodiment of the application;
  • FIG. 3 is a schematic flowchart of an authentication method 100 in an embodiment of this application.
  • Figure 4a is a schematic diagram of a certificate in an embodiment of the application.
  • FIG. 4b is a schematic diagram of the certificate after digitally signing the certificate in FIG. 4a in an embodiment of the application;
  • FIG. 5 is a schematic flowchart of an authentication method 200 in the scenario of FIG. 1 in an embodiment of the application;
  • FIG. 6 is a schematic flowchart of an authentication method 300 in an embodiment of this application.
  • FIG. 7 is a schematic flowchart of a method 400 for authenticating the use right of a first device in an embodiment of this application;
  • FIG. 8 is a schematic structural diagram of a first device 800 in an embodiment of this application.
  • FIG. 9 is a schematic structural diagram of a second device 900 in an embodiment of this application.
  • FIG. 10 is a schematic structural diagram of a first device 1000 in an embodiment of this application.
  • FIG. 11 is a schematic structural diagram of a second device 1100 in an embodiment of this application.
  • FIG. 12 is a schematic structural diagram of a first device 1200 in an embodiment of this application.
  • FIG. 13 is a schematic structural diagram of a second device 1300 in an embodiment of this application.
  • FIG. 14 is a schematic structural diagram of a communication system 1400 in an embodiment of this application.
  • Some important information (for example: hard disk data of the device) is generally stored on the device. This important information is critical to the safety of the device, and certain protective measures need to be taken to ensure the safety of this important information.
  • the device is usually authenticated by a codebook.
  • One or more passwords are preset on the device, and multiple passwords are stored in the codebook.
  • the debugging personnel, operation and maintenance Designated personnel such as personnel, production personnel, enter the password in the codebook into the device, and the device will match the entered password with the preset password.
  • the match is successful, it will be regarded as the authentication of the device passed, and the device will be opened.
  • the use authority corresponding to the successfully matched password so that the corresponding important information can be accessed through the open use authority.
  • the cipher book is controlled by a small number of designated personnel, which can ensure the security of important information stored on the device to a certain extent, the storage, transmission and matching of the cipher book are all in plain text, and the designated personnel with the authority of the cipher book It is more complicated, and it is very easy to leak the password in the codebook by manual management.
  • the method of using the codebook to authenticate the device has low security.
  • the hardware data of a Microsoft notebook is usually encrypted and protected by a two-level key, that is, encrypted by a full volume encryption key (English: Full Volume Encryption Key, abbreviated as: FVEK), and encrypted by a volume master key (English: Volume Master Key).
  • FVEK Full Volume Encryption Key
  • VMK volume master key
  • TPM Trusted Platform Module
  • the attacker It is easy to identify the LPC interface of the exposed TPM, and connect the interface to the logic analyzer through a jumper to directly obtain the VMK, thereby cracking the FVEK encrypted by the VMK, and then cracking the hard disk encrypted by the FVEK Data seriously endangers the safety of the laptop.
  • the embodiment of the present application provides an authentication method.
  • the first device needs to be authenticated.
  • the corresponding usage rights on the first device can be opened for the user to access the first device. Safely access the first device within the scope of the open use authority.
  • the authentication process may specifically include: a second device with a certificate issuing function, such as a certificate authority (English: Certificate Authority, CA) server, generates a first certificate for the first device to be authenticated, and based on the first The private key digitally signs the first certificate, then when the first device obtains the digitally signed first certificate, it can verify the digitally signed certificate to obtain the first verification result, and based on the The first verification result authenticates the use right of the first device.
  • a certificate authority English: Certificate Authority, CA
  • the first device When the first verification result indicates that the verification is passed, the first device opens the corresponding use right, and when the first verification result indicates that the verification fails, the first device does not open the corresponding use right.
  • the first certificate is digitally signed by a second device with a certificate issuance function and a digital signature function and a higher security level, and the first device to be authenticated verifies the first certificate after the digital signature.
  • the authentication of the first device to be authenticated overcomes the current security risks that exist when the first device is protected by the codebook or the exposed pads of the interface.
  • the certificate and the digital number issued by the second device with a high security level are used to protect the security of the first device.
  • the signature technology ensures that the protection of the first device to be authenticated is more secure and reliable.
  • digital signature technology can be regarded as a combination of digital digest technology and public-private key technology. It can not only verify whether the certificate has been tampered with through digital digest technology, but also verify whether the digital digest is legal through public and private key technology. And comprehensive integrity protection and verification technology. Digital signatures usually include a pair of keys, one key is used to sign the digital digest of certificates, messages, etc., and the other key is used to verify the signatures of certificates, messages, etc.
  • the digital signature process for certificate X can include the following two processes:
  • the first process is to sign the digital digest of certificate X, that is, before certificate X is downloaded from the CA server to device Y, the CA server
  • the digital digest digest X1 of X can be calculated through the hash algorithm first, and then the digest X1 can be digitally signed with the private key a to obtain digestEncode X1; when the certificate X is downloaded to the device Y, the information sent to the device Y includes X and digestEncode X1;
  • the private key a and the public key A are a pair of keys provided by the CA server corresponding to the manufacturer of the device Y.
  • the public key A is publicly visible, and the private key a is confidential and only visible to the CA server. It can be seen that because the CA server has a high security level, in the embodiment of the application, the certificate issued by the CA server and the digital signature technology for digital signature of the certificate are used as a security protection measure with a high security level for the device to be authenticated.
  • the network includes: a CA server 11, a device 12, and a user 13.
  • the CA server 11 may be a safe, authoritative, and trustworthy server corresponding to the manufacturer of the device 12.
  • the CA server 11 may generate, distribute, and manage certificates corresponding to each device of the manufacturer.
  • the CA server 11 can also It can be used as a signature system for each device of the manufacturer, and digitally sign the certificate that will be sent to each device.
  • the device 12 can be any device that needs to be authenticated.
  • the device 12 can be a network device such as a router or a switch, a terminal device such as a mobile phone, a laptop, etc., a mobile storage device such as a USB flash drive, or a debugging device. Interface, service interface or single board.
  • the user 13 may specifically be an administrator of the device 12, or the user 13 may also be an automated tool of the device 12 in a safe production line, which is used to automatically perform all the operations that the user 13 can perform.
  • the CA server 11 generates a public-private key pair of the device 12 in advance: a private key a and a public key A, and the device 12 obtains the public key A and saves it in a local secure storage area.
  • the authentication process for the device 12 is shown in Fig.
  • the device 12 uses the public key A to verify the certificate X.
  • a successful verification indicates that the authentication of the device 12 is passed, otherwise, a failure of the verification indicates that the authentication of the device 12 has failed. In this way, more secure protection of the authentication device 12 is realized.
  • the CA server 11 is an offline server.
  • S13 may specifically be that the user 13 copies the certificate X'on the CA server 11 through a secure production environment device
  • S14 may specifically be The user 13 configures the certificate X'to the device 12 through the secure production environment device storing the certificate X'; or, S13 and S14 may not be executed by the user 13, but are automatically executed by a secure production line automation tool.
  • the CA server 11 can also be an online server, without the need for the user 13 to transfer the certificate X'through another secure production environment device.
  • the CA server 11 and the device 12 can communicate, and the CA server 11 can Send the certificate X'to the device 12 directly.
  • the local secure storage area of the device in the embodiment of the present application refers to a storage area in the local storage area of the device that cannot be easily accessed or tampered with.
  • the secure storage area can be the one-time programmable memory of the device (English: One-Time Programmable, abbreviated as OTP), and for example: the secure storage area can also be the electrical fuse of the device (English: electrical FUSE, abbreviated as: eFUSE) ), because the content stored in the secure storage area such as OTP or eFUSE cannot be changed, the local secure storage area of the device can store public key 1 and public key 2 reliably and securely.
  • FIG. 3 is a schematic flowchart of an authentication method 100 in an embodiment of this application.
  • the method 100 is applied to a network including device 1 and device 2, where device 1 pre-stores the public key 1 generated by device 2.
  • the method 100 can be executed first.
  • Device 1 performs authentication.
  • the method 100 can be applied to the network shown in FIG. 1, the device 1 can be the device 12, and the device 2 can be the CA server 12.
  • the method 100 may include the following S101 to S106, for example:
  • the device 2 generates a certificate 1, a private key 1, and a public key 1, where the public key 1 corresponds to the private key 1.
  • the device 2 refers to a device that has a function of generating a certificate and a function of digitally signing the certificate.
  • the device 2 may be a CA server corresponding to the manufacturer of the device 1.
  • the device 2 is a safe and reliable device.
  • device 2 when there is an access requirement for device 1 and device 1 needs to be authenticated, device 2 can receive a certificate request message before S101, which is used to apply to device 2 for device 1 correspondence In response to the certificate 1, device 2 executes S101 in response to the certificate request message.
  • the certificate request message received by device 2 may be initiated by a user or a secure production line automation tool to device 2, that is, used to trigger the certificate request message on device 2; as another example, if device 2 It is an online device, that is, device 2 can communicate with device 1, so the certificate request message can also be sent by device 1 to device 2.
  • the certificate request message received by the device 2 can carry the device identification information 1 of the device 1, and the device identification information 1 can be used to uniquely identify the device 1.
  • the device identification information 1 may be a device identification (English: Identification, abbreviation: ID) 1. If device 2 stores locally a device ID list composed of the device IDs of all devices to be authenticated that have the right to issue certificates for authentication, then when device 2 receives the certificate request message carrying device ID1, device 2 can store the device ID according to the local storage. Device ID list, and verify the device ID1.
  • ID International: Identification, abbreviation: ID
  • the device 2 executes S101 to generate a certificate for the device 1 1;
  • the device 2 executes S101 to generate a certificate for the device 1 1;
  • the device 2 does not perform S101 and terminates the authentication of the device 1 with the aid of the device 2 this time.
  • the device identification information 1 may also be a hash value of the device ID1. If device 2 has a device ID hash value list composed of the device ID hash values of all devices to be authenticated for which device 2 has the right to issue certificates for authentication, then when device 2 receives the certificate request message carried When the hash value of device ID1 is used, device 2 can perform matching verification on the hash value of device ID1 according to the locally stored hash value list of device ID.
  • the device 2 executes S101 to generate the certificate 1 for the device 1; otherwise, when the device ID1 is determined
  • the hash value does not belong to the hash value list of the device ID, and the hash value that characterizes the device ID1 does not match the hash value of all device IDs in the hash value list of the device ID. Then, it means that the device 2 does not match.
  • the device 2 does not perform S101 and terminates the authentication of the device 1 with the aid of the device 2 this time.
  • the device ID1 may be an identifier that can uniquely identify the device 1.
  • the device ID1 may be a non-public identifier of the device 1 to the outside world.
  • the device ID1 can be the hardware unique key (English: Hardware Unique Key, abbreviated as HUK) defined when the device 1 leaves the factory; for another example: the device ID1 can also be a unique device identification based on the device 1 (English: Unique Device) Identification (abbreviation: UDI) and the identification obtained by the chip identification (English: die Identification, abbreviation: die ID) in the device 1.
  • the certificate request message received by the device 2 may also carry target valid information, which is used by the device 1 to determine whether the certificate 1 can continue to be used for authentication.
  • the target valid information may specifically be the maximum number of times (for example: 5 times) allowed to use certificate 1 for authentication, or the maximum time (for example: 1 day) allowed to use certificate 1 for authentication, so that device 2 can refer to this
  • the target validity information determines the number of valid uses or duration of the certificate 1 to be generated.
  • device 2 generates its corresponding certificate 1 for device 1 in response to the received certificate request message, and in order to authenticate device 1 through digital signatures, it also generates private key 1 and corresponding public key 1 Key 1.
  • the certificate 1 may include: version number, serial number, signature algorithm identifier, issuer information, validity period, user information, public key information, and extended domain, where the version number is the The version number of the certificate 1; the serial number is the number assigned by the device 2 to the certificate 1, which can uniquely identify the certificate 1.
  • the signature algorithm identifier refers to the algorithm and related parameters that protect the security of the certificate 1.
  • the signature algorithm identifier can Including: Message Digest Algorithm (English: Message-Digest Algorithm, MD5 for short), RSA encryption algorithm and related parameters.
  • the issuer information refers to the device The relevant information of 2, can specifically include the country, state, province, organizational unit, organizational unit, name, and email to which device 2 belongs; the validity period can include the start time and end time; user information refers to the device corresponding to certificate 1 1
  • Relevant information of the user which can specifically include the country, state, province, organizational unit, organizational unit department, name, and email to which the device 1 belongs; public key information refers to the relevant information of the public key 1 that protects the certificate 1
  • it may include: public key 1, the public key encryption algorithm used, and corresponding parameters;
  • the extended field may include one or more data items to be extended, and at least one of the following information may be extended in the extended field: certificate At least one of type, device ID1, hash value
  • Area 2 can also be extended in the extended field of the certificate 1 to store the hash value of device ID1 or device ID1.
  • Area 3 can also be extended in the extended field of the certificate 1 for storing device ID1 or the hash value of the device ID1.
  • the area 4 can also be extended in the extended field of the certificate 1 to store the certificate ID1 that can uniquely identify the certificate 1.
  • the device 2 generates a certificate 1, a public key 1 and a private key 1 for the device 1 to be authenticated, which provides a reliable data basis for the subsequent digital signature of the certificate 1 and the authentication of the device 1.
  • the device 2 uses the private key 1 to digitally sign the certificate 1, and obtains the signature 1 of the certificate 1.
  • the process of device 2 digitally signing certificate 1 may specifically include: S21, device 2 uses hash algorithm 1 to hash certificate 1, and the hash value obtained from the hash calculation is recorded as the value of certificate 1. Digital digest 1; S22, the device 2 uses the private key 1 to encrypt the digital digest 1, and the encrypted value is recorded as the signature 1 of the certificate 1.
  • S104 The device 1 obtains the certificate 1 that uses the private key 1 for digital signature.
  • device 2 can send certificate 1 and signature 1 to device 1 based on the established communication connection.
  • device 2 is offline relative to device 1, that is, there is no communication connection between device 2 and device 1, then device 2 sends certificate 1 and signature to device 1 1. It can also be: the user or a secure production line automation tool first copies the certificate 1 and signature 1 from the device 2, and then configures the certificate 1 and signature 1 on the device 1.
  • certificate 1 and signature 1 in S103 can be combined and sent to device 1 in the above-mentioned manner.
  • the certificate 1 and the signature 1 shown in FIG. 4b can also be regarded as the "certificate 1 for digital signature using the private key 1" in S104.
  • the device 1 obtains the certificate 1 that uses the private key 1 for digital signature, which makes it possible to authenticate the device 1 subsequently.
  • S105 The device 1 verifies the certificate 1, and obtains a verification result 1.
  • device 1 Before S105, device 1 locally pre-stores public key 1. If device 2 is online relative to device 1, then device 2 can directly send public key 1 to device 1, and device 1 stores the received public key 1 in Local secure storage space. Or, if the device 2 is offline relative to the device 1, then the user first obtains the public key 1 from the device 2, and then configures the public key 1 to the local secure storage space of the device 1.
  • S105 may specifically include: the device 1 verifies the certificate 1 according to the public key 1 stored locally.
  • the process of device 1 verifying certificate 1 according to locally stored public key 1 may specifically include: S31, device 1 uses public key 1 to decrypt signature 1, and the decrypted value is recorded as digital digest 2 ; S32, device 1 uses hash algorithm 1 to hash the certificate 1, and the hash value obtained by the hash calculation is recorded as the digital digest 3 of the certificate 1; S33, the device 1 compares the digital digest 2 and the digital digest 3, and obtains Comparing results.
  • the device 1 only verifies the certificate 1 with the public key 1, the above comparison result is the verification result 1.
  • the verification result 1 indicates that the device 1 has passed the verification of the certificate 1; otherwise, if the comparison result indicates that the digital digest 2 and the digital digest 3 are not the same, then it is determined that the certificate 1 is illegal and/or incomplete, then , The verification result 1 indicates that the verification of the certificate 1 by the device 1 has not passed.
  • the certificate 1 may include the certificate type. Specifically, it may be in the extension field of the certificate 1 to extend a field for storing the certificate type, and the value of the field is used to indicate the certificate type of the certificate 1. Then, S105 may also include: verifying the certificate type in the certificate 1. In specific implementation, it is judged whether the certificate type is an authentication certificate, and the judgment result is obtained. If the judgment result 1 indicates that the certificate type of certificate 1 is an authentication certificate, it can be determined that the certificate 1 can be used to authenticate the device 1, otherwise If the judgment result indicates that the certificate type of the certificate 1 is not an authentication certificate, it can be determined that the certificate 1 cannot be used to authenticate the device 1.
  • S105 may specifically include: S41, obtaining a comparison result according to the above S31 to S33; S42, judging whether the certificate type is an authentication certificate, and obtaining the judgment result; S43, determining the verification result 1 according to the comparison result and the judgment result, Among them, if the comparison result indicates that the digital digest 2 and the digital digest 3 are the same, and the judgment result indicates that the certificate type of the certificate 1 is an authentication certificate, then the verification result 1 indicates that the device 1 has passed the verification of the certificate 1; otherwise, the verification result 1 indicates The verification of certificate 1 by device 1 failed.
  • the certificate 1 may also include the device identification information 1 of the device 1 to which the certificate 1 applies.
  • the device identification information 1 is the device ID1 or the hash value of the device ID1.
  • the extended field of certificate 1 the field used to store the device ID1 or the hash value of the device ID1 is extended.
  • S105 may also include: based on the device ID2 of the device 1 stored locally, perform matching verification on the device ID1 carried in the certificate 1 to obtain the matching result 1, where the The device ID2 is used to uniquely identify the device 1.
  • S105 may also include: hashing the device ID1 carried in the certificate 1 based on the hash value of the device ID2 of the device 1 stored locally The value is matched and verified, and the matching result 2 is obtained. If the matching result 2 indicates that the hash value of the device ID1 is the same as the hash value of the device ID2, it can be determined that the certificate 1 was issued for authenticating the device 1, otherwise, it can be determined that the certificate 1 is for the device 1. Issued for authentication.
  • S105 may also include: based on the device ID2 of the device 1 stored locally, perform matching verification on the device ID1 carried in the certificate 1 , Obtain the matching result 3; based on the locally stored hash value of the device ID2 of the device 1, perform matching verification on the hash value of the device ID1 carried in the certificate 1, and obtain the matching result 4. If the matching result 3 indicates that the device ID1 and the device ID2 are the same, and the matching result 4 indicates that the hash value of the device ID1 is the same as the hash value of the device ID2, it can be determined that the certificate 1 was issued to authenticate the device 1. Otherwise, it can be determined that the certificate 1 was issued to authenticate the device 1.
  • the device ID2 is the hardware unique key HUK defined when the device 1 leaves the factory, or the device ID2 is obtained by processing the die ID of the device 1 and the unique device identifier UDI.
  • S105 may specifically include: S51, obtaining the comparison result according to the above S31 to S33; S52, device 1 Based on the locally stored device ID2 (or the hash value of the device ID2), perform matching verification on the device ID1 (or the hash value of the device ID1) carried in the certificate 1 to obtain the matching result; S53, determine according to the comparison result and the matching result Verification result 1.
  • the verification result 1 characterizes that the verification of the certificate 1 by the device 1 is passed; otherwise, the verification result 1 indicates that the verification of the certificate 1 by the device 1 is not passed.
  • S105 may specifically include: S51, obtaining the comparison result according to the above S31-S33; S52, the device 1 is based on local storage The device ID2 (or the hash value of the device ID2) of the device ID2 (or the hash value of the device ID2), the device ID1 (or the hash value of the device ID1) carried in the certificate 1 is matched and verified, and the matching result is obtained; S53, judge whether the certificate type is an authentication certificate, and obtain Judgment result; S54, according to the comparison result, the matching result and the judgment result, the verification result 1 is determined, where, if the comparison result indicates that the digital digest 2 and the digital digest 3 are the same, the matching result indicates that the device ID1 and the device ID2 are the same (or the Ha The value is the same as the hash value of the device ID2), and the judgment result indicates that the certificate 1 is an authentication certificate, then the verification result 1
  • the certificate 1 may also include the certificate ID1 of the certificate 1, specifically, it may be in the extension field of the certificate 1 to extend the field for storing the certificate ID1. Then, S105 may also include: performing matching verification on the certificate ID1 according to the locally stored certificate ID2.
  • the certificate 1 is a one-time certificate, that is, the certificate 1 can only authenticate the device 1 once. In order to ensure that each certificate downloaded to the device 1 can only be used effectively once, then the device 1 can save the certificate ID of all the certificates 1 it has used. Then, after receiving the certificate 1, the device 1 can determine whether the certificate ID1 corresponding to the certificate 1 matches the locally stored certificate ID2. If they match, it means that the certificate 1 has been used on the device 1, that is, the certificate 1 If it has expired, the certificate 1 can no longer be used to authenticate the device 1; otherwise, if it does not match, it means that the certificate 1 is downloaded to the device 1 for the first time, and the certificate 1 can be used to authenticate the device 1.
  • certificate 1 is not a one-time certificate
  • the target validity information extended in certificate 1 can be combined to determine whether certificate 1 can continue to authenticate device 1.
  • the target validity information extended in certificate 1 can be combined to determine whether certificate 1 can continue to authenticate device 1.
  • the certificate 1 may also include target valid information.
  • the target valid information is the maximum number of times the certificate 1 is allowed to be authenticated, or the maximum number of times the first certificate is allowed to be used for authentication. time.
  • S105 may also include: verifying the effective information of the target according to the actual use information.
  • the actual use information is used to characterize the current use of certificate 1 on device 1.
  • the target effective information is the maximum number of times that certificate 1 is allowed to be used for authentication
  • the actual use information is that device 1 is currently using certificate 1 for authentication.
  • the target valid information is the maximum time allowed to use certificate 1 for authentication, then the actual usage information is the actual usage time from the timing start time of the target valid information to the current moment.
  • certificate 1 includes certificate ID1 and target valid information.
  • device 1 checks that the certificate ID1 corresponding to certificate 1 has not been saved on device 1, and device 1 stores the certificate ID1 reaches the local of device 1, and triggers the start of recording the actual effective information, that is, the recording of the number of uses of the certificate ID1 corresponding to the certificate 1 as 1 or the triggering of the start of recording the actual use time.
  • the S105 may include: S61, the device 1 checks whether the locally stored certificate ID1 and the certificate ID1 carried in the certificate 1 are consistent, if they are the same, execute S62, otherwise, execute S64; S62: Determine whether the actual use times of the certificate 1 corresponding to the certificate ID1 reaches the target effective information (that is, the maximum allowable times), or determine whether the actual use time of the certificate 1 corresponding to the certificate ID1 reaches the target effective information (that is, the maximum Long time allowed), if not reached, perform S63, otherwise, perform S64; S63, determine that the certificate 1 is still valid, can continue to use the certificate 1 to authenticate the device 1, and if the target effective information is the number of times, then Update the actual use times (that is, add one to the actual use times); S64, it is determined that the certificate 1 is invalid, and the device 1 is not authenticated based on the certificate 1.
  • the verification result 1 can also be obtained through corresponding verification, for example: judging that the device 1 is locally stored If the device ID2 of the device ID2 is consistent with the device ID1, another example is to determine whether the hash value of the device ID2 stored locally in the device 1 is consistent with the hash value of the device ID1, and another example is to verify whether the certificate type of the certificate 1 is an authentication certificate.
  • the security of the certificate will decrease as it is used. Then, setting the target valid information of the certificate can limit the valid use time or frequency of the certificate, and ensure that the certificate can be revoked when the certificate is not sufficiently safe to avoid the certificate being used too many times or too long. , The device can still be authenticated after the security is reduced, resulting in a decrease in the authentication effect, and the effect of protecting the security of the device 1 is greatly reduced.
  • the certificate 1 also includes the public key 2.
  • S105 may specifically further include: verifying the public key 2 in the certificate 1 according to the locally stored public key 1.
  • the public key 2 is the public key 1 that digitally signs the certificate 1.
  • the device 1 can determine that the public key 2 is the same as the locally stored public key 1, and then the device 1 can be executed based on the certificate 1. Authentication.
  • the device 2 can also generate a new private key 2 and the corresponding private key 2 Public key 2 is carried in certificate 1 and sent to device 1.
  • device 1 determines that the locally stored public key 1 is inconsistent with the public key 2 carried in certificate 1, in order not to affect the follow-up To authenticate the device 1, replace the locally stored public key 1 with the public key 2.
  • the certificate 1 can be digitally signed with the private key 2 to obtain the signature 2, and send the signature 2 and the certificate 1 to the device 1, and the device 1 can use the locally stored public key 2 to pair the certificate 1 Perform verification and obtain verification result 1.
  • the device 1 determines the use right of the device 1 according to the verification result 1.
  • the verification result 1 can be obtained through S105.
  • the verification result 1 can indicate that the device 1 has passed the verification of the certificate 1. Then, the device 1 can open the use right of the device 1 based on the verification result 1. .
  • the verification result 1 may indicate that the verification of the certificate 1 by the device 1 is not passed. Then, the device 1 may determine that the use right of the device 1 is not allowed based on the verification result 1.
  • Device 1 can be a network device or a single board. Taking device 1 as a network device as an example, as an example, when the verification result 1 indicates that the network device passes the verification of certificate 1, the network device opens the use rights of all interfaces on it; Or, when the verification result 1 indicates that the verification of the certificate 1 by the network device fails, the network device does not open the use right of any interface on it.
  • the certificate 1 may also carry the authentication scope in its extended domain, for example: authentication interface ID.
  • the network device can use the authentication Open the corresponding usage rights of the scope, for example: open the usage rights of the authentication interface corresponding to the authentication interface ID; or, when the verification result 1 indicates that the network device fails to verify the certificate 1, the network device does not open any of them Permission to use the interface.
  • Device 1 can also refer to the debugging interface or service interface on a certain device.
  • the verification result 1 indicates that the debugging interface or service interface has passed the verification of certificate 1, then the device can open the corresponding debugging interface or service interface on it. Permission to use.
  • the verification result 1 indicates that the debugging interface or the service interface fails to verify the certificate 1, then the device may not open the use right of the debugging interface or the service interface.
  • the certificate 1 is digitally signed by the device 2 with the certificate issuance function and the digital signature function and the higher security level, and the device 1 to be authenticated is used to digitally sign the certificate. 1. Perform verification to realize the authentication of the device 1 to be authenticated, which overcomes the current security risks that exist when the device 1 is protected by means of codebooks or exposed pads of the interface, and the certificate issued by the device 1 with a high security level 1 and digital signature technology to ensure that the protection of the device 1 to be authenticated is more secure and reliable.
  • the device 12 is a switch 12, and the public key 3 and the HUK 12 of the switch are stored on the switch 12.
  • the CA server 11 stores a list of device ID hash values composed of the device ID hash values of all devices to be authenticated that are responsible for issuing certificates for authentication.
  • the authentication process of the method 200 in this embodiment may include, for example:
  • the user 13 submits a certificate request message on the CA server.
  • the certificate request message carries the hash value of HUK 12, the maximum number of authentication times, and the authentication range.
  • the authentication range is used to indicate the debugging interface 1 and the debugging interface 2 on the switch 12.
  • the user 13 may also be a safe production line automation equipment, which automatically performs all operations performed by the user 13.
  • the CA server 11 judges whether the hash value of HUK 12 is in the list of hash values of the device ID stored locally, if not, execute S203, otherwise, execute the following S204 to S215.
  • the CA server 11 displays prompt information to the user 13, and the prompt information is used to inform the user 13 that the CA server 11 is not responsible for the authentication of the switch 12.
  • the CA server 11 generates a certificate 12, and uses the private key 3 to digitally sign the certificate 12 to obtain a signature 12.
  • the certificate 12 is shown in Fig. 4a, and the certificate 12 and its corresponding signature 12 are shown in Fig. 4b.
  • the public key information in the certificate 12 includes the public key 3', and the extended field includes: the hash value of HUK 12, the certificate ID12, the maximum number of authentication times-5 times, the interface ID1 of the authentication interface 1, and the authentication interface 2 interface ID2.
  • S205 The user 13 obtains the certificate 12 and the signature 12 from the CA server 11 through the storage device.
  • S206 The user 13 configures the certificate 12 and the signature 12 on the switch 12 through the storage device.
  • the switch 12 verifies the locally stored public key 3 to verify the signature 12. If the verification is passed, S208 is executed, otherwise, S216 is executed.
  • S208 The switch 12 verifies whether the certificate type in the certificate 12 is an authentication certificate, and if so, executes S209, otherwise, executes S216.
  • S209 The switch 12 verifies whether the locally stored public key 3 and the public key 3'stored in the certificate 12 are consistent, if they are consistent, execute S210, otherwise, execute S216.
  • S210 The switch 12 verifies whether the version number, serial number, signature algorithm identifier, issuer information, validity period, user information, etc. in the certificate 12 are valid, if valid, execute S211, otherwise, execute S216.
  • the switch 12 records the certificate ID 12 locally, and records the actual number of uses as 0.
  • S213 The switch 12 judges whether the hash value of HUK 12 stored locally in the switch 12 is consistent with the hash value of HUK 12 carried in the certificate 12, if they are consistent, execute S214, otherwise, execute S216.
  • S214 The switch 12 judges whether the actual number of times of use reaches 5 times, and if not, executes S215, otherwise, executes S216.
  • S215 The switch 12 opens the debugging interface 1 and the debugging interface 2, and adds 1 to the actual number of times of use.
  • S216 The switch 12 determines to suspend the authentication process, and reports an authentication error to the CA server 11.
  • the CA server 11 a device with a higher security level, implements the management of the switch 12's own usage rights based on the certificate 12 issued by it and the signature 12 obtained after digitally signing the certificate 12.
  • the switch 12 is more securely protected.
  • FIG. 6 shows a schematic flowchart of an authentication method 300 in an embodiment of the present application.
  • the method 300 is applied in a scenario that includes a first device and a second device, and the first device is the execution subject.
  • the authentication method 300 For example, it can include:
  • S303 Determine the use right of the first device according to the first verification result.
  • the first device can be device 1 in method 100, then the second device is device 2 in method 100, the first private key is private key 1 in method 100, and the first public key is public key in method 100.
  • Key 1 the first certificate is certificate 1 in method 100, and the first verification result is verification result 1 in method 100.
  • the first device may also be the switch 12 in the method 200.
  • the second device is the CA server 11 in the method 200, the first private key is the private key 3 in the method 200, and the first public key is the switch 12 in the method 200.
  • the public key 3, the first certificate is the certificate 12 in the method 200.
  • the first device may be any device to be authenticated, for example, it may refer to a network device or a single board, or for another example, it may also refer to a debugging interface or a service interface on the device.
  • the second device may refer to an authentication server with a higher security level and a certificate issuance function and a digital signature function, for example, a CA server.
  • the first device refers to the debugging interface and the second device is the CA server
  • the certificate issued and digitally signed by the CA server is issued to the device where the debugging interface is located and verified, the device where the debugging interface is located opens the debugging interface's use authority , For accessing and using the debugging interface.
  • that the first device verifies the first certificate may specifically include: the first device verifies the first certificate according to the locally stored first public key corresponding to the first private key. In this way, the certificate is verified by the public key stored locally in the first device, and reliable and safe authentication of the first device is realized.
  • the first certificate may include a certificate type
  • S302 may further include: verifying the certificate type.
  • verifying the certificate type if a field used to indicate the certificate type of the first certificate is extended in the extended field of the first certificate, the first device can read this field, and when it is determined that the field indicates that the first certificate is an authentication certificate, The first verification result may indicate that the verification of the first certificate is passed. In this way, the first device can also implement reliable and safe authentication of the first device by verifying the certificate type of the received first certificate.
  • the first certificate may also include the first device identification information
  • S302 may also include: based on the locally stored second device identification information of the first device, the information carried in the first certificate The first device identification information is matched and verified, wherein the second device identification information is used to uniquely identify the first device.
  • the first device identification information may be the first device identification
  • S302 may further include: the first device based on the locally stored second device ID of the first device, the first device ID carried in the first certificate Perform matching verification, where the second device ID is used to uniquely identify the first device.
  • the first device identification information may also be a hash value of the first device ID.
  • S302 may also include: the first device based on the locally stored second device ID of the first device
  • the hash value is used to perform matching verification on the hash value of the first device ID carried in the first certificate, where the second device ID is used to uniquely identify the first device.
  • the first certificate may extend a field used to carry the first device ID or the hash value of the first device ID in its extension field. In this way, through the second device ID or the hash value of the second device ID stored locally in the first device, the first device ID or the hash value of the first device ID carried in the first certificate is verified, and the first device ID is verified. Reliable and safe authentication of equipment. For example: the
  • the device ID in the embodiment of the present application is a non-public ID that can uniquely identify the device, for example: the second device ID is the hardware unique key HUK defined when the first device leaves the factory.
  • the second device ID is obtained by processing the die ID of the first device and the unique device identifier UDI.
  • the first certificate may further include the first certificate identification ID
  • S302 may further include: the first device performs matching verification on the first certificate ID according to the locally stored second certificate ID.
  • the first certificate may extend the field used to carry the first certificate ID in its extension field. In this way, the first certificate ID carried in the first certificate is verified through the second certificate ID stored locally by the first device, so that reliable and safe authentication of the first device is realized.
  • the first device when the first device has not used the first certificate for authentication, the first device does not store the certificate ID of the first certificate locally. In this case, when the first device determines that the first device has not stored the first certificate locally, A certificate ID, that is, it is considered that the matching verification of the first certificate ID is passed, and the first certificate can be used for authentication.
  • the first device when the first device has used the first certificate for authentication, then the first device locally stores the second certificate ID of the first certificate. In this case, when the first device determines to store locally The second certificate ID matches the first certificate ID in the first certificate, that is, it is considered that the matching verification of the first certificate ID is passed, and the first certificate can be used for authentication.
  • the first device when the first device has used the first certificate for authentication, the first device locally stores the second certificate ID of the first certificate, but because the number of times the first certificate has been used exceeds the upper limit or The usage time exceeds the upper limit, and the second certificate ID is marked as invalid.
  • the first device determines that the locally stored second certificate ID matches the first certificate ID in the first certificate, but the status of the second certificate ID is If it is invalid, it is considered that the matching verification of the first certificate ID has not passed, and the first certificate can no longer be used to authenticate the first device.
  • the first certificate may also include target validity information, which is used by the device 1 to determine whether the certificate 1 can continue to be used for authentication.
  • S302 may further include: the first device verifies the target valid information according to actual usage information, where the actual usage information is used to characterize the current use of the first certificate on the first device.
  • the target effective information is the maximum number of times allowed to use the first certificate for authentication (for example: 5 times), then the actual use information is the actual number of times the first device has used the first certificate for authentication so far; or
  • the target valid information is the maximum time allowed to use the first certificate for authentication (for example: 20 hours), then the actual usage information is the actual usage time from the timing start time of the target valid information to the current moment.
  • the first certificate may extend the field used to carry the effective information of the target in its extension field. It is understandable that when the first device determines that the actual usage information stored locally reaches the target valid information of the first certificate, the first device may revoke the first certificate, for example, the first certificate stored locally by the first device The corresponding second certificate ID is marked as invalid. In this way, the effective information of the target carried in the first certificate is verified through the actual use information stored locally by the first device, so that reliable and safe authentication of the first device is realized.
  • the first certificate may further include a second public key
  • S302 may further include: the first device verifies the second public key according to the first public key stored locally. If the first device determines that the first public key and the second public key are inconsistent, the first device regards it as the second device and needs to update the first public key and the first private key that are not sufficiently secure. Then, the embodiment of this application also It may include: the first device replaces the locally stored first public key with the second public key. In this way, through the first public key stored locally in the first device, the second public key carried in the first certificate is verified, and when the public keys are consistent, the first device is guided to manage its usage rights, so as to realize the reliability of the first device. And secure authentication; when the public key is inconsistent, guide the first device to update the locally stored public key, complete the update of the authentication public and private key by the second device, so that subsequent authentication of the first device is more secure.
  • the second public key may be public key 2 in method 100.
  • FIG. 7 shows a schematic flowchart of a method 400 for authenticating the use right of a first device in an embodiment of the present application.
  • the method 400 is applied in a scenario that includes a first device and a second device.
  • the method 400 may include, for example:
  • S402 Send a first certificate digitally signed with the first private key to the first device, so that the first device determines the use right of the first device based on the first certificate.
  • the first device may be any device to be authenticated, such as a debugging interface, and the second device may be an authentication server.
  • the second device can be device 2 in method 100, then the first device is device 1 in method 100, the first private key is private key 1 in method 100, and the first public key is public key in method 100.
  • Key 1 the first certificate is certificate 1 in method 100.
  • the second device may also be the CA server 11 in the method 200.
  • the first device is the switch 12 in the method 200, the first private key is the private key 3 in the method 200, and the first public key is the CA server 11 in the method 200.
  • the first certificate is digitally signed by a second device with a certificate issuance function and a digital signature function and a higher security level, and the digitally signed first certificate is sent to the first device to be authenticated.
  • the first device verifies the first certificate after the digital signature to realize the authentication of the first device to be authenticated, which overcomes the current problem of protecting the security of the first device by means of a codebook or exposed pads corresponding to the interface.
  • the certificate issued by the second device with a high security level and digital signature technology ensure that the protection of the first device to be authenticated is more secure and reliable.
  • the first certificate may further include first device identification information, and the first device identification information is used for identity verification by the first device.
  • the first device identification information may be the first device ID or the hash value of the first device ID.
  • the method 400 may further include: the second device receives a certificate request message, the certificate request message includes the first device identification ID; the second device performs matching verification on the first device ID according to the locally stored second device ID .
  • the method 400 may further include: the second device receives a certificate request message, the certificate request message includes a hash value of the first device identification ID; the second device according to the hash value of the locally stored second device ID Value to perform matching verification on the hash value of the first device ID.
  • the second device may also carry the first device ID or the hash value of the first device ID in the first certificate and send it to the first device.
  • the second device verifies the first device ID or the hash value of the first device ID carried in the certificate request message through the locally stored second device ID or the hash value of the second device ID, and guides the second device Whether to issue the first certificate to the first device, so that the authentication of the first device is more reliable and safer.
  • the device ID in the embodiment of this application is a non-public ID that can uniquely identify the device, for example: the first device ID is the hardware unique key HUK defined when the first device leaves the factory, and for example: the first device ID is based on the first device ID
  • the chip ID of a device is processed by die ID and the unique device ID UDI.
  • the first certificate may also include target valid information, and the target valid information is used by the first device to determine whether the first certificate can continue to be used for authentication.
  • the target valid information may specifically be the maximum number of times allowed to use the first certificate for authentication, or the target valid information may also be the maximum time allowed to use the first certificate for authentication.
  • the embodiment of the present application may further include: the second device receives a certificate request message, and the certificate request message may also include target validity information.
  • the first certificate may also carry at least one of the certificate type, the first device identification information, and the first certificate ID.
  • the specific content carried in the first certificate and the corresponding verification method of the first device to the first certificate please refer to the relevant description of the method 300.
  • an embodiment of the present application also provides a first device 800, as shown in FIG. 8.
  • the first device 800 includes a transceiver unit 801 and a processing unit 802.
  • the transceiving unit 801 is configured to perform the transceiving operation performed by the device 1 in the embodiment shown in FIG. 3, or the transceiving operation performed by the switch 12 in the embodiment shown in FIG. 5, or the first device in the method embodiment shown in FIG. Transceiving operations performed;
  • the processing unit 802 is used to perform other operations other than the transceiving operations performed by the device 1 in the embodiment shown in FIG. 3, or other operations performed by the switch 12 in the embodiment shown in FIG. 5 other than the transceiving operations , Or other operations performed by the first device in the method embodiment shown in FIG.
  • the first device 800 is the device 1 in the method 100, then the transceiving unit 801 is used to execute the certificate 1 and the signature 1; the processing unit 802 is used to verify the certificate 1 to obtain the verification result 1; The processing unit 802 is further configured to determine the use right of the device 1 according to the verification result 1.
  • an embodiment of the present application also provides a second device 900, as shown in FIG. 9.
  • the second device 900 includes a transceiver unit 901 and a processing unit 902.
  • the transceiving unit 901 is configured to perform the transceiving operation performed by the device 2 in the embodiment shown in FIG. 3, or the transceiving operation performed by the CA server 11 in the embodiment shown in FIG. 5, or the second method in the method embodiment shown in FIG. Transceiving operations performed by the device;
  • the processing unit 902 is configured to perform operations other than the transceiving operations performed by the device 2 in the embodiment shown in FIG. 3, or other operations performed by the CA server 11 in the embodiment shown in FIG.
  • the second device 900 is the device 2 in the method 100, then the transceiving unit 901 is used to send the certificate 1 digitally signed by the private key 1 to the device 1; the processing unit 902 is used to use the private key 1 to pair the certificate 1 Perform a digital signature.
  • an embodiment of the present application also provides a first device 1000, as shown in FIG. 10.
  • the first device 1000 includes a communication interface 1001 and a processor 1002 connected to the communication interface 1001.
  • the communication interface 1001 is used to perform the transceiving operation performed by the device 1 in the embodiment shown in FIG. 3, or the transceiving operation performed by the switch 12 in the embodiment shown in FIG. 5, or the first method in the method embodiment shown in FIG. Transceiving operations performed by a device;
  • the processor 1002 is configured to perform operations other than the transceiving operations performed by the device 1 in the embodiment shown in FIG. 3, or other operations performed by the switch 12 in the embodiment shown in FIG.
  • the first device 1000 is the device 1 in the method 100, then the communication interface 1001 is used to obtain the certificate 1 and the signature 1; the processor 1002 is used to verify the certificate 1 to obtain the verification result 1; the processing The device 1002 is also used to determine the use authority of the device 1 according to the verification result 1.
  • an embodiment of the present application also provides a second device 1100, as shown in FIG. 11.
  • the second device 1100 includes a communication interface 1101 and a processor 1102 connected to the communication interface 1101.
  • the communication interface 1101 is used to perform the receiving and sending operations performed by the device 2 in the embodiment shown in FIG. 3, or the receiving and sending operations performed by the CA server 11 in the embodiment shown in FIG. 5, or the second method in the method embodiment shown in FIG. Transceiving operations performed by the device;
  • the processor 1102 is configured to perform operations other than the transceiving operations performed by the device 2 in the embodiment shown in FIG. 3, or other operations performed by the CA server 11 in the embodiment shown in FIG.
  • the second device 1100 is the device 2 in the method 100, then the communication interface 1101 is used to send the certificate 1 digitally signed by the private key 1 to the device 1; the processor 1102 is used to use the private key 1 to pair the certificate 1 Perform a digital signature.
  • an embodiment of the present application also provides a first device 1200, as shown in FIG. 12.
  • the first device 1200 includes a memory 1201 and a processor 1202.
  • the memory 1201 is used to store program code; the processor 1202 is used to run instructions in the program code, so that the first device 1200 executes the method executed by the device 1 in the embodiment shown in FIG. 3, or as shown in FIG. The method executed by the switch 12 in the embodiment or the method executed by the first device in the method embodiment shown in FIG. 6.
  • an embodiment of the present application also provides a second device 1300, as shown in FIG. 13.
  • the second device 1300 includes a memory 1301 and a processor 1302.
  • the memory 1301 is used to store program code; the processor 1302 is used to run instructions in the program code, so that the second device 1300 executes the method executed by the device 2 in the embodiment shown in FIG. 3, or as shown in FIG. 5
  • the processor may be a central processing unit (English: central processing unit, abbreviation: CPU), a network processor (English: network processor, abbreviation: NP), or a combination of CPU and NP.
  • the processor may also be an application-specific integrated circuit (English: application-specific integrated circuit, abbreviation: ASIC), a programmable logic device (English: programmable logic device, abbreviation: PLD) or a combination thereof.
  • the above-mentioned PLD can be a complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD), field programmable logic gate array (English: field-programmable gate array, abbreviation: FPGA), general array logic (English: generic array) logic, abbreviation: GAL) or any combination thereof.
  • the processor may refer to one processor or may include multiple processors.
  • the memory may include volatile memory (English: volatile memory), such as random access memory (English: random-access memory, abbreviation: RAM); the memory may also include non-volatile memory (English: non-volatile memory), For example, read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English: solid-state drive, Abbreviation: SSD); the memory can also include a combination of the above-mentioned types of memory.
  • the memory may refer to one memory, or may include multiple memories.
  • computer-readable instructions are stored in the memory, and the computer-readable instructions include multiple software modules, such as a sending module, a processing module, and a receiving module. After executing each software module, the processor can perform corresponding operations according to the instructions of each software module. In this embodiment, an operation performed by a software module actually refers to an operation performed by the processor according to an instruction of the software module. After the processor executes the computer-readable instructions in the memory, it can execute all operations that can be executed by the first device or the second device according to the instructions of the computer-readable instructions.
  • the communication interface 1001 of the first device 1000 can be specifically used as the transceiver unit 801 in the first device 800 to implement data communication between the first device and the second device.
  • the communication interface 1101 of the second device 1100 can be specifically used as the transceiver unit 901 in the second device 900 to implement data communication between the first device and the second device.
  • an embodiment of the present application also provides a communication system 1400, as shown in FIG. 14.
  • the communication system 1400 includes a first device 1401 and a second device 1402.
  • the first device 1401 may specifically be the above-mentioned first device 800, the first device 1000 or the first device 1200, and the second device 1402 may specifically be the above-mentioned second device.
  • embodiments of the present application also provide a computer-readable storage medium that stores instructions in the computer-readable storage medium, which when run on a computer, causes the computer to execute the above figures 3, 5 and 7 The authentication method in the illustrated embodiment.
  • the embodiment of the present application also provides a computer program product, which when it runs on a computer, causes the computer to execute the authentication method in the embodiments shown in FIGS. 3 and 5-7.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Storage Device Security (AREA)

Abstract

本申请实施例公开了一种鉴权方法和设备,由CA服务器等具有证书颁发功能的第二设备,为待鉴权的第一设备生成第一证书,并基于第一私钥对该第一证书进行数字签名,第一设备获取到该数字签名后的第一证书后,对该数字签名后的证书进行验证,获得第一验证结果,并基于该第一验证结果对该第一设备的使用权限进行鉴权。这样,通过具有证书颁发功能和数字签名功能、安全等级较高的第二设备通过数字签名后的第一证书,实现对待鉴权的第一设备的鉴权,克服了目前通过密码本等方式保护第一设备安全时存在的安全隐患,确保对第一设备的访问和使用更加安全和可靠。

Description

鉴权方法和设备
本申请要求于2019年12月26日提交中国国家知识产权局、申请号为201911370614.8、申请名称为“鉴权方法和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及安全通信技术领域,特别是涉及一种鉴权方法和设备,该方法用于有开通设备或设备上接口的使用权限的需求时,对该设备或设备上接口的鉴权。
背景技术
设备上会存储很多信息,有的信息对于设备的生产商或者使用者非常重要。目前,通常采用密码本的方式对设备进行鉴权,以确保设备以及其上信息的安全。具体而言,密码本上保存着多个密码,在设备上预置一个或多个密码,当有开放该设备的使用权限的需求时,由指定人员(如:调试人员、运维人员、生产人员等)将密码本中的密码输入到设备中,和设备中预置的密码进行匹配,匹配成功时,视作该设备鉴权通过,该设备开放匹配成功的密码对应的使用权限,从而可以通过设备上已开放的使用权限访问对应的重要信息。
但是,由于密码本的存储、传输和匹配均采用的是明文,而且,人为管理密码本非常容易泄露密码本中的密码,可见,采用该密码本对设备进行鉴权,安全性较低。基于此,亟待提供一种安全等级更高的鉴权方式,确保设备在安全的情况下被开放使用权限,从而保障其上信息的安全。
发明内容
基于此,本申请实施例提供了一种鉴权方法和设备、以及对第一设备的使用权限进行鉴权的方法和设备,通过安全等级较高的证书颁发机构(英文:Certificate Authority,简称:CA)服务器等设备对证书进行数字签名并由待鉴权的设备对该具有签名的证书进行完整性验证的方式,实现对待鉴权的设备更为安全的鉴权。
第一方面,提供了一种鉴权方法,应用在包括第一设备和第二设备的场景中,以第一设备为执行主体,该鉴权方法例如可以包括:第一设备从第二设备获取采用第一私钥进行数字签名的第一证书,即可对该第一证书进行验证,获得第一验证结果,那么,第一设备就可以根据该第一验证结果,确定第一设备的使用权限。具体而言,当第一验证结果表示验证通过,则第一设备开放对应的使用权限,当第一验证结果表示验证未通过,则第一设备不开放对应的使用权限。这样,通过具有证书颁发功能和数字签名功能、安全等级较高的第二设备对第一证书进行数字签名,并由待鉴权的第一设备对该数字签名后的第一证书进行验证,实现对待鉴权的第一设备的鉴权,克服了目前通过密码本或者接口对应焊盘裸露的等方式保护第一设备安全时存在的安全隐患,通过高安全等级的第二设备颁发的证书以及数字签名技术,确保了对待鉴权的第一设备的保护更加安全和可靠。
其中,第一设备可以是待鉴权的任何设备,例如:可以指网络设备或单板,又例如: 也可以指设备上的调试接口或业务接口。第二设备可以是指安全等级较高,且具有证书颁发功能和数字签名功能的鉴权服务器,例如:证书颁发机构(英文:Certificate Authority,简称:CA)服务器。当第一设备指调试接口,第二设备是CA服务器时,CA服务器颁发且通过数字签名后的证书下发到调试接口所在设备并验证通过后,该调试接口所在设备开放该调试接口的使用权限,供访问和使用该调试接口。
可选地,第一设备对第一证书进行验证,具体可以包括:第一设备根据本地存储的与第一私钥对应的第一公钥,对第一证书进行验证。具体包括对第一证书的完整性验证和合法性验证两部分,第一设备接收到的是第一证书以及第一证书的签名,第一设备可以通过第一公钥对所接收到的签名进行解密,获得第一摘要,第一设备也可以计算所接收的第一证书的哈希值,记作该第一证书的第二摘要,第一设备通过第一摘要和第二摘要的匹配验证,确定第一证书的第一验证结果,当第一摘要和第二摘要匹配,则,第一验证结果表征对第一证书的验证通过;当第一摘要和第二摘要不匹配,则,第一验证结果表征对第一证书的验证未通过。这样,通过第一设备本地存储的公钥对证书进行验证,指导第一设备对其使用权限的管理,实现对第一设备可靠和安全的鉴权。
可选地,该第一证书中可以包括证书类型,第一设备对第一证书进行验证,还可以包括:验证所述证书类型。其中,第一证书的扩展域中如果扩展了用于指示该第一证书的证书类型的字段,那么,第一设备可以读取该字段,当确定该字段指示该第一证书为鉴权证书,第一验证结果可以表征对第一证书的验证通过;否则,当确定该字段指示该第一证书不是鉴权证书,第一验证结果可以表征对第一证书的验证未通过。这样,第一设备还可以通过对所接收的第一证书的证书类型的验证,指导该第一设备对其使用权限的管理,实现对第一设备可靠和安全的鉴权。
可选地,该第一证书中还可以包括第一设备标识信息,那么,对第一证书进行验证还可以包括:基于本地存储的所述第一设备的第二设备标识信息,对所述第一证书携带的所述第一设备标识信息进行匹配验证,其中,所述第二设备标识信息用于唯一的标识所述第一设备。作为一个示例,该第一设备标识信息可以是第一设备标识(英文:Identification,简称:ID),第一设备对第一证书进行验证,还可以包括:第一设备基于本地存储的第一设备的第二设备ID,对第一证书携带的第一设备ID进行匹配验证,其中,该第二设备ID用于唯一的标识该第一设备。作为另一个示例,为了更加安全,该第一设备标识信息也可以是第一设备ID的哈希值,那么,第一设备对第一证书进行验证,还可以包括:第一设备基于本地存储的第一设备的第二设备ID的哈希值,对第一证书携带的第一设备ID的哈希值进行匹配验证,其中,该第二设备ID用于唯一的标识该第一设备。其中,第一证书可以在其扩展域中扩展用于承载该第一设备ID或第一设备ID的哈希值的字段。需要说明的是,为了鉴权的安全进行,本申请实施例中设备ID为非公开的能够唯一标识设备的ID,例如:第二设备ID为第一设备出厂时定义的硬件唯一密钥(英文:Hardware Unique Key,简称:HUK),又例如:第二设备ID为根据第一设备的晶片标识(英文:die Identification,简称:die ID)和唯一设备标识(英文:Unique Device Identification,简称:UDI)处理得到的。这样,通过第一设备本地存储的第二设备ID或第二设备ID的哈希值,对第一证书中携带 的第一设备ID或第一设备ID的哈希值进行验证,指导第一设备对其使用权限的管理,实现对第一设备可靠和安全的鉴权。
可选的,该第一证书还可以包括第一证书标识ID,第一设备对第一证书进行验证,还可以包括:第一设备根据本地存储的第二证书ID,对该第一证书ID进行匹配验证。其中,第一证书可以在其扩展域中扩展用于承载该第一证书ID的字段。一种情况下,当第一设备还未使用该第一证书进行鉴权,那么,第一设备本地并未保存该第一证书的证书ID,该情况下,当第一设备确定本地未保存第一证书ID,即认为对该第一证书ID的匹配验证通过,可以采用第一证书进行鉴权。另一种情况下,当第一设备已使用过该第一证书进行鉴权,那么,第一设备本地保存有该第一证书的第二证书ID,该情况下,当第一设备确定本地保存第二证书ID和第一证书中的第一证书ID匹配,即认为对该第一证书ID的匹配验证通过,可以采用第一证书进行鉴权。再一种情况下,当第一设备已使用过该第一证书进行鉴权,那么,第一设备本地保存有该第一证书的第二证书ID,但是由于该第一证书使用次数超过上限或者使用时间超过上限,第二证书ID被标记为失效状态,该情况下,当第一设备确定本地保存第二证书ID和第一证书中的第一证书ID匹配,但第二证书ID的状态为失效,则认为对该第一证书ID的匹配验证未通过,不可以再使用第一证书对第一设备进行鉴权。这样,通过第一设备本地存储的第二证书ID,对第一证书中携带的第一证书ID进行验证,指导第一设备对其使用权限的管理,实现对第一设备可靠和安全的鉴权。
可选地,该第一证书还可以包括目标有效信息,该目标有效信息被设备1用于确定能否继续使用证书1进行鉴权。那么,第一设备对第一证书进行验证,还可以包括:第一设备根据实际使用信息,对目标有效信息进行验证,该实际使用信息用于表征第一设备上当前使用第一证书的情况。其中,目标有效信息为允许使用第一证书进行鉴权的最多次数(例如:5次),则,实际使用信息为所述第一设备截止当前使用第一证书进行鉴权的实际使用次数;或者,目标有效信息为允许使用第一证书进行鉴权的最长时间(例如:20小时),则,实际使用信息为从目标有效信息的计时起始时刻到当前时刻的实际使用时间。其中,第一证书可以在其扩展域中扩展用于承载该目标有效信息的字段。作为一个示例,当第一设备确定本地存储的实际使用信息达到该第一证书的目标有效信息时,第一设备可以将该第一证书吊销,如:将第一设备本地存储的第一证书对应的第二证书ID标记为失效。这样,通过第一设备本地存储的实际使用信息,对第一证书中携带的目标有效信息进行验证,指导第一设备对其使用权限的管理,实现对第一设备可靠和安全的鉴权。
可选的,第一证书还可以包括第二公钥,第一设备对第一证书进行验证,还可以包括:第一设备根据本地存储的第一公钥,对第二公钥进行验证。如果第一设备确定第一公钥和第二公钥不一致,则第一设备视作第二设备需要将已经不够安全的第一公钥和第一私钥进行更新,那么,本申请实施例还可以包括:第一设备将本地存储的第一公钥替换为第二公钥。这样,通过第一设备本地存储的第一公钥,对第一证书中携带的第二公钥进行验证,当公钥一致时指导第一设备对其使用权限的管理,实现对第一设备可靠和安全的鉴权;当公钥不一致时指导第一设备更新本地存储的公钥,完成第二设备对鉴权公私钥的更新,使得后续对第一设备的鉴权更加安全。
第二方面,本申请实施例还提供了一种对第一设备的使用权限进行鉴权的方法,由第二设备实施,例如可以包括:第二设备采用第一私钥对第一证书进行数字签名,其中,该第一私钥、第一证书均是第二设备为了对第一设备进行鉴权生成的;并且,第二设备向第一设备发送经过第一私钥进行数字签名的第一证书,以对第一设备的使用权限进行鉴权。这样,通过具有证书颁发功能和数字签名功能、安全等级较高的第二设备对第一证书进行数字签名,并将经过数字签名的第一证书发送给待鉴权的第一设备,从而由该第一设备对该数字签名后的第一证书进行验证,实现对待鉴权的第一设备的鉴权,克服了目前通过密码本或者接口对应焊盘裸露的等方式保护第一设备安全时存在的安全隐患,通过高安全等级的第二设备颁发的证书以及数字签名技术,确保了对待鉴权的第一设备的保护更加安全和可靠。
其中,第一设备可以是待鉴权的任何设备,例如:调试接口,第二设备可以是鉴权服务器。
可选地,本申请实施例中,第一证书中还可以包括第一设备标识信息,该第一设备标识信息被所述第一设备用于身份验证。例如:第一设备标识信息可以是第一设备ID或第一设备ID的哈希值。那么,本申请实施例还可以包括:第二设备接收证书请求消息,该证书请求消息中包括第一设备标识ID;第二设备根据本地存储的第二设备ID,对第一设备ID进行匹配验证。或者,第二设备接收证书请求消息,该证书请求消息中包括第一设备标识ID的哈希值;第二设备根据本地存储的第二设备ID的哈希值,对所述第一设备ID的哈希值进行匹配验证。匹配验证通过后,第二设备还可以将第一设备ID或第一设备ID的哈希值携带在第一证书中,发送给第一设备。本申请实施例中设备ID为非公开的能够唯一标识设备的ID,例如:第一设备ID为第一设备出厂时定义的硬件唯一密钥HUK,又例如:第一设备ID为根据第一设备的晶片标识die ID和唯一设备标识UDI处理得到的。这样,第二设备通过本地存储的第二设备ID或第二设备ID的哈希值,对证书请求消息中携带的第一设备ID或第一设备ID的哈希值进行验证,指导第二设备是否颁发第一证书给第一设备,从而使得对第一设备的鉴权更加可靠和安全。
其中,本申请实施例中,第一证书中还可以包括目标有效信息,该目标有效信息被所述第一设备用于确定能否继续使用所述第一证书进行鉴权。例如:该目标有效信息具体可以为允许使用所述第一证书进行鉴权的最多次数,或者,该目标有效信息也可以为允许使用所述第一证书进行鉴权的最长时间。那么,本申请实施例还可以包括:第二设备接收证书请求消息,该证书请求消息中还可以包括目标有效信息。
可选的,该第一证书中还可以携带证书类型、第一设备标识信息和第一证书ID中的至少一个。第一证书中具体携带的内容以及对应的第一设备对第一证书的验证方式,可以参见第一方面的相关说明。
第二方面提供的方法的各种可能的实现方式以及达到的技术效果,可以参照前述第一方面提供的方法的介绍,此处不再赘述。
第三方面,本申请还提供了第一设备,包括收发单元和处理单元。其中,收发单元用于执行上述第一方面提供的方法中的收发操作;处理单元用于执行上述第一方面中除了收 发操作以外的其他操作。例如:当所述第一设备执行所述第一方面所述的方法时,所述收发单元用于获取采用第一私钥进行数字签名的第一证书;所述处理单元用于对第一证书进行验证,获得第一验证结果;所述处理单元还用于根据第一验证结果,确定第一设备的使用权限。
第四方面,本申请实施例还提供了第二设备,该第二设备包括收发单元和处理单元。其中,收发单元用于执行上述第二方面提供的方法中的收发操作;处理单元用于执行上述第二方面中除了收发操作以外的其他操作。例如:当所述第二设备执行所述第二方面所述的方法时,所述收发单元用于向第一设备发送经过第一私钥进行数字签名的第一证书;所述处理单元用于采用第一私钥对第一证书进行数字签名。
第五方面,本申请实施例还提供了一种第一设备,包括通信接口和处理器。其中,通信接口用于执行前述第一方面提供的方法中的收发操作;处理器,用于执行前述第一方面提供的方法中除所述收发操作以外的其他操作。
第六方面,本申请实施例还提供了一种第二设备,包括通信接口和处理器。其中,通信接口用于执行前述第二方面提供的方法中的收发操作;处理器,用于执行前述第二方面提供的方法中除所述收发操作以外的其他操作。
第七方面,本申请实施例还提供了一种第一设备,该第一设备包括存储器和处理器。其中,存储器用于存储程序代码;处理器用于运行所述程序代码中的指令,使得该第一设备执行以上第一方面提供的方法。
第八方面,本申请实施例还提供了一种第二设备,该第二设备包括存储器和处理器。其中,存储器用于存储程序代码;处理器用于运行所述程序代码中的指令,使得该第一设备执行以上第二方面提供的方法。
第九方面,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得所述计算机执行以上第一方面或第二方面提供的所述的鉴权方法。
第十方面,本申请实施例还提供了计算机程序产品,当其在计算机上运行时,使得计算机执行前述第一方面或第二方面提供的所述的鉴权方法。
第十一方面,本申请实施例还提供了一种通信系统,该通信系统包括第三方面、第五方面或第七方面提供的所述的第一设备以及第四方面、第六方面或第八方面提供的第二设备。
附图说明
图1为本申请实施例中一应用场景所涉及的网络系统框架示意图;
图2为本申请实施例中在图1场景下对设备12鉴权的流程示意图;
图3为本申请实施例中一种鉴权方法100的流程示意图;
图4a为本申请实施例中一种证书的示意图;
图4b为本申请实施例中对图4a中证书进行数字签名后的证书的示意图;
图5为本申请实施例中在图1场景下一种鉴权方法200的流程示意图;
图6为本申请实施例中一种鉴权方法300的流程示意图;
图7为本申请实施例中一种对第一设备的使用权限进行鉴权的方法400的流程示意图;
图8为本申请实施例中一种第一设备800的结构示意图;
图9为本申请实施例中一种第二设备900的结构示意图;
图10为本申请实施例中一种第一设备1000的结构示意图;
图11为本申请实施例中一种第二设备1100的结构示意图;
图12为本申请实施例中一种第一设备1200的结构示意图;
图13为本申请实施例中一种第二设备1300的结构示意图;
图14为本申请实施例中一种通信系统1400的结构示意图。
具体实施方式
设备上一般会存储一些重要信息(例如:设备的硬盘数据),这些重要信息对设备安全十分关键,需要采取一定的保护措施确保这些重要信息的安全。
目前,通常采用密码本的方式对设备进行鉴权,在设备上预置一个或多个密码,密码本上保存着多个密码,当需要开放该设备的使用权限时,由调试人员、运维人员、生产人员等指定人员将密码本中的密码输入到设备中,设备将该输入的密码和其中预置的密码进行匹配,匹配成功时,视作该设备的鉴权通过,该设备开放上匹配成功的密码对应的使用权限,从而可以通过开放的使用权限访问对应的重要信息。虽然密码本由少数的指定人员掌握,一定程度上可以保证设备上存储的重要信息的安全,但是,由于密码本的存储、传输和匹配均采用的是明文,而且,具有密码本权限的指定人员较杂,人为管理密码本非常容易泄露密码本中的密码,该采用该密码本对设备进行鉴权的方式,安全性较低。
此外,由于访问设备上的重要信息,通常通过设备上的关键接口(如:调试接口或业务接口)实现,那么,很多设备厂商在设备出厂时,将这些关键接口的连接器去掉(即,关键接口对应的焊盘裸露),以确保设备上重要信息的安全。但是,攻击者可以通过观察以及万用表等仪器识别出这些关键接口对应的焊盘,并通过跳线将该关键接口接入分析仪,从而直接获取这些重要信息,十分不安全。例如:微软笔记本的硬件数据通常采用两级密钥进行加密保护,即,通过全卷加密密钥(英文:Full Volume Encryption Key,简称:FVEK)加密,通过卷主密钥(英文:Volume Master Key,简称:VMK)(也称为原始密钥)加密FVEK;该VMK保存在可信平台模块(英文:Trusted Platform Module,简称:TPM)中。微软在生产该笔记本电脑时,增加TPM的LPC(英文:Low Pin Count)接口以测试该笔记本电脑的性能,但是在发货时,将该接口从连接器对应的焊盘裸露,那么,攻击者很容易就可以识别出了该裸露的TPM的LPC接口,并通过跳线将该接口接入逻辑分析仪,直接获取到VMK,从而破解出由VMK加密的FVEK,进而破解出由FVEK加密的硬盘数据,严重危及该笔记本电脑的安全。
可见,无论通过密码本的保护方式还是上述在出厂时去掉设备的关键接口的连接器的方式,均不能很好的确保设备的安全以及设备上重要信息的安全。
基于此,本申请实施例提供一种鉴权方法,在用户需要访问第一设备时,第一设备需 要进行鉴权,鉴权通过后才可以开放第一设备上对应的使用权限,供用户在开放的使用权限范围内安全的访问该第一设备。鉴权的过程具体可以包括:由证书颁发机构(英文:Certificate Authority,简称:CA)服务器等具有证书颁发功能的第二设备,为待鉴权的第一设备生成第一证书,并基于第一私钥对该第一证书进行数字签名,那么,该第一设备获取到该数字签名后的第一证书时,即可对该数字签名后的证书进行验证,获得第一验证结果,并基于该第一验证结果对该第一设备的使用权限进行鉴权。当第一验证结果表示验证通过,则第一设备开放对应的使用权限,当第一验证结果表示验证未通过,则第一设备不开放对应的使用权限。这样,通过具有证书颁发功能和数字签名功能、安全等级较高的第二设备对第一证书进行数字签名,并由待鉴权的第一设备对该数字签名后的第一证书进行验证,实现对待鉴权的第一设备的鉴权,克服了目前通过密码本或者接口对应焊盘裸露的等方式保护第一设备安全时存在的安全隐患,通过高安全等级的第二设备颁发的证书以及数字签名技术,确保了对待鉴权的第一设备的保护更加安全和可靠。
其中,数字签名技术可以视作数字摘要技术和公私钥技术的结合,既可以通过数字摘要技术验证证书是否被篡改,也可以通过公私钥技术验证数字摘要是否合法,是一种能够为证书提供快速和全面的完整性保护和校验的技术。数字签名通常包括一对密钥,一个密钥用于对证书、消息等的数字摘要进行签名,另一个密钥用于对该证书、消息等的签名进行校验。作为一个示例,假设对于证书X的数字签名过程可以包括下述两个过程:第一个过程,对证书X的数字摘要进行签名,即,在证书X从CA服务器下至设备Y之前,CA服务器可以首先经过哈希算法计算得到X的数字摘要digest X1,再利用私钥a对该digest X1进行数字签名得到digestEncode X1;在将证书X下至设备Y上时,发送给设备Y的包括X和digestEncode X1;第二个过程,对证书X进行验证,具体包括:设备Y先用公钥A对digestEncode X1进行验证,得到digestDecode X3,再采用与数字签名时相同的哈希算法计算X的数字摘要,生成数字摘要digest X2,如果digestDecode X3=digest X2,则可以确定该证书X是完整的(即,证书X未被篡改)且是合法的(即,证书X为合法制造商发布的),从而确保该次访问该设备Y是安全和可靠的。其中,私钥a和公钥A是设备Y的制造商对应的CA服务器提供的一对密钥,公钥A是公开可见的,而私钥a则是保密的,只有CA服务器可见。可见,由于CA服务器安全等级较高,所以本申请实施例中采用CA服务器颁发的证书并对证书采用数字签名技术进行数字签名,对待鉴权设备而言是高安全等级的安全保护措施。
举例来说,本申请实施例的场景之一,可以是应用到如图1所示的网络中。参见图1,该网络中包括:CA服务器11、设备12和用户13。其中,CA服务器11可以是设备12的制造商对应的安全、权威、足以信赖的服务器,该CA服务器11可以产生、分配并管理该制造商的各设备对应的证书,同时,该CA服务器11也可以用作该制造商的各设备的签名系统,对即将下至各设备的证书进行数字签名。设备12可以是任何需要进行鉴权的设备,例如:设备12可以是路由器、交换机等网络设备,也可以是手机、笔记本电脑等终端设备,还可以是U盘等移动存储设备,也可以是调试接口、业务接口或者单板。用户13具体可以是设备12的管理人员,或者,用户13也可以是设备12在安全产线的自动化工 具,用于自动执行上述用户13所能实施的所有操作。
具体实现时,CA服务器11预先生成设备12的公私钥对:私钥a和公钥A,设备12获得该公钥A并将其保存在本地的安全存储区域。当需要访问设备12时,对设备12的鉴权过程参见图2,可以包括:S11,用户13在CA服务器11上提交设备12对应的证书请求消息;S12,CA服务器11响应该证书请求消息,生成证书X,并基于私钥a对证书X进行数字签名,获得证书X的签名1;S13,用户13获得证书X和签名1;S14,用户13将证书X和签名1配置到设备12上;S15,设备12利用公钥A对证书X进行验证,验证通过表示设备12的该次鉴权通过,反之,验证未通过表示设备12的该次鉴权失败。这样,实现了对待鉴权设备12更加安全的保护。
需要说明的是,上述图2所示的实现方式中,CA服务器11为离线服务器,那么,S13具体可以是用户13通过安全的生产环境设备拷贝CA服务器11上的证书X’,S14具体可以是用户13通过该存储有证书X’的该安全的生产环境设备将该证书X’配置到设备12上;或者,S13和S14也可以不通过用户13执行,而是由安全的产线自动化工具自动执行的。在另一些可能的实现方式中,CA服务器11也可以是在线服务器,无需用户13通过另外的安全生产环境设备去中转该证书X’,CA服务器11和设备12是可以通信的,CA服务器11可以直接将证书X’发送给设备12上。
需要说明的是,本申请实施例中设备本地的安全存储区域,是指设备本地的存储区域中,不能被轻易访问和篡改的存储区域。例如:安全存储区域可以是设备的一次性可编程存储器(英文:One-Time Programmable,简称:OTP),又例如:安全存储区域也可以是设备的电熔丝(英文:electrical FUSE,简称:eFUSE),由于OTP或eFUSE等安全存储区域上存储的内容不可更改,所以,设备本地的安全存储区域可以可靠和安全的保存公钥1和公钥2。
可以理解的是,上述场景仅是本申请实施例提供的一个场景示例,本申请实施例并不限于此场景。
下面结合附图,通过实施例来详细说明本申请实施例中鉴权方法的具体实现方式。
图3为本申请实施例中的一种鉴权方法100的流程示意图。参见图3,该方法100应用于包括设备1和设备2的网络中,其中,设备1预先保存有设备2生成的公钥1,在需要对设备1进行访问时,可以先执行该方法100对设备1进行鉴权。例如:该方法100可以应用在图1所示的网络中,设备1可以是设备12,设备2可以是CA服务器12。该方法100例如可以包括下述S101~S106:
S101,设备2生成证书1、私钥1和公钥1,其中,公钥1和私钥1对应。
其中,设备2是指具有生成证书功能和对证书进行数字签名功能的设备,例如:该设备2可以是设备1的制造商对应的CA服务器。对于待鉴权设备1以及整个网络来说,该设备2是安全可信的设备。
在一些具体的实现方式中,当对设备1有访问需求,需要对设备1进行鉴权时,在S101之前,设备2可以接收到证书请求消息,该证书请求消息用于向设备2申请设备1对 应的证书1,设备2响应于该证书请求消息,执行S101。作为一个示例,设备2接收的证书请求消息,可以是用户或者安全的产线自动化工具向设备2发起的,即,用于在设备2上触发该证书请求消息;作为另一个示例,若设备2为在线设备,即,设备2可以和设备1进行通信,那么,该证书请求消息也可以是设备1发送给设备2的。
设备2接收到的证书请求消息中,可以携带设备1的设备标识信息1,该设备标识信息1可以用于唯一标识设备1。
作为一个示例,该设备标识信息1可以是设备标识(英文:Identification,简称:ID)1。若设备2在本地存储有权发放证书进行鉴权的所有待鉴权设备的设备ID组成的设备ID列表,那么,当设备2接收的证书请求消息中携带设备ID1时,设备2可以根据本地存储的设备ID列表,对设备ID1进行匹配验证,当确定设备ID1属于该设备ID列表,表征设备ID1和该设备ID列表中的某具体设备ID匹配,则,设备2执行S101,为设备1生成证书1;反之,当确定设备ID1不属于该设备ID列表,表征设备ID1和该设备ID列表中的所有设备ID均不匹配,则,说明设备2不负责为设备1的鉴权生成对应的证书,那么,该设备2不执行S101,终止本次借助设备2对设备1的鉴权。
作为另一个示例,该设备标识信息1也可以是设备ID1的哈希值。若设备2在本地存储设备2有权发放证书进行鉴权的所有待鉴权设备的设备ID的哈希值组成的设备ID的哈希值列表,那么,当设备2接收的证书请求消息中携带设备ID1的哈希值时,设备2可以根据本地存储的设备ID的哈希值列表,对设备ID1的哈希值进行匹配验证,当确定设备ID1的哈希值属于该设备ID的哈希值列表,表征设备ID1的哈希值和该设备ID的哈希值列表中的某具体设备ID的哈希值匹配,则,设备2执行S101,为设备1生成证书1;反之,当确定设备ID1的哈希值不属于该设备ID的哈希值列表,表征设备ID1的哈希值和该设备ID的哈希值列表中的所有设备ID的哈希值均不匹配,则,说明设备2不负责为设备1的鉴权生成对应的证书,那么,该设备2不执行S101,终止本次借助设备2对设备1的鉴权。
其中,该设备ID1可以是能够唯一标识该设备1的标识,为了更加安全,该设备ID1可以是设备1对外非公开的标识。例如:该设备ID1可以是设备1出厂时定义的硬件唯一密钥(英文:Hardware Unique Key,简称:HUK);又例如:该设备ID1也可以是根据设备1的唯一设备标识(英文:Unique Device Identification,简称:UDI)和该设备1中的晶片标识(英文:die Identification,简称:die ID)获得的标识。
此外,根据鉴权的需要,该设备2接收到的证书请求消息中,也可以携带目标有效信息,该目标有效信息被设备1用于确定能否继续使用证书1进行鉴权。该目标有效信息具体可以是允许使用证书1进行鉴权的最多次数(例如:5次),或者,是允许使用证书1进行鉴权的最长时间(例如:1天),以便设备2参考该目标有效信息确定所要生成的该证书1的有效使用次数或时长。
具体实现时,设备2响应于所接收的证书请求消息,为设备1生成其对应的证书1,而且,为了通过数字签名的方式实现对设备1的鉴权,还生成私钥1和对应的公钥1。作为一个示例,如图4a所示,该证书1可以包括:版本号、序列号、签名算法标识符、颁发 者信息、有效期、使用者信息、公钥信息和扩展域,其中,版本号即该证书1的版本号;序列号为设备2为证书1分配的编号,可以唯一标识该证书1;签名算法标识符,是指保护该证书1安全的算法及相关参数,例如:签名算法标识符可以包括:信息摘要算法(英文:Message-Digest Algorithm,简称:MD5)、RSA加密算法以及相关参数,又例如:当不进行安全保护时,该签名算法标识符可以为空;颁发者信息是指设备2的相关信息,具体可以包括设备2所属的国家、州、省、组织单位、组织单位部门、姓名、电子邮件;有效期可以包括起始时间和结束时间;使用者信息是指证书1对应的设备1所属用户的相关信息,具体可以包括设备1所属的国家、州、省、组织单位、组织单位部门、姓名、电子邮件;公钥信息是指对证书1进行安全保护的公钥1的相关信息,例如可以包括:公钥1、使用的公钥加密算法以及相应的参数;扩展域,可以包括一个或多个待扩展的数据项,该扩展域中可以扩展下述信息中的至少一个:证书类型、设备ID1、设备ID1的哈希值和证书ID1中的至少一个,例如:可以在该证书1的扩展域中扩展区域1,该区域1中的字段的值用于指示证书1的证书类型,又例如:也可以在该证书1的扩展域中扩展区域2,用于存储设备ID1或设备ID1的哈希值,再例如:也可以在该证书1的扩展域中扩展区域3,用于存储目标有效信息,又例如:还可以在证书1的扩展域中扩展区域4,用于存储能够唯一标识该证书1的证书ID1。
可见,通过S101,设备2为待鉴权的设备1生成证书1、公钥1和私钥1,为后续对证书1进行数字签名以及对设备1的鉴权提供了可靠的数据基础。
S102,设备2采用私钥1对证书1进行数字签名,获得证书1的签名1。
具体实现时,设备2对证书1进行数字签名的过程,具体可以包括:S21,设备2采用哈希算法1对证书1进行哈希计算,将哈希计算所得的哈希值记作证书1的数字摘要1;S22,设备2采用私钥1对数字摘要1进行加密,将加密后所得的值记作该证书1的签名1。
S103,设备2向设备1发送证书1和签名1。
S104,设备1获取采用私钥1进行数字签名的证书1。
作为一个示例,若设备2相对设备1是在线的,设备2和设备1之间已经建立了通信连接,那么,设备2可以基于该已经建立的通信连接将证书1和签名1发送给设备1。
作为另一个示例,在一些安全性要求更高的场景中,设备2相对设备1是离线的,即,设备2和设备1之间没有通信连接,那么,设备2向设备1发送证书1和签名1,也可以是:用户或安全的产线自动化工具先从设备2上拷贝该证书1和签名1,再将该证书1和签名1配置到设备1上。
例如:假设图4a所示的证书为S101~S103中的证书1,那么,参见图4b,S103中的证书1和签名1可以通过上述方式组合发送给设备1。需要说明的是,该图4b示出的证书1和签名1也可以视作S104中的“采用私钥1进行数字签名的证书1”。
需要说明的是,S104中“采用私钥1进行数字签名的证书1”,和S103中“证书1和私钥1”均表示相同的内容,例如:均表示图4b所示的内容。
可见,设备1获取到该采用私钥1进行数字签名的证书1,使得后续对该设备1进行鉴权成为了可能。
S105,设备1对证书1进行验证,获得验证结果1。
在S105之前,设备1本地预先存储有公钥1,若设备2相对设备1是在线的,那么,设备2可以直接将公钥1发送给设备1,设备1将所接收的公钥1存储在本地的安全存储空间。或者,若设备2相对设备1是离线的,那么,用户先从设备2上获得公钥1,再将该公钥1配置到设备1本地的安全存储空间。
具体实现时,设备1在获得证书1和签名1后,S105具体可以包括:设备1根据本地存储的公钥1对证书1进行验证。具体而言,设备1根据本地存储的公钥1对证书1进行验证的过程,具体可以包括:S31,设备1采用公钥1对签名1进行解密,将解密后所得的值记作数字摘要2;S32,设备1采用哈希算法1对证书1进行哈希计算,将哈希计算所得的哈希值记作证书1的数字摘要3;S33,设备1比较数字摘要2和数字摘要3,获得比较结果。作为一个示例,当设备1仅通过公钥1对证书1进行验证,则,上述比较结果即为验证结果1,若比较结果表示数字摘要2和数字摘要3相同,则,确定该证书1是合法且完整的,那么,验证结果1表征设备1对证书1的验证通过;否则,若比较结果表示数字摘要2和数字摘要3不相同,则,确定该证书1不合法和/或不完整,那么,验证结果1表征设备1对证书1的验证未通过。
在一些可能的实现方式中,证书1中可以包括证书类型,具体可以是在证书1的扩展域中,扩展用于存储证书类型的字段,该字段的值用于指示证书1的证书类型。那么,S105还可以包括:验证证书1中的证书类型。具体实现时,判断该证书类型是否为鉴权证书,获得判断结果,若判断结果1表示证书1的证书类型为鉴权证书,则可以确定该证书1能够用于对设备1的鉴权,否则,若判断结果表示证书1的证书类型不是鉴权证书,则可以确定该证书1不能用于对设备1的鉴权。作为一个示例,S105具体可以包括:S41,根据上述S31~S33获得比较结果;S42,判断该证书类型是否为鉴权证书,获得判断结果;S43,根据比较结果和判断结果,确定验证结果1,其中,若比较结果表示数字摘要2和数字摘要3相同,且判断结果表示证书1的证书类型为鉴权证书,则验证结果1表征设备1对证书1的验证通过;否则,该验证结果1表征设备1对证书1的验证未通过。
在另一些可能的实现方式中,证书1中还可以包括证书1所适用的设备1的设备标识信息1,以设备标识信息1为设备ID1或设备ID1的哈希值为例,具体可以是在证书1的扩展域中,扩展用于存储设备ID1或设备ID1的哈希值的字段。作为一个示例,若证书1中包括的是设备ID1,那么,S105还可以包括:基于本地存储的设备1的设备ID2,对证书1携带的设备ID1进行匹配验证,获得匹配结果1,其中,该设备ID2用于唯一的标识该设备1。若匹配结果1表示设备ID1和设备ID2相同,则可以确定该证书1为了对该设备1进行鉴权而颁发的,否则,可以确定该证书1为了对该设备1进行鉴权而颁发的。作为另一个示例,若证书1中包括的是设备ID1的哈希值,那么,S105还可以包括:基于本地存储的设备1的设备ID2的哈希值,对证书1携带的设备ID1的哈希值进行匹配验证,获得匹配结果2。若匹配结果2表示设备ID1的哈希值和设备ID2的哈希值相同,则可以确定该证书1为了对该设备1进行鉴权而颁发的,否则,可以确定该证书1为了对该设备1进行鉴权而颁发的。作为再一个示例,若证书1中包括的是设备ID1和该设备ID1的哈 希值,那么,S105还可以包括:基于本地存储的设备1的设备ID2,对证书1携带的设备ID1进行匹配验证,获得匹配结果3;基于本地存储的设备1的设备ID2的哈希值,对证书1携带的设备ID1的哈希值进行匹配验证,获得匹配结果4。若匹配结果3表示设备ID1和设备ID2相同,且匹配结果4表示设备ID1的哈希值和设备ID2的哈希值相同,则可以确定该证书1为了对该设备1进行鉴权而颁发的,否则,可以确定该证书1为了对该设备1进行鉴权而颁发的。其中,设备ID2为设备1出厂时定义的硬件唯一密钥HUK,或者,设备ID2为根据设备1的晶片标识die ID和唯一设备标识UDI处理得到的。
该实现方式下,一种情况下,若证书1中只扩展了设备ID1(设备ID1的哈希值),那么,S105具体可以包括:S51,根据上述S31~S33获得比较结果;S52,设备1基于本地存储的设备ID2(或设备ID2的哈希值),对证书1携带的设备ID1(或设备ID1的哈希值)进行匹配验证,获得匹配结果;S53,根据比较结果和匹配结果,确定验证结果1,其中,若比较结果表示数字摘要2和数字摘要3相同,且匹配结果表征设备ID1和设备ID2相同(或设备ID1的哈希值和设备ID2的哈希值相同),则验证结果1表征设备1对证书1的验证通过;否则,该验证结果1表征设备1对证书1的验证未通过。另一种情况下,若证书1扩展了设备ID1(设备ID1的哈希值)和证书类型,那么,S105具体可以包括:S51,根据上述S31~S33获得比较结果;S52,设备1基于本地存储的设备ID2(或设备ID2的哈希值),对证书1携带的设备ID1(或设备ID1的哈希值)进行匹配验证,获得匹配结果;S53,判断该证书类型是否为鉴权证书,获得判断结果;S54,根据比较结果、匹配结果和判断结果,确定验证结果1,其中,若比较结果表示数字摘要2和数字摘要3相同,匹配结果表征设备ID1和设备ID2相同(或设备ID1的哈希值和设备ID2的哈希值相同),且判断结果表征证书1为鉴权证书,则验证结果1表征设备1对证书1的验证通过;否则,该验证结果1表征设备1对证书1的验证未通过。
在又一些可能的实现方式中,证书1中还可以包括证书1的证书ID1,具体可以是在证书1的扩展域中,扩展用于存储证书ID1的字段。那么,S105还可以包括:根据本地存储的证书ID2,对证书ID1进行匹配验证。
作为一个示例,若证书1为一次性证书,即,该证书1只能完成对设备1的一次鉴权,为了确保每个下到设备1上的证书只能有效使用1次,那么,该设备1上可以保存其使用过的所有证书1的证书ID。那么,设备1在接收到证书1后,可以判断该证书1对应的证书ID1和本地存储的证书ID2是否匹配,若匹配,则表示该证书1已经在设备1上使用过,即,该证书1已经失效,不能再使用该证书1对设备1进行鉴权;反之,若不匹配,则表示该证书1是第一次被下到设备1上,可以使用该证书1对设备1进行鉴权。
作为另一个示例,若证书1不是一次性的证书,那么,可以结合证书1中扩展的目标有效信息判断该证书1是否可以继续对设备1进行鉴权,具体实现可以参见下述有关目标有效信息的相关说明。
在再一些可能的实现方式中,证书1中还可以包括目标有效信息,该目标有效信息为允许使用证书1进行鉴权的最多次数,或者,允许使用所述第一证书进行鉴权的最长时间。具体可以是在证书1的扩展域中,扩展用于存储目标有效信息的字段,该字段的值用 于指示证书1的目标有效信息。那么,S105还可以包括:根据实际使用信息,对目标有效信息进行验证。其中,实际使用信息用于表征设备1上当前使用证书1的情况,当目标有效信息为允许使用证书1进行鉴权的最多次数,则,实际使用信息为设备1截止当前使用证书1进行鉴权的实际使用次数;或者,当目标有效信息为允许使用证书1进行鉴权的最长时间,则,实际使用信息为从目标有效信息的计时起始时刻到当前时刻的实际使用时间。
作为一个示例,假设证书1上包括证书ID1和目标有效信息,当设备1首次获取到该证书1时,该设备1查看设备1上还未保存该证书1对应的证书ID1,设备1存储该证书ID1至设备1的本地,并触发开始记录实际有效信息,即,记录证书ID1对应证书1的使用次数为1或触发开始记录实际使用时间。当设备1非首次获得并使用该证书1时,该S105可以包括:S61,设备1查看本地存储的证书ID1和证书1中携带的证书ID1是否一致,若一致,执行S62,否则,执行S64;S62,判断该证书ID1对应的证书1的实际使用次数是否达到目标有效信息(即,最大允许次数),或者,判断该证书ID1对应的证书1的实际使用时长是否达到目标有效信息(即,最长允许时间),若未达到,则执行S63,否则,执行S64;S63,确定该证书1仍然有效,能够继续使用该证书1对设备1进行鉴权,并且,若目标有效信息为次数,则更新该实际使用次数(即,将实际使用次数加一);S64,确定该证书1无效,不基于该证书1对设备1进行鉴权。对于满足S63执行的条件后,若证书1中还包括设备ID1、设备ID1的哈希值和证书类型中的至少一个时,还可以通过对应的验证获得验证结果1,例如:判断设备1本地存储的设备ID2和设备ID1是否一致,又例如:判断设备1本地存储的设备ID2的哈希值和设备ID1的哈希值是否一致,再例如:验证该证书1的证书类型是否为鉴权证书。
可以理解的是,证书随着使用其安全性会下降。那么,设置证书的目标有效信息,可以限定证书的有效使用时间或次数,确保在证书使用至不足够安全的情况下,能够将该证书吊销,以避免该证书使用次数太多或使用时间太长,安全性下降后仍然能够对设备进行鉴权,导致鉴权效果下降,保护设备1安全的效果大打折扣。
在又一些可能的实现方式中,证书1中还包括公钥2,那么,S105具体还可以包括:根据本地存储的公钥1,对证书1中的公钥2进行验证。一种情况下,该公钥2即对证书1进行数字签名的公钥1,那么,设备1可以确定公钥2和本地存储的公钥1一致,则,可以基于该证书1对设备1进行鉴权。另一种情况下,当发现公钥1和私钥1不再安全时,为了能够继续确保该鉴权方式的安全性,设备2还可以生成新的私钥2和与该私钥2对应的公钥2,并将该公钥2携带在证书1中,发送给设备1,此时,设备1通过对比确定本地存储的公钥1和证书1中携带的公钥2不一致,为了不影响后续对设备1的鉴权,将本地存储的公钥1替换为公钥2。需要说明的是,后续,该证书1可以使用私钥2进行数字签名,获得签名2,并将签名2和证书1发送给设备1,而设备1即可利用本地存储的公钥2对证书1进行验证,获取验证结果1。
S106,设备1根据验证结果1,确定设备1的使用权限。
可以理解的是,通过S105可以获得验证结果1,一种情况下,该验证结果1可以表征 该设备1对证书1的验证通过,那么,设备1可以基于该验证结果1开放设备1的使用权限。另一种情况下,该验证结果1可以表征设备1该对证书1的验证未通过,那么,设备1可以基于该验证结果1确定不开放设备1的使用权限。
设备1可以是网络设备或单板,以设备1为网络设备为例,作为一个示例,当验证结果1表征该网络设备对证书1的验证通过时,网络设备开放其上所有接口的使用权限;或者,当验证结果1表征网络设备对证书1的验证未通过时,网络设备不开放其上任何的一个接口的使用权限。作为另一个示例,该证书1还可以其扩展域携带鉴权范围,例如:鉴权接口ID,那么,当验证结果1表征该网络设备对证书1的验证通过时,网络设备可以根据该鉴权范围开放对应的使用权限,例如:开放鉴权接口ID对应的鉴权接口的使用权限;或者,当验证结果1表征网络设备对证书1的验证未通过时,网络设备不开放其上任何的一个接口的使用权限。
设备1也可以指某个设备上的调试接口或业务接口时,当验证结果1表征该调试接口或业务接口对证书1的验证通过,那么,该设备可以开放其上对应的调试接口或业务接口的使用权限。当验证结果1表征调试接口或业务接口对证书1的验证未通过,那么,该设备可以不开放该调试接口或业务接口的使用权限。
可见,通过本申请实施例提供的方法,通过具有证书颁发功能和数字签名功能、安全等级较高的设备2对证书1进行数字签名,并由待鉴权的设备1对该数字签名后的证书1进行验证,实现对待鉴权的设备1的鉴权,克服了目前通过密码本或者接口对应焊盘裸露的等方式保护设备1安全时存在的安全隐患,通过高安全等级的设备1颁发的证书1以及数字签名技术,确保了对待鉴权的设备1的保护更加安全和可靠。
为了更加清楚和详细的介绍本申请实施例,下面在图1所示的场景,以图4a和图4b所示的证书为证书1,CA服务器11和设备12不能直接通信为例,结合图5对本申请实施例中的鉴权过程进行具体说明。
其中,设备12为交换机12,该交换机12上保存有公钥3、该交换机的HUK 12。CA服务器11上保存有其负责发放证书进行鉴权的所有待鉴权设备的设备ID的哈希值组成的设备ID哈希值的列表。
参见图5,本实施例中方法200的鉴权过程例如可以包括:
S201,用户13在CA服务器上提交证书请求消息,该证书请求消息中携带HUK 12的哈希值、最大鉴权次数和鉴权范围。
其中,该鉴权范围用于指示该交换机12上的调试接口1和调试接口2。
其中,本实施例中,用户13也可以是安全的产线自动化设备,自动执行用户13所执行的所有操作。
S202,CA服务器11判断HUK 12的哈希值是否在本地存储的设备ID的哈希值的列表中,若不在,则执行S203,否则,执行下述S204~S215。
S203,CA服务器11向用户13显示提示信息,该提示信息用于告知用户13该CA服务器11不负责对交换机12的鉴权。
S204,CA服务器11生成证书12,并使用私钥3对证书12进行数字签名,获得签名12。
其中,证书12参见图4a所示,证书12和其对应的签名12参见图4b所示。其中,证书12中的公钥信息包括公钥3’,扩展域中包括:HUK 12的哈希值、证书ID12、最大鉴权次数——5次、鉴权接口1的接口ID1和鉴权接口2的接口ID2。
S205,用户13通过存储设备从CA服务器11上获得该证书12和签名12。
S206,用户13通过该存储设备将该证书12和签名12配置到交换机12上。
S207,交换机12验证本地保存的公钥3对签名12进行验证,若验证通过,则执行S208,否则,执行S216。
S208,交换机12验证证书12中的证书类型是否为鉴权证书,若是,则执行S209,否则,执行S216。
S209,交换机12验证本地保存的公钥3和证书12中保存的公钥3’是否一致,若一致,则执行S210,否则,执行S216。
S210,交换机12验证证书12中的版本号、序列号、签名算法标识符、颁发者信息、有效期、使用者信息等是否有效,若有效,则执行S211,否则,执行S216。
S211,交换机12判断该交换机12本地是否存储有证书ID12,若否,则执行S212,若是,则执行S213。
S212,交换机12在本地记录证书ID12,并将实际使用次数记为0。
S213,交换机12判断该交换机12本地存储的HUK 12的哈希值和证书12中携带的HUK 12的哈希值是否一致,若一致,则执行S214,否则,执行S216。
S214,交换机12判断实际使用次数是否达到5次,若否,则执行S215,否则,执行S216。
S215,交换机12开放调试接口1和调试接口2,并将实际使用次数加1。
S216,交换机12确定中止鉴权流程,并向CA服务器11上报鉴权错误。
需要说明的是,上述交换机12的鉴权过程中,验证和判断的顺序可以进行调整,在本申请实施例中不作具体限定。
如此,本实施例中,通过CA服务器11这一安全等级较高的设备,基于其颁发的证书12以及对证书12进行数字签名后获得的签名12,实现了交换机12对自身使用权限的管理,通过鉴权结果指示开放其上较为关键的调试接口的使用权限,实现了对交换机12更加安全的保护。
图6示出了本申请实施例中一种鉴权方法300的流程示意图,该方法300应用在包括第一设备和第二设备的场景中,以第一设备为执行主体,该鉴权方法300例如可以包括:
S301,获取采用第一私钥进行数字签名的第一证书;
S302,对所述第一证书进行验证,获得第一验证结果;
S303,根据所述第一验证结果,确定所述第一设备的使用权限。
其中,第一设备可以是方法100中的设备1,那么,第二设备为方法100中的设备2, 第一私钥为方法100中的私钥1,第一公钥为方法100中的公钥1,第一证书为方法100中的证书1,第一验证结果为方法100中的验证结果1。或者,第一设备也可以是方法200中的交换机12,那么,第二设备为方法200中的CA服务器11,第一私钥为方法200中的私钥3,第一公钥为方法200中的公钥3,第一证书为方法200中的证书12。
其中,第一设备可以是待鉴权的任何设备,例如:可以指网络设备或单板,又例如:也可以指设备上的调试接口或业务接口。第二设备可以是指安全等级较高,且具有证书颁发功能和数字签名功能的鉴权服务器,例如:CA服务器。当第一设备指调试接口,第二设备是CA服务器时,CA服务器颁发且通过数字签名后的证书下发到调试接口所在设备并验证通过后,该调试接口所在设备开放该调试接口的使用权限,供访问和使用该调试接口。
作为一个示例,第一设备对第一证书进行验证,具体可以包括:第一设备根据本地存储的与第一私钥对应的第一公钥,对第一证书进行验证。这样,通过第一设备本地存储的公钥对证书进行验证,实现对第一设备可靠和安全的鉴权。
作为另一个示例,该第一证书中可以包括证书类型,S302还可以包括:验证所述证书类型。其中,第一证书的扩展域中如果扩展了用于指示该第一证书的证书类型的字段,那么,第一设备可以读取该字段,当确定该字段指示该第一证书为鉴权证书,第一验证结果可以表征对第一证书的验证通过。这样,第一设备还可以通过对所接收的第一证书的证书类型的验证,实现对第一设备可靠和安全的鉴权。
作为再一个示例,该第一证书中还可以包括第一设备标识信息,那么,S302还可以包括:基于本地存储的所述第一设备的第二设备标识信息,对所述第一证书携带的所述第一设备标识信息进行匹配验证,其中,所述第二设备标识信息用于唯一的标识所述第一设备。作为一个示例,该第一设备标识信息可以是第一设备标识,则,S302还可以包括:第一设备基于本地存储的第一设备的第二设备ID,对第一证书携带的第一设备ID进行匹配验证,其中,该第二设备ID用于唯一的标识该第一设备。作为另一个示例,为了更加安全,该第一设备标识信息也可以是第一设备ID的哈希值,那么,S302还可以包括:第一设备基于本地存储的第一设备的第二设备ID的哈希值,对第一证书携带的第一设备ID的哈希值进行匹配验证,其中,该第二设备ID用于唯一的标识该第一设备。其中,第一证书可以在其扩展域中扩展用于承载该第一设备ID或第一设备ID的哈希值的字段。这样,通过第一设备本地存储的第二设备ID或第二设备ID的哈希值,对第一证书中携带的第一设备ID或第一设备ID的哈希值进行验证,实现对第一设备可靠和安全的鉴权。例如:该
需要说明的是,为了鉴权的安全进行,本申请实施例中设备ID为非公开的能够唯一标识设备的ID,例如:第二设备ID为第一设备出厂时定义的硬件唯一密钥HUK,又例如:第二设备ID为根据第一设备的晶片标识die ID和唯一设备标识UDI处理得到的。
作为又一个示例,该第一证书还可以包括第一证书标识ID,S302还可以包括:第一设备根据本地存储的第二证书ID,对该第一证书ID进行匹配验证。其中,第一证书可以在其扩展域中扩展用于承载该第一证书ID的字段。这样,通过第一设备本地存储的第二证书ID,对第一证书中携带的第一证书ID进行验证,实现对第一设备可靠和安全的鉴 权。
一种情况下,当第一设备还未使用该第一证书进行鉴权,那么,第一设备本地并未保存该第一证书的证书ID,该情况下,当第一设备确定本地未保存第一证书ID,即认为对该第一证书ID的匹配验证通过,可以采用第一证书进行鉴权。
另一种情况下,当第一设备已使用过该第一证书进行鉴权,那么,第一设备本地保存有该第一证书的第二证书ID,该情况下,当第一设备确定本地保存第二证书ID和第一证书中的第一证书ID匹配,即认为对该第一证书ID的匹配验证通过,可以采用第一证书进行鉴权。
再一种情况下,当第一设备已使用过该第一证书进行鉴权,那么,第一设备本地保存有该第一证书的第二证书ID,但是由于该第一证书使用次数超过上限或者使用时间超过上限,第二证书ID被标记为失效状态,该情况下,当第一设备确定本地保存第二证书ID和第一证书中的第一证书ID匹配,但第二证书ID的状态为失效,则认为对该第一证书ID的匹配验证未通过,不可以再使用第一证书对第一设备进行鉴权。
作为另一个示例,该第一证书还可以包括目标有效信息,该目标有效信息被设备1用于确定能否继续使用证书1进行鉴权。S302还可以包括:第一设备根据实际使用信息,对目标有效信息进行验证,该实际使用信息用于表征第一设备上当前使用第一证书的情况。其中,目标有效信息为允许使用第一证书进行鉴权的最多次数(例如:5次),则,实际使用信息为所述第一设备截止当前使用第一证书进行鉴权的实际使用次数;或者,目标有效信息为允许使用第一证书进行鉴权的最长时间(例如:20小时),则,实际使用信息为从目标有效信息的计时起始时刻到当前时刻的实际使用时间。其中,第一证书可以在其扩展域中扩展用于承载该目标有效信息的字段。可以理解的是,当第一设备确定本地存储的实际使用信息达到该第一证书的目标有效信息时,第一设备可以将该第一证书吊销,如:将第一设备本地存储的第一证书对应的第二证书ID标记为失效。这样,通过第一设备本地存储的实际使用信息,对第一证书中携带的目标有效信息进行验证,实现对第一设备可靠和安全的鉴权。
作为再一个示例,第一证书还可以包括第二公钥,S302还可以包括:第一设备根据本地存储的第一公钥,对第二公钥进行验证。如果第一设备确定第一公钥和第二公钥不一致,则第一设备视作第二设备需要将已经不够安全的第一公钥和第一私钥进行更新,那么,本申请实施例还可以包括:第一设备将本地存储的第一公钥替换为第二公钥。这样,通过第一设备本地存储的第一公钥,对第一证书中携带的第二公钥进行验证,当公钥一致时指导第一设备对其使用权限的管理,实现对第一设备可靠和安全的鉴权;当公钥不一致时指导第一设备更新本地存储的公钥,完成第二设备对鉴权公私钥的更新,使得后续对第一设备的鉴权更加安全。
其中,第二公钥可以是方法100中的公钥2。
需要说明的是,本申请实施例中的方法300,具体实现方式以及达到的效果可以参见上述图3和图5所示实施例中的相关说明。
图7示出了本申请实施例中一种对第一设备的使用权限进行鉴权的方法400的流程示意图,该方法400应用在包括第一设备和第二设备的场景中,以第二设备为执行主体,该方法400例如可以包括:
S401,采用第一私钥对第一证书进行数字签名;
S402,向第一设备发送经过第一私钥进行数字签名的第一证书,以便第一设备基于第一证书确定第一设备的使用权限。
其中,第一设备可以是待鉴权的任何设备,例如:调试接口,第二设备可以是鉴权服务器。
其中,第二设备可以是方法100中的设备2,那么,第一设备为方法100中的设备1,第一私钥为方法100中的私钥1,第一公钥为方法100中的公钥1,第一证书为方法100中的证书1。或者,第二设备也可以是方法200中的CA服务器11,那么,第一设备为方法200中的交换机12,第一私钥为方法200中的私钥3,第一公钥为方法200中的公钥3。
这样,通过具有证书颁发功能和数字签名功能、安全等级较高的第二设备对第一证书进行数字签名,并将经过数字签名的第一证书发送给待鉴权的第一设备,从而由该第一设备对该数字签名后的第一证书进行验证,实现对待鉴权的第一设备的鉴权,克服了目前通过密码本或者接口对应焊盘裸露的等方式保护第一设备安全时存在的安全隐患,通过高安全等级的第二设备颁发的证书以及数字签名技术,确保了对待鉴权的第一设备的保护更加安全和可靠。
作为一个示例,该方法400中,第一证书中还可以包括第一设备标识信息,该第一设备标识信息被所述第一设备用于身份验证。例如:第一设备标识信息可以是第一设备ID或第一设备ID的哈希值。作为一个示例,方法400还可以包括:第二设备接收证书请求消息,该证书请求消息中包括第一设备标识ID;第二设备根据本地存储的第二设备ID,对第一设备ID进行匹配验证。作为另一个示例,该方法400还可以包括:第二设备接收证书请求消息,该证书请求消息中包括第一设备标识ID的哈希值;第二设备根据本地存储的第二设备ID的哈希值,对所述第一设备ID的哈希值进行匹配验证。匹配验证通过后,第二设备还可以将第一设备ID或第一设备ID的哈希值携带在第一证书中,发送给第一设备。这样,第二设备通过本地存储的第二设备ID或第二设备ID的哈希值,对证书请求消息中携带的第一设备ID或第一设备ID的哈希值进行验证,指导第二设备是否颁发第一证书给第一设备,从而使得对第一设备的鉴权更加可靠和安全。
其中,本申请实施例中设备ID为非公开的能够唯一标识设备的ID,例如:第一设备ID为第一设备出厂时定义的硬件唯一密钥HUK,又例如:第一设备ID为根据第一设备的晶片标识die ID和唯一设备标识UDI处理得到的。
作为再一个示例,该方法400中,第一证书中还可以包括目标有效信息,该目标有效信息被所述第一设备用于确定能否继续使用所述第一证书进行鉴权。例如:该目标有效信息具体可以为允许使用所述第一证书进行鉴权的最多次数,或者,该目标有效信息也可以为允许使用所述第一证书进行鉴权的最长时间。那么,本申请实施例还可以包括:第二设备接收证书请求消息,该证书请求消息中还可以包括目标有效信息。
作为又一个示例,该第一证书中还可以携带证书类型、第一设备标识信息和第一证书ID中的至少一个。第一证书中具体携带的内容以及对应的第一设备对第一证书的验证方式,可以参见方法300的相关说明。
需要说明的是,本申请实施例中的方法400,具体实现方式以及达到的效果可以参见上述图3、图5以及图6所示实施例中的相关说明。
此外,本申请实施例还提供了一种第一设备800,参见图8所示。该第一设备800包括收发单元801和处理单元802。其中,收发单元801用于执行上述图3所示实施例中设备1执行的收发操作,或者图5所示实施例中交换机12执行的收发操作,或者图6所示方法实施例中第一设备执行的收发操作;处理单元802用于执行上述图3所示实施例中设备1执行的除了收发操作以外的其他操作,或者图5所示实施例中交换机12执行的除了收发操作以外的其他操作,或者图6所示方法实施例中第一设备执行的除了收发操作以外的其他操作。例如:第一设备800为方法100中的设备1,那么,收发单元801用于执行获取证书1和签名1;所述处理单元802用于执行对证书1进行验证,获得验证结果1;所述处理单元802还用于根据验证结果1,确定设备1的使用权限。
此外,本申请实施例还提供了一种第二设备900,参见图9所示。该第二设备900包括收发单元901和处理单元902。其中,收发单元901用于执行上述图3所示实施例中设备2执行的收发操作,或者图5所示实施例中CA服务器11执行的收发操作,或者图7所示方法实施例中第二设备执行的收发操作;处理单元902用于执行上述图3所示实施例中设备2执行的除了收发操作以外的其他操作,或者图5所示实施例中CA服务器11执行的除了收发操作以外的其他操作,或者图7所示方法实施例中第二设备执行的除了收发操作以外的其他操作。例如:第二设备900为方法100中的设备2,那么,收发单元901用于向设备1发送经过私钥1进行数字签名的证书1;所述处理单元902用于采用私钥1对证书1进行数字签名。
此外,本申请实施例还提供了一种第一设备1000,参见图10所示。该第一设备1000包括通信接口1001和与通信接口1001连接的处理器1002。其中,其中,通信接口1001用于执行上述图3所示实施例中设备1执行的收发操作,或者图5所示实施例中交换机12执行的收发操作,或者图6所示方法实施例中第一设备执行的收发操作;处理器1002用于执行上述图3所示实施例中设备1执行的除了收发操作以外的其他操作,或者图5所示实施例中交换机12执行的除了收发操作以外的其他操作,或者图6所示方法实施例中第一设备执行的除了收发操作以外的其他操作。例如:第一设备1000为方法100中的设备1,那么,通信接口1001用于获取证书1和签名1;所述处理器1002用于执行对证书1进行验证,获得验证结果1;所述处理器1002还用于根据验证结果1,确定设备1的使用权限。
此外,本申请实施例还提供了一种第二设备1100,参见图11所示。该第二设备1100包括通信接口1101和与该通信接口1101连接的处理器1102。其中,通信接口1101用于执行上述图3所示实施例中设备2执行的收发操作,或者图5所示实施例中CA服务器11执行的收发操作,或者图7所示方法实施例中第二设备执行的收发操作;处理器1102用于执 行上述图3所示实施例中设备2执行的除了收发操作以外的其他操作,或者图5所示实施例中CA服务器11执行的除了收发操作以外的其他操作,或者图7所示方法实施例中第二设备执行的除了收发操作以外的其他操作。例如:第二设备1100为方法100中的设备2,那么,通信接口1101用于向设备1发送经过私钥1进行数字签名的证书1;所述处理器1102用于采用私钥1对证书1进行数字签名。
此外,本申请实施例还提供了一种第一设备1200,参见图12所示。该第一设备1200包括存储器1201和处理器1202。其中,存储器1201用于存储程序代码;处理器1202用于运行所述程序代码中的指令,使得该第一设备1200执行以上图3所示实施例中设备1执行的方法,或者图5所示实施例中交换机12执行的方法,或者图6所示方法实施例中第一设备执行的方法。
此外,本申请实施例还提供了一种第二设备1300,参见图13所示。该第二设备1300包括存储器1301和处理器1302。其中,存储器1301用于存储程序代码;处理器1302用于运行所述程序代码中的指令,使得该第二设备1300执行以上图3所示实施例中设备2执行的方法,或者图5所示实施例中CA服务器11执行的方法,或者图7所示方法实施例中第二设备执行的方法。
可以理解的是,上述实施例中,处理器可以是中央处理器(英文:central processing unit,缩写:CPU),网络处理器(英文:network processor,缩写:NP)或者CPU和NP的组合。处理器还可以是专用集成电路(英文:application-specific integrated circuit,缩写:ASIC),可编程逻辑器件(英文:programmable logic device,缩写:PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),通用阵列逻辑(英文:generic array logic,缩写:GAL)或其任意组合。处理器可以是指一个处理器,也可以包括多个处理器。存储器可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);存储器也可以包括非易失性存储器(英文:non-volatile memory),例如只读存储器(英文:read-only memory,缩写:ROM),快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);存储器还可以包括上述种类的存储器的组合。存储器可以是指一个存储器,也可以包括多个存储器。在一个具体实施方式中,存储器中存储有计算机可读指令,所述计算机可读指令包括多个软件模块,例如发送模块,处理模块和接收模块。处理器执行各个软件模块后可以按照各个软件模块的指示进行相应的操作。在本实施例中,一个软件模块所执行的操作实际上是指处理器根据所述软件模块的指示而执行的操作。处理器执行存储器中的计算机可读指令后,可以按照所述计算机可读指令的指示,执行第一设备或第二设备可以执行的全部操作。
可以理解的是,上述实施例中,第一设备1000的通信接口1001,具体可以被用作第一设备800中的收发单元801,实现第一设备和第二设备之间的数据通信。同理,第二设备1100的通信接口1101,具体可以被用作第二设备900中的收发单元901,实现第一设备 和第二设备之间的数据通信。
此外,本申请实施例还提供了一种通信系统1400,参见图14所示。该通信系统1400包括第一设备1401以及第二设备1402,其中,第一设备1401具体可以是上述第一设备800、第一设备1000或第一设备1200,第二设备1402具体可以是上述第二设备900、第二设备1100或第二设备1300。
此外,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得所述计算机执行以上图3、图5-图7所示实施例中的所述鉴权方法。
此外,本申请实施例还提供了计算机程序产品,当其在计算机上运行时,使得计算机执行前述图3、图5-图7所示实施例中的所述鉴权方法。
本申请实施例中提到的“第一证书”、“第一私钥”等名称中的“第一”只是用来做名字标识,并不代表顺序上的第一。该规则同样适用于“第二”等。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到上述实施例方法中的全部或部分步骤可借助软件加通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如只读存储器(英文:read-only memory,ROM)/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者诸如路由器等网络通信设备)执行本申请各个实施例或者实施例的某些部分所述的方法。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例和设备实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述仅是本申请的优选实施方式,并非用于限定本申请的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。

Claims (26)

  1. 一种鉴权方法,其特征在于,由第一设备实施,包括:
    获取采用第一私钥进行数字签名的第一证书;
    对所述第一证书进行验证,获得第一验证结果;
    根据所述第一验证结果,确定所述第一设备的使用权限。
  2. 根据权利要求1所述的方法,其特征在于,所述对所述第一证书进行验证,包括:
    根据本地存储的与所述第一私钥对应的第一公钥,对所述第一证书进行验证。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一证书中包括证书类型,所述对所述第一证书进行验证,还包括:
    验证所述证书类型。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述第一证书中还包括第一设备标识信息,所述对所述第一证书进行验证,还包括:
    基于本地存储的所述第一设备的第二设备标识信息,对所述第一证书携带的所述第一设备标识信息进行匹配验证,其中,所述第二设备标识信息用于唯一的标识所述第一设备。
  5. 根据权利要求4所述的方法,其特征在于,
    所述第一设备标识信息为第一设备标识ID,所述第二设备标识信息为第二设备ID;或者
    所述第一设备标识信息为所述第一设备ID的哈希值,所述第二设备标识信息为所述第二设备ID的哈希值。
  6. 根据权利要求4或5所述的方法,其特征在于,所述第二设备ID为所述第一设备出厂时定义的硬件唯一密钥HUK,或者,所述第二设备ID为根据所述第一设备的晶片标识die ID和唯一设备标识UDI处理得到的。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述第一证书还包括第一证书标识ID,所述对所述第一证书进行验证,还包括:
    根据本地存储的第二证书ID,对所述第一证书ID进行匹配验证。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述第一证书还包括目标有效信息,所述对所述第一证书进行验证,还包括:
    根据实际使用信息,对所述目标有效信息进行验证,所述实际使用信息用于表征所述第一设备上当前使用所述第一证书的情况。
  9. 根据权利要求8所述的方法,其特征在于,
    所述目标有效信息为允许使用所述第一证书进行鉴权的最多次数;
    或者,
    所述目标有效信息为允许使用所述第一证书进行鉴权的最长时间。
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述第一证书还包括第二公钥,所述对所述第一证书进行验证,还包括:
    根据本地存储的第一公钥,对所述第二公钥进行验证。
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:
    所述第二公钥和所述第一公钥不一致,则,将本地存储的所述第一公钥替换为所述第二公钥。
  12. 根据权利要求1-11任一项所述的方法,其特征在于,所述第一设备为调试接口。
  13. 一种对第一设备的使用权限进行鉴权的方法,其特征在于,由第二设备实施,包括:
    采用第一私钥对第一证书进行数字签名;
    向所述第一设备发送经过所述第一私钥进行数字签名的所述第一证书,以对所述第一设备的使用权限进行鉴权。
  14. 根据权利要求13所述的方法,其特征在于,所述第一证书还包括第一设备标识信息,所述第一设备标识信息被所述第一设备用于身份验证。
  15. 根据权利要求14所述的方法,其特征在于,
    所述第一设备标识信息为第一设备标识ID或所述第一设备ID的哈希值。
  16. 根据权利要求15所述的方法,其特征在于,所述第一设备ID为所述第一设备出厂时定义的硬件唯一密钥HUK,或者,所述第一设备ID为根据所述第一设备的晶片标识die ID和唯一设备标识UDI处理得到的。
  17. 根据权利要求13-16任一项所述的方法,其特征在于,所述第一证书中还包括目标有效信息,所述目标有效信息被所述第一设备用于确定能否继续使用所述第一证书进行鉴权,所述目标有效信息为允许使用所述第一证书进行鉴权的最多次数,或者,所述目标有效信息为允许使用所述第一证书进行鉴权的最长时间。
  18. 根据权利要求13-17任一项所述的方法,其特征在于,所述第一证书中还携带证书类型、第一设备标识信息和第一证书ID中的至少一个。
  19. 根据权利要求13-18任一项所述的方法,其特征在于,所述第二设备为鉴权服务器。
  20. 根据权利要求13-19任一项所述的方法,其特征在于,所述第一设备为调试接口。
  21. 一种第一设备,其特征在于,包括:
    通信接口;和
    与所述通信接口连接的处理器;
    根据所述通信接口和所述处理器,所述第一设备用于执行前述权利要求1-12任一项所述的方法。
  22. 一种第二设备,其特征在于,包括:
    通信接口;和
    与所述通信接口连接的处理器;
    根据所述通信接口和所述处理器,所述第二设备用于执行前述权利要求13-20任一项所述的方法。
  23. 一种第一设备,其特征在于,所述第一设备包括存储器和处理器;
    所述存储器,用于存储程序代码;
    所述处理器,用于运行所述程序代码中的指令,使得所述第一设备执行以上权利要求1-12任一项所述的方法。
  24. 一种第二设备,其特征在于,所述第二设备包括存储器和处理器;
    所述存储器,用于存储程序代码;
    所述处理器,用于运行所述程序代码中的指令,使得所述第二设备执行以上权利要求13-20任一项所述的方法。
  25. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得所述计算机执行以上权利要求1-12或者权利要求13-20任意一项所述的方法。
  26. 一种通信系统,其特征在于,包括权利要求21或23所述的第一设备以及权利要求22或24所述的第二设备。
PCT/CN2020/116535 2019-12-26 2020-09-21 鉴权方法和设备 WO2021128988A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911370614.8A CN111147259B (zh) 2019-12-26 2019-12-26 鉴权方法和设备
CN201911370614.8 2019-12-26

Publications (1)

Publication Number Publication Date
WO2021128988A1 true WO2021128988A1 (zh) 2021-07-01

Family

ID=70520660

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116535 WO2021128988A1 (zh) 2019-12-26 2020-09-21 鉴权方法和设备

Country Status (2)

Country Link
CN (1) CN111147259B (zh)
WO (1) WO2021128988A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115062290A (zh) * 2022-02-28 2022-09-16 华为技术有限公司 一种组件认证方法及装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111147259B (zh) * 2019-12-26 2022-01-14 华为技术有限公司 鉴权方法和设备
CN112769854A (zh) * 2021-01-21 2021-05-07 北京信安世纪科技股份有限公司 一种支持多种数字身份信息的安全协议认证方法和系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060200857A1 (en) * 2005-03-07 2006-09-07 Tomofumi Yokota Certificate acquisition system, certificate acquisition method, management communication apparatus, certification authority, and computer readable recording medium
CN101296148A (zh) * 2008-06-26 2008-10-29 蓝汛网络科技(北京)有限公司 一种多媒体内容的合法性验证方法、系统及装置
CN106331974A (zh) * 2015-07-02 2017-01-11 Gn瑞声达 A/S 听力设备中的权限管理
US20180248702A1 (en) * 2015-11-06 2018-08-30 Huawei International Pte. Ltd. System and method for managing installation of an application package requiring high-risk permission access
CN108521333A (zh) * 2018-04-27 2018-09-11 飞天诚信科技股份有限公司 一种基于动态口令进行离线认证的登录方法及系统
CN111147259A (zh) * 2019-12-26 2020-05-12 华为技术有限公司 鉴权方法和设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09307544A (ja) * 1996-05-16 1997-11-28 Nippon Telegr & Teleph Corp <Ntt> 可搬型暗号鍵認証システム
CN102315996B (zh) * 2011-10-21 2015-04-01 北京海西赛虎信息安全技术有限公司 网络准入控制方法及系统
CN103825741B (zh) * 2014-01-24 2017-03-15 安徽云盾信息技术有限公司 一种加密设备生产过程中注入带签名的证书的解决方法
CN108259413B (zh) * 2016-12-28 2021-06-01 华为技术有限公司 一种获取证书、鉴权的方法及网络设备
CN106878009B (zh) * 2017-02-21 2021-04-09 蔚来(安徽)控股有限公司 密钥更新方法及系统
CN110414248B (zh) * 2019-07-11 2021-03-12 珠海格力电器股份有限公司 一种调试微处理器的方法及微处理器

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060200857A1 (en) * 2005-03-07 2006-09-07 Tomofumi Yokota Certificate acquisition system, certificate acquisition method, management communication apparatus, certification authority, and computer readable recording medium
CN101296148A (zh) * 2008-06-26 2008-10-29 蓝汛网络科技(北京)有限公司 一种多媒体内容的合法性验证方法、系统及装置
CN106331974A (zh) * 2015-07-02 2017-01-11 Gn瑞声达 A/S 听力设备中的权限管理
US20180248702A1 (en) * 2015-11-06 2018-08-30 Huawei International Pte. Ltd. System and method for managing installation of an application package requiring high-risk permission access
CN108521333A (zh) * 2018-04-27 2018-09-11 飞天诚信科技股份有限公司 一种基于动态口令进行离线认证的登录方法及系统
CN111147259A (zh) * 2019-12-26 2020-05-12 华为技术有限公司 鉴权方法和设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115062290A (zh) * 2022-02-28 2022-09-16 华为技术有限公司 一种组件认证方法及装置

Also Published As

Publication number Publication date
CN111147259B (zh) 2022-01-14
CN111147259A (zh) 2020-05-12

Similar Documents

Publication Publication Date Title
US10063594B2 (en) Network access control with compliance policy check
US11036869B2 (en) Data security with a security module
WO2021128988A1 (zh) 鉴权方法和设备
US9542568B2 (en) Systems and methods for enforcing third party oversight of data anonymization
US10211977B1 (en) Secure management of information using a security module
CN105144626B (zh) 提供安全性的方法和设备
JP2018121328A (ja) 電子デバイスのためのイベント証明書
KR20190063264A (ko) 가상 트러스트 컴퓨팅 베이스를 이용한 기기 보안성 검증 방법 및 장치
US9332007B2 (en) Method for secure, entryless login using internet connected device
CN110795126A (zh) 一种固件安全升级系统
JP2013516685A (ja) コンピューターポリシーを施行するためのシステムおよび方法
CN106161024B (zh) 一种usb控制芯片级的usb设备可信认证方法及其系统
CN107798258B (zh) 用于认证针对固态驱动器的关键操作的系统和方法
KR101078546B1 (ko) 범용 저장장치의 식별정보를 기반으로 하는 보안 데이터 파일 암호화 및 복호화 장치, 그를 이용한 전자 서명 시스템
TW202036347A (zh) 資料儲存、驗證方法及裝置
TW201706898A (zh) 安全軟體認證及驗證
US20080126802A1 (en) Inter-system binding method and application based on hardware security unit
CN106687985A (zh) 用于基于特权模式的安全输入机构的方法
US20080184028A1 (en) Methods, Apparatus and Products for Establishing a Trusted Information Handling System
CN112311718A (zh) 检测硬件的方法、装置、设备及存储介质
WO2021128989A1 (zh) 鉴权方法及设备
Alzomai et al. The mobile phone as a multi OTP device using trusted computing
CN105873043B (zh) 一种用于移动终端的网络私匙的生成及应用方法及其系统
US20220245286A1 (en) Method for protecting device software integrity in continuity scenario
CN116561734A (zh) 一种验证方法、装置、计算机及计算机配置系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20907775

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20907775

Country of ref document: EP

Kind code of ref document: A1