WO2023246695A1 - 设备授权方法及电子设备、系统 - Google Patents

设备授权方法及电子设备、系统 Download PDF

Info

Publication number
WO2023246695A1
WO2023246695A1 PCT/CN2023/101051 CN2023101051W WO2023246695A1 WO 2023246695 A1 WO2023246695 A1 WO 2023246695A1 CN 2023101051 W CN2023101051 W CN 2023101051W WO 2023246695 A1 WO2023246695 A1 WO 2023246695A1
Authority
WO
WIPO (PCT)
Prior art keywords
credential
public key
accessory device
main control
control device
Prior art date
Application number
PCT/CN2023/101051
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 WO2023246695A1 publication Critical patent/WO2023246695A1/zh

Links

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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/085Secret sharing or secret splitting, e.g. threshold schemes
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/088Usage controlling of secret information, e.g. techniques for restricting cryptographic keys to pre-authorized uses, different access levels, validity of crypto-period, different key- or password length, or different strong and weak cryptographic algorithms
    • 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/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • 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
    • 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/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN
    • H04L9/3228One-time or temporary data, i.e. information which is sent for every authentication or authorization, e.g. one-time-password, one-time-token or one-time-key
    • 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

  • the present invention relates to the field of terminal technology, and in particular, to a device authorization method, electronic device, and system.
  • IoT devices such as smart speakers, smart locks, smart cameras and smart TVs.
  • these devices also called accessory devices
  • these devices need to be authorized for use by other users in some scenarios.
  • the owner of a smart camera can authorize other family members or friends to access the smart camera.
  • the interconnection between these devices requires the establishment of trusted and secure connection channels.
  • user A’s main control device needs to share its accessory devices (such as the first accessory device and the second accessory device) with user B’s device (authorized device) before or after use.
  • the main control device, the first accessory device and the second accessory device all log in to user A's account to connect to its device cloud, and synchronize the authorization information of the accessory devices to be shared.
  • the main control device synchronizes its device identification DevID_1, public key PK_1, local Save its private key SP_1; the first accessory device synchronizes its device identification DevID_2 and public key PK_2 (that is, the credentials required to access it), and locally saves its private key SP_2; the second accessory device synchronizes its device identification DevID_3 and symmetric key Key1 (that is, the credentials required to access it).
  • the authorized device also needs to log in to user B's account to connect to its device cloud, synchronize its public key PK_3, and save its private key SP_3 locally.
  • the public key that is, the public key of PK_3
  • the specific authorization process may include:
  • User authorization that is, user A sends an authorization request to its device cloud through the main control device to request that the first accessory device and the second accessory device be authorized to user B.
  • User A’s device cloud synchronizes authorization information to user B’s device cloud.
  • User B's device cloud synchronizes authorization information to the authorized device, that is, synchronizes mutual trust credentials.
  • the above method relies on cloud processing.
  • the accessory device cannot be authorized for use by other devices other than the main control device.
  • Embodiments of this application provide a device authorization method, electronic devices, and systems that do not rely on cloud processing and can be authorized offline.
  • an embodiment of the present invention provides a device authorization method, including;
  • the main control device is bound to the accessory device, and the first credential and the second credential are negotiated; the first credential is not distributable and is used for authentication of the main control device; the second credential is distributable and is used for authentication of the authorized device certification;
  • the master device In response to the sharing operation for the second credential, the master device sends the second credential to the authorized device when the attribute of the second credential is distributable.
  • the above method generates two credentials, one non-distributable for authentication between the main control device and the accessory device, and one distributable for authentication between the authorized device and the accessory device, which ensures access to the main control device.
  • the credentials of the accessory device are secure and can be used offline. It does not rely on cloud processing and has a wider range of application scenarios.
  • the main control device is bound to the accessory device and negotiates the first credential and the second credential, including:
  • the main control device establishes a communication connection with the accessory device
  • the main control device generates a shared key based on the out-of-band shared password; the out-of-band shared password is used to bind the accessory device; the accessory device includes the shared key or has been generated based on the out-of-band shared password the shared key;
  • the main control device negotiates the first credential with the accessory device based on the shared key
  • the main control device negotiates the second credential with the accessory device based on the shared key.
  • the accessory device includes a first public key and a first private key corresponding to the first public key
  • the main control device includes a second public key and a first private key corresponding to the second public key.
  • the second private key, the main control device negotiates with the accessory device to obtain the first credential based on the shared key, including:
  • the main control device exchanges public keys with the accessory device based on the shared key to obtain the first public key
  • the main control device stores the first credential, and the first credential stored by the main control device includes: the first public key, the second public key and the second private key; the accessory
  • the first credentials stored by the device include: the first public key, the first private key and the second public key.
  • the accessory device includes a third public key and a third private key corresponding to the third public key
  • the main control device includes a fourth public key and a third private key corresponding to the fourth public key.
  • the fourth private key, the main control device negotiates with the accessory device to obtain the second credential based on the shared key, including:
  • the main control device exchanges public keys with the accessory device based on the shared key to obtain the third public key;
  • the main control device stores the second credential, and the second credential stored by the main control device includes the third public key, the fourth public key and the fourth private key; the accessory device
  • the stored second credentials include the third public key, the third private key, and the fourth public key.
  • the second credential sent to the authorized device includes the fourth public key; or includes the fourth public key, the third public key and the fourth public key.
  • the second credential sent to the authorized device includes the third public key and the fourth public key, and the method further includes:
  • the master control device receives a signature request from the authorized request, the signature request carries the fifth public key, and the fifth public key is the public key of the authorized device;
  • the main control device signs the fifth public key through the fourth private key to obtain a digital signature
  • the main control device sends the digital signature to the authorized device, and the digital signature is used for the authorized device to authenticate to the accessory device.
  • the method further includes:
  • the main control device responds to the input user operation and sets the management policy of the first credential and the management policy of the second credential.
  • the management policy includes the number of times that can be connected, the length of time that can be connected, accessible data and/or or at least one of the businesses;
  • the main control device sends the management policy of the first credential and the management policy of the second credential to the accessory device.
  • embodiments of the present application also provide a device authentication method, including;
  • the accessory device is bound to the main control device and negotiates the first credential and the second credential; the first credential is not distributable and is used for authentication of the main control device; the second credential is distributable and is used for authentication of the authorized device certification;
  • the accessory device receives a first authentication request from the authorized device.
  • the first authentication request includes first information and verification information.
  • the verification information is based on the second credential stored in the main control device. Obtained by first information processing;
  • the accessory device verifies the verification information based on the local second credential
  • the accessory device When the accessory device passes the verification, it sends indication information indicating that the authentication has passed to the authorized device.
  • the above method generates two credentials, one non-distributable for authentication between the main control device and the accessory device, and one distributable for authentication between the authorized device and the accessory device, which ensures access to the main control device.
  • the credentials of the accessory device are secure and can be used offline. It does not rely on cloud processing and has a wider range of application scenarios.
  • the second credential stored by the main control device includes the third public key, the fourth public key and the fourth private key; the second credential stored by the accessory device
  • the credentials include the third public key, the third private key, and the fourth public key.
  • the first information is a first string
  • the verification information is a first digital signature
  • the first digital signature is the first string using the fourth private key.
  • the accessory device verifies the verification information based on the local second credential, including:
  • the accessory device decrypts the first digital signature through the local third public key to obtain a digest value
  • the accessory device calculates a digest value of the first string
  • the method further includes: the authorized device includes a fifth public key and a fifth private key corresponding to the fifth public key. key, the first information is the fifth public key, the verification information is a third digital signature, and the third digital signature is a signature of the fifth public key using the third private key;
  • the accessory device verifies the verification information based on the local second credential, including:
  • the accessory device decrypts the third digital signature using the local third public key to obtain a digest value
  • the accessory device calculates a digest value of the fifth public key
  • the method further includes:
  • the accessory device uses the third private key to sign the second string to obtain a second digital signature
  • the accessory device sends a second authentication request to the authorized device, the second authentication request includes the second character and the second digital signature; the second digital signature is used by the authorized device based on Local third public key signature verification.
  • the second credential is a symmetric key; the first information is a string; the verification information is the MAC value of the first information; the accessory device is based on the local The second credential verifies the verification information, including:
  • the accessory device decrypts the verification information through the locally stored second credential to obtain the digest value
  • the accessory device calculates a summary value of the first information
  • the method further includes:
  • the accessory device receives the management policy of the first credential and the management policy of the second credential, where the management policy includes at least one of the number of times that can be connected, the length of time that can be connected, and accessible data and/or services;
  • the accessory device receives the access request
  • the accessory device When the access request originates from the main control device, the accessory device responds to the access request through the management policy of the first credential;
  • the accessory device responds to the access request through the management policy of the second credential.
  • the above method can realize different access management for different credentials and can improve the security of internal data of accessory devices.
  • the management policy through the second credential responds to the access request, including at least one of the following steps:
  • N is a positive integer
  • the above method can realize different access management for different credentials and can improve the security of internal data of accessory devices.
  • embodiments of the present application also provide a device authentication method, including;
  • the accessory device is bound to the main control device and the first credential is negotiated.
  • the accessory device receives an authentication request from the authorized device.
  • the authentication request includes a third credential and the verification information.
  • the verification information is the verification of the third credential by the main control device based on the locally stored first credential. Obtained by processing three credentials;
  • the accessory device verifies the verification information through the local first credential
  • the accessory device When the accessory device passes the authentication, it sends indication information indicating that the authentication has passed to the authorized device.
  • the above method uses the master device to endorse the credentials of the authorized device without sending the credentials of the master device to it, which can ensure the security of the credentials of the master device when accessing the accessory device, and can be used offline without relying on Cloud processing has a wider range of application scenarios.
  • the first credential includes the first public key of the accessory device, the first private key corresponding to the first public key, the second public key of the main control device and the The second private key corresponding to the second public key;
  • the third credential is the public key or symmetric key of the authorized device;
  • the verification information is the third credential stored by the main control device Signature of the second private key; the accessory device verifies the verification information through the local first credential, including:
  • the accessory device verifies the signature of the third credential through the second public key, and when the verification passes, the verification passes.
  • the first credential includes a first symmetric key
  • the verification information is the MAC value of the third credential calculated using the first symmetric key stored in the master control device.
  • the accessory device verifies the verification information through the local first credential, including:
  • the accessory device calculates the MAC value of the third credential through the local first symmetric key
  • the accessory device determines that the verification is passed when the calculated MAC value is the same as the MAC value carried in the authentication request.
  • the method further includes:
  • the accessory device receives the management policy of the first credential and the management policy of non-first credentials, where the management policy includes at least one of the number of times that can be connected, the length of time that can be connected, and accessible data and/or services;
  • the accessory device receives the access request
  • the accessory device When the access request originates from the main control device, the accessory device responds to the access request through the management policy of the first credential;
  • the accessory device responds to the access request through the management policy of the non-first credential.
  • responding to the access request through the management policy of the non-first credential includes at least one of the following steps:
  • N is a positive integer
  • embodiments of the present application also provide a device authentication method, including:
  • the authorized device sends an endorsement request to the master device, where the endorsement request includes the third credential;
  • the authorized device receives verification information from the main control device, where the verification information is obtained by the main control device processing the third credential based on the locally stored first credential; the first credential is Trusted communication between the main control device and the accessory device;
  • the authorized device sends an authentication request to the accessory device, where the authentication request includes a third credential and the verification information, so that the accessory device verifies the verification information through the local first credential.
  • the above method uses the master device to endorse the credentials of the authorized device without sending the credentials of the master device to it, which can ensure the security of the credentials of the master device when accessing the accessory device, and can be used offline without relying on Cloud processing has a wider range of application scenarios.
  • the first credential includes the first public key of the accessory device, the first private key corresponding to the first public key, the second public key of the main control device and the The second private key corresponding to the second public key;
  • the third credential is the public key or symmetric key of the authorized device;
  • the verification information is the third credential stored by the main control device Signature of the second private key;
  • the first credential includes a first symmetric key
  • the verification information is the MAC value of the third credential calculated using the first symmetric key stored in the master control device.
  • embodiments of the present application further provide an electronic device, including at least one processor and at least one memory, the at least one processor is coupled to the at least one memory, and the at least one memory is used to store computer instructions,
  • the electronic device executes the computer instructions, the electronic device performs the method performed by the main control device in the first aspect or any implementation thereof, or performs the method performed by the main control device in the second aspect or the third aspect or any implementation thereof.
  • the above-mentioned electronic device may also include other elements or modules used to implement the above-mentioned first aspect or any one of the possible implementation methods of the first aspect, or include other elements or modules used to implement the above-mentioned second to third aspects.
  • any one of the possible elements or modules for implementing the method in the second to third aspects including other elements or modules used to implement the above-mentioned fourth aspect or any one of the possible methods of the fourth aspect.
  • each step executed by the processor in the electronic device and the beneficial effects achieved please refer to the relevant descriptions in the above first to fourth aspects or any of their possible implementations, and will not be described again here.
  • embodiments of the present application further provide a communication system, which may include a master control device, an authorized device, and an accessory device, wherein the master control device is used to implement the above first aspect or any one of the first aspects.
  • a communication system which may include a master control device, an authorized device, and an accessory device, wherein the master control device is used to implement the above first aspect or any one of the first aspects.
  • accessory equipment is used to implement the second to third aspects or any one of the second to third aspects, a possible implementation of the method, and the authorized equipment is used to implement the fourth aspect or the fourth aspect Any possible way to implement the method.
  • embodiments of the present application further provide a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer program instructions, and when executed by a processor, the computer program instructions cause the The processor executes the method executed by the main control device as described in the first aspect or any implementation thereof, or executes the method executed by the accessory device as described in the second aspect or the third aspect or any implementation thereof, or Perform the method performed by the authorized device as described in the fourth aspect or any implementation thereof.
  • Figure 1 is a schematic illustration of a device authorization method provided by the prior art
  • Figure 2A is a schematic architectural diagram of a communication system provided by an embodiment of the present application.
  • Figure 2B is an architectural schematic diagram of yet another communication system provided by an embodiment of the present application.
  • Figure 2C is an architectural schematic diagram of another communication system provided by an embodiment of the present application.
  • Figure 3 is a schematic illustration of a device authorization method provided by an embodiment of the present application.
  • Figure 4 is a schematic flowchart of a device authorization method provided by an embodiment of the present application.
  • Figure 5 is a schematic flowchart of a binding method between a main control device and an accessory device provided by an embodiment of the present application
  • FIGS 6A-6C are schematic flow charts of some authentication methods provided by embodiments of the present application.
  • Figure 6D is a schematic flowchart of a method for processing an access request according to the management policy of the second credential provided by an embodiment of the present application
  • Figure 7 is a schematic flow chart of yet another device authorization and authentication method provided by an embodiment of the present application.
  • Figure 8 is a schematic illustration of a device authorization method provided by an embodiment of the present application.
  • Figure 9 is a schematic flowchart of a device authorization method provided by an embodiment of the present application.
  • Figure 10 is a schematic flowchart of yet another device authorization and authentication method provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • first and second are used for descriptive purposes only and shall not be understood as implying or implying relative importance or implicitly specifying the quantity of indicated technical features. Therefore, the features defined as “first” and “second” may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, “plurality” The meaning is two or more.
  • credentials can be used to authenticate identity legitimacy to achieve trusted communication between two devices.
  • credentials may also be used for encryption of transmitted data.
  • symmetric credentials mean that both parties in the communication use the same credentials.
  • Asymmetric credentials mean that the two parties to the communication use different credentials.
  • an authentication code is a symmetric credential where trusted communicating parties can negotiate/exchange the same secret in advance.
  • the authentication symmetric key is a symmetric credential that requires the communicating parties to negotiate and share the symmetric key in advance.
  • the sender and receiver can also use the same symmetric key to encrypt and decrypt the data to be transmitted.
  • the combination of the authentication public key and the private key is an asymmetric credential.
  • the communicating parties can exchange their respective public keys and save their own private keys. Both communicating parties can encrypt with the other party's public key and decrypt with their own private key; the sender can use his own private key to sign, and the receiver can use the public key of the sender to verify the signature.
  • the main control device and the accessory device can exchange their respective public keys, and the main control device can use its own private key to sign the credentials (which can be symmetric credentials or asymmetric credentials) sent by the authorized device. , that is, endorsement by the authorized device, and the authorized device uses the signed credentials to authenticate to the accessory device.
  • the credentials which can be symmetric credentials or asymmetric credentials
  • credentials can be set with attributes, one of which attributes can include direct and indirect.
  • Credentials with attributes of direct and indirect are respectively called direct credentials and indirect credentials.
  • direct credentials are used for communication between the accessory device and its main control device
  • indirect credentials are used for communication between the accessory device and the authorized device. It can also be said that direct credentials are credentials that are directly used by authorized devices and accessory devices, and indirect credentials are credentials that are not used directly by the main control device but are used by authorized devices.
  • Authentication is to confirm that the identity of the other party is legitimate.
  • the private key and symmetric key in the asymmetric key can represent the identity.
  • Authentication does not lie in the confidentiality of the transmitted data, but in verifying whether the other party actually holds the private key and symmetric key.
  • private keys and symmetric keys are generally not transmitted directly during the authentication process, but "zero knowledge proof" technology is used.
  • the sender Before sending data D, the sender first uses the hash function negotiated by the communicating parties to calculate its digest value, and further uses its own private key to encrypt the digest value.
  • the resulting ciphertext is the signature or message authentication code (message authentication code, MAC), send the signature (MAC value) and data D together to the recipient.
  • message authentication code messages authentication code, MAC
  • Signature verification After receiving the message, the receiver uses the sender's public key to decrypt the signature and obtains the digest value; calculates the digest value using the data in the message through the same operation as the sender; then calculates the digest value Compare it with the decrypted digest value. If the two are consistent, it means that the data D has not been tampered with. If they are inconsistent, it means that the data D has been tampered with.
  • Figure 2A shows an architectural diagram of a communication system provided by an embodiment of the present application.
  • the communication system may include but is not limited to a main control device 11, an accessory device 12 and an authorized device 13.
  • the accessory device 12 may be a smart home device such as a smart speaker, a smart camera, a smart lock, a smart TV, a lamp, an air conditioner, a rice cooker, a water heater, a sweeping robot, or other office equipment or other devices such as a printer or a projector.
  • a smart home device such as a smart speaker, a smart camera, a smart lock, a smart TV, a lamp, an air conditioner, a rice cooker, a water heater, a sweeping robot, or other office equipment or other devices such as a printer or a projector.
  • the master control device 11 or the authorized device 13 may be a terminal device such as a mobile phone, a tablet computer, or a laptop computer.
  • the main control device 11 may be a device bound to the accessory device 12 . After the main control device 11 establishes a communication connection with the accessory device 12, it can generate at least one credential based on an out-of-band shared password or agreed information. This credential can be used as a key for the main control device 11 or the authorized device 13 to access or control the accessory device 12. Credentials.
  • the authorized device When authorizing an accessory device to be used by an authorized device, the authorized device needs to be authenticated based on credentials to ensure secure and trusted communication between devices.
  • two credentials may be generated, namely a direct credential (also called a first credential) and an indirect credential (also called a second credential).
  • the main control device 11 can establish trusted communication with the spare accessory device 12 through direct credentials.
  • the master device 11 can send the indirect credentials to the authorized device 13, and the authorized device 13 establishes a trusted communication connection with the accessory device based on the indirect credentials.
  • Embodiment 1 and Embodiment 2 which will not be described again here.
  • At least one asymmetric credential may be generated.
  • the authorized device 13 can send an endorsement request to the master device 11 to request it to endorse its own credentials (which can be symmetric credentials or asymmetric credentials, referred to as third credentials in this embodiment).
  • the master device 11 can Sign the third credential with your own private key, and send the signature of the third credential to the authorized device 13 .
  • the authorized device 13 can establish a trusted communication connection with the accessory device based on the signature of the third credential.
  • Embodiment 3 and Embodiment 4 which will not be described again here.
  • FIG. 2B it is an architectural diagram of another communication system provided by an embodiment of the present application, in which:
  • the main control device 11 may include a first credential negotiation module 111, a first credential sharing module 112, and a credential attribute setting module 113.
  • the first credential negotiation module 111 is used to negotiate with the accessory device 12 to obtain at least one credential, such as the first credential and the second credential;
  • the first credential sharing module 112 is used to determine the credential to be shared based on the attributes of the credential (such as the second credential). Credential) can be shared. If it can be shared, share the second credential to the sharing authorized device 13;
  • the credential attribute setting module 113 is used to set the attributes of the credential, for example, set the attributes of the first credential to direct, not distributable, and the second credential.
  • the attributes of the credential are indirect and distributable;
  • the first credential sharing module 112 is used to share the second credential to the sharing authorized device 13 .
  • the authorized device 13 may include a second credential sharing module 131 and a second credential trusted exchange module 132 .
  • the second credential sharing module 131 is used to receive the second credential shared by the main control device 11, and further send the credential to the accessory device 12 through the second credential trusted exchange module 132 to verify the identity, and receive from Verification results of accessory device 12.
  • the accessory device 12 may include a second credential negotiation module 121, a credential access control module 122, a first credential trusted exchange module 123, and a data/service module 124.
  • the second credential negotiation module 121 is used to negotiate with the main control device 11 to obtain at least one credential, such as a first credential and a second credential.
  • the credential access control module 122 is used for credential-based management policies to determine the number of times of access, the length of access, and the accessible data and/or services corresponding to the credential.
  • the first credential trusted exchange module 123 is used to verify the identity of the authorized device based on the second credential.
  • the data/service module 124 is used to store data and services to process access requests from the master device 11 and the authorized device 13 .
  • Embodiment 1 and Embodiment 2 please refer to Embodiment 1 and Embodiment 2, which will not be described again here.
  • FIG. 2C it is an architectural diagram of another communication system provided by an embodiment of the present application, in which:
  • the main control device 11 may include a first credential negotiation module 111 and a credential endorsement module 114 .
  • the first credential negotiation module 111 is used to negotiate with the accessory device 12 to obtain at least one credential, such as the first credential;
  • the credential endorsement module 114 is used to sign the credential (ie, the third credential) from the authorized device to endorse it. , and sends the signature of the third credential to the authorized device 13 .
  • the authorized device 13 may include a credential request endorsement module 133 and a second credential trusted exchange module 132 .
  • the credential request endorsement model Block 133 is used to send an endorsement request to the master device 111 to request the master device 11 to endorse its credentials (third credentials) and accept the signature of the third credentials sent by the master device 11; further, the second credentials can be used
  • the letter exchange module 132 sends the third credential and the signature of the third credential to the accessory device 12 to verify the identity, and receives the verification result from the accessory device 12 .
  • the accessory device 12 may include a second credential negotiation module 121, a credential access control module 122, a first credential trusted exchange module 123, and a data/service module 124.
  • the second credential negotiation module 121 is used to negotiate with the main control device 11 to obtain at least one credential, such as the first credential.
  • the credential access control module 122 is used for credential-based management policies to determine the number of times of access, the length of access, and the accessible data and/or services corresponding to the credential.
  • the first credential trusted exchange module 123 is configured to verify the identity of the authorized device based on the signature of the third credential.
  • the data/service module 124 is used to store data and services to process access requests from the master device 11 and the authorized device 13 .
  • Embodiment 3 and Embodiment 4 please refer to Embodiment 3 and Embodiment 4, which will not be described again here.
  • FIGs 3 and 4 there are schematic illustrations and flow diagrams of the device authorization method.
  • This method can be implemented by the system shown in Figure 2A or Figure 2B, and can include three stages of authorization, authentication and data access.
  • the main control device is bound to the accessory device, and the first credential and the second credential are negotiated.
  • the attributes of the first credential include direct and non-distributable; the attributes of the second credential are indirect and distributable.
  • the main control device and the accessory device can establish a communication connection through Bluetooth, WIFI and other communication methods, and bind the accessory device.
  • a credential for establishing trusted communication between the main control device and the accessory device that is, the first credential
  • a certificate for authorizing the establishment of trusted communication between other devices and accessory devices is also negotiated.
  • Credentials that is, second credentials.
  • the first credential is a direct credential
  • the second credential is an indirect credential.
  • an embodiment of the present application provides a method for binding a main control device and an accessory device.
  • the method may include but is not limited to the following steps:
  • S1011 The main control device establishes a communication connection with the accessory device.
  • the main control device can establish Bluetooth, WIFI, NFC and other short-range communication connections with the accessory device. After the communication connection is established, S1012 and S1013 can be performed.
  • the master control device obtains the out-of-band shared password and generates a shared key based on the out-of-band shared password.
  • the out-of-band shared password can be a secret known to the user. Users can input the out-of-band shared password to the main control device and accessory device respectively. After receiving the out-of-band shared password, the main control device and the accessory device perform operations based on the out-of-band shared password using the same algorithm to generate the same key, which is called a shared key here.
  • the main control device and the accessory device can use the Password authenticated key exchange (PAKE) protocol and the SPAKE protocol to negotiate and generate a shared key.
  • PAKE Password authenticated key exchange
  • the accessory device obtains the out-of-band shared password and generates a shared key based on the out-of-band shared password.
  • accessory device and the main control device use the same and generate the same shared key.
  • S1012 which will not be described again here.
  • the accessory device may not perform S1013, and the shared key may be stored in the accessory device in advance.
  • S1014 The main control device and the accessory device negotiate the first credential and the second credential based on the shared key, and set the attributes of the first credential and the second credential.
  • the master device and the accessory device conduct two negotiations respectively through the PAKE protocol or the SPAKE protocol based on the shared key to obtain the first credential (symmetric key Key1) and the second credential ( Symmetric key Key2).
  • the first credential is a symmetric key
  • the above-mentioned shared key is the first credential.
  • another negotiation is performed through the PAKE protocol or the SPAKE protocol to obtain the second credential, such as the symmetric key Key2.
  • both the master device and the accessory device store the same symmetric key.
  • both the main control device and the accessory device store the contents in Table 1 below.
  • the attributes of the credentials can be set by one of the main control device and the accessory device, and then shared with the other party, or they can be set separately, which is not limited here.
  • the main control device and the accessory device can generate two pairs of public and private keys respectively.
  • a pair of public and private keys generated by the accessory device is the public key PK1 and the private key SK1
  • the other pair of public and private keys is the public key PK3 and the private key SK3
  • the pair of public and private keys generated by the master device is the public key PK2 and the private key SK3.
  • Key SK2, and the other pair of public and private keys are public key PK4 and private key SK4.
  • both the main control device and the accessory device can exchange their respective public keys to obtain the first credential and the second credential.
  • the first credential includes the public key PK1 and private key SK1 of the accessory device, and the public key PK2 and private key SK2 of the main control device;
  • the second credential includes the public key PK3 and private key SK3 of the accessory device, and the public key of the main control device.
  • the credentials are usually distributed and stored on multiple devices. At this time, the credentials and attributes of the credentials stored by the accessory device are as shown in Table 2 below, and the credentials and attributes of the credentials stored by the main control device are as shown in Table 3 below.
  • Implementation method 3 The first credential is a symmetric key, and the second credential is an asymmetric key.
  • the first credential is the above-mentioned shared key or the above-mentioned symmetric key Key1, and the main control device and the accessory device can respectively generate a pair of public and private keys.
  • the public-private key pair generated by the accessory device is the public key PK3 and the private key SK3; the public-private key pair generated by the master device is the public key PK4 and the private key SK4.
  • the symmetric key Key1 is used as the first credential.
  • the main control device and the accessory device can exchange their respective public keys to obtain the second credential.
  • the second credentials include the public key PK3 and private key SK3 of the accessory device, and the public key PK4 and private key SK4 of the master device.
  • the credentials stored by the accessory device are as shown in Table 4 below, and the credentials and credentials stored by the master device are as shown in Table 5 below.
  • Implementation method 4 The first credential is an asymmetric key, and the second credential is a symmetric key.
  • the main control device and accessory device can generate a pair of public and private keys respectively.
  • the public-private key pair generated by the accessory device is the public key PK1 and the private key SK1; the public-private key pair generated by the master device is the public key PK3 and the private key SK3.
  • both the main control device and the accessory device can exchange their respective public keys to obtain the first credential.
  • the first credential includes the public key PK1 and private key SK1 of the accessory device, and the public key PK2 and private key SK2 of the main control device.
  • the second credential is the above-mentioned shared key or the above-mentioned symmetric key Key1 or symmetric key Key2.
  • Embodiment 1 please refer to the above-mentioned Embodiment 1, which will not be described again here.
  • the credentials and the attributes of the credentials stored by the accessory device are as shown in Table 6 below, and the first and second credentials stored by the main control device are as follows As shown in Table 7.
  • the master device After obtaining the first credentials, the master device can conduct trusted communication with the authorized device.
  • the main control device and the accessory device can encrypt the data to be transmitted to the other party using the symmetric key Key1, and also use the symmetric key to decrypt the data received from the other party.
  • the main control device can use the public key PK1 to encrypt the data to be transmitted to the accessory device, and the accessory device can decrypt the data through the private key SK1; similarly, the accessory device can use the public key PK2 to encrypt the data to be transmitted to the main control device.
  • the data is encrypted, and the master device decrypts the data through the private key SK2.
  • the public key PK1, private key SK1, public key PK2 and private key SK2 are all referred to as the contents of the first certificate, however, the private key SK1 and the public key SK1 stored in the accessory device can also be referred to as the contents of the first certificate.
  • Key PK2 is called a credential
  • the public key private key SK2 and public key PK1 stored in the master device are called another credential.
  • These two credentials are a pair of credentials.
  • the first credential in this application can be understood as a pair of credentials.
  • the second credential can also be understood as a pair of credentials.
  • the master control device sets a management policy for credentials in response to the input user operation.
  • the management policy may include management of the number of times the device using the credentials can be connected, the duration of the connection, the data and/or services that can be accessed, etc.
  • the main control device can set different management policies for different credentials or credentials with different attributes, and obtain the correspondence between the credentials and the number of connections, length of connection, accessible data and/or services. relation. Further, the corresponding relationship can also be sent to the accessory device to implement a credential-based management policy of the accessory device to handle access requests from different devices. As shown in Table 8, an example of credential management:
  • N is a positive integer
  • N can be once or multiple times, such as 2 times, 10 times, etc.
  • T can be 1 minute, 10 minutes, 20 minutes, etc. It should be understood that N and T can be set based on the needs of the application scenario, and are not limited here.
  • S102 may also be performed by an accessory device.
  • S102 can also be executed at other times. For example, when the set correspondence is the correspondence between the attributes of the credential and the number of times that can be connected, the length of time that can be connected, the accessible data and/or the business, S102 can occur at any stage or Any time at any stage.
  • the master control device determines whether the second credential is allowed to be shared based on the attributes of the second credential. If yes, execute S104; otherwise, output indication information prompting that the credentials cannot be shared.
  • user A When user A wants to share credentials to user B, user A can enter a sharing operation for the second credential. After receiving the sharing operation for the credential, the main control device determines whether the credential is allowed based on the attribute information of the credential to be shared. To be shared, if the attributes of the credential to be shared are indirect and/or shareable, the credential is allowed to be shared, otherwise the credential is not allowed to be shared.
  • S104 The master control device sends the second credential to the authorized device.
  • the master device may actively send the second credentials to the authorized device. For example, the master control device sends the second credential to the authorized person through instant messaging. At this time, the master control device also sends the identification of the accessory device to the authorized device to indicate the accessory device to which the credentials apply.
  • the authorized device may send a credential request to the master device, and the credential request carries the identification of the accessory device to request credentials for using the accessory device.
  • the master device performs S103 and S104 to send the second credential to the authorized device.
  • the second credential is a symmetric key
  • the sent second credential is the symmetric key Key2.
  • the second credential is an asymmetric key
  • the second credential sent is the public key PK3 of the accessory device, or the second credential public key PK3 and the private key SK4 are also sent.
  • the authentication method is also different, which will be described in detail in steps S107-S108.
  • S105 The authorized device receives the second credential.
  • S106 The authorized device establishes a communication connection with the accessory device.
  • connection method may include but is not limited to Bluetooth, WIFI, NFC and other short-range communication connections.
  • the authorized device sends an authentication request to the accessory device based on the second credential, where the authentication request carries the first information and the verification information of the first information.
  • S108 The accessory device verifies the verification information based on local credential information.
  • the local credential information of the accessory device includes the first credential and the second credential stored locally.
  • the local credential information of the accessory device includes the first credential and the second credential stored locally.
  • the first information is a character string
  • the verification information is a digital signature
  • the digital signature is a signature of the character string using the fourth private key.
  • the first information is a public key
  • the verification information is a third digital signature using the fourth private key for the public key.
  • the first information is a character string
  • the verification information is the MAC value of the first information.
  • This authentication request is used to request the accessory device to verify whether the authorized device is a trusted device.
  • the accessory device can verify whether the authorized device contains the symmetric key Key2 that is consistent with its locally stored second credential (when the second credential is a symmetric credential) or is contained in its locally stored third credential.
  • the second credential matches the private key SK4 (when the second credential is an asymmetric credential).
  • S109 The accessory device sends the verification result to the authorized device.
  • the verification results include verification success and verification failure.
  • the accessory device sends an instruction message to the authorized device to indicate that the verification has passed; if the verification fails, the accessory device sends a verification message to the authorized device. The result is used to indicate verification failure.
  • the authorized device may use the second credential to attempt to establish a trusted connection with the accessory device. Based on whether the second credential is a symmetric credential or an asymmetric credential, the specific implementation of the above authentication process (S107-S109) is described in two implementations:
  • the second credential is a symmetric credential, that is, the symmetric key Key2.
  • the master control device, the authorized device and the accessory device all store the symmetric key Key2 locally.
  • the authentication method may include but is not limited to the following steps:
  • the authorized device calculates the MAC value of the string M 1 through the local symmetric key Key2.
  • the authorized device first calculates the digest value of the string M 1, and then encrypts the digest value through the symmetric key Key2, and then obtains the MAC value of the string M 1.
  • the authorized device sends an authentication request, which includes the string M1 and the MAC value.
  • the accessory device calculates the MAC value of the received string through the local symmetric key Key2.
  • the accessory device determines whether the calculated MAC value is consistent with the MAC value carried in the authentication request. If so, execute a6, otherwise execute a7.
  • the authentication request also includes the identification of the authorized device.
  • the accessory device After the accessory device receives the authentication request, if the device sending the authentication request is not the master device, the accessory device will choose to verify the authentication request through the local second credential. Specifically, the accessory device uses the local symmetric key Key2 to calculate the MAC value of the received string. If the calculated MAC value is consistent with the MAC value carried in the authentication request, it means that the authorized device has the same symmetric key as the accessory device. Key2, the authorized device is a trusted device, and the authentication is passed; if the two MAC values are inconsistent, it means that the local symmetric key Key2 of the authorized device is different from the local symmetric key Key2 of the accessory device, and the authorized device is not trusted. For the device, authentication failed.
  • the accessory device sends instruction information indicating that the authentication has passed to the authorized device.
  • the accessory device sends instruction information indicating authentication failure to the authorized device.
  • the accessory device will choose to verify the authentication request through the first credential.
  • the verification method is the same as the above-mentioned verification of the authentication request through the second credential, which will not be described again here.
  • the authorized device can also reversely verify whether the accessory device is a trusted device.
  • the method is the same as the above a1-a7, and the authorized device and the accessory device in steps a1-a7 are interchanged.
  • the authentication request may not include the symmetric key Key2 itself, but include the digest value of the symmetric key Key2.
  • the accessory device can calculate the digest value of the local second credential (symmetric key Key2). If the calculated digest value is consistent with the digest value carried in the authentication request, the authentication passes, otherwise the authentication fails.
  • the second credentials are asymmetric credentials, namely PK3, SK3, PK4, and SK4.
  • the second credentials saved locally on the main control device include PK3, PK4, and SK4, and the second credentials saved locally on the accessory device include PK3, SK3, and PK4.
  • the second credentials sent by the master device to the authorized device at least include SK4, for example, PK3, PK4, and SK4. That is, the second credentials stored locally by the authorized device include PK3, PK4, and SK4.
  • the authentication method may include two parts: forward authentication and reverse authentication.
  • forward authentication includes but is not limited to some or all of the following steps to determine whether the authorized device actually contains the private key SK4:
  • the authorized device uses the private key SK4 to sign the string M2 and obtains the digital signature S1.
  • the authorized device first calculates the digest value of the string M2, and further encrypts the digest value using the private key SK4, and the resulting ciphertext is the digital signature S1.
  • the authorized device sends an authentication request Q1 to the accessory device.
  • the authentication request Q1 includes the string M2 and the digital signature S1.
  • b4 The accessory device verifies the digital signature S1 through the local public key PK3. If the signature verification passes, execute b5, otherwise execute b6.
  • the authentication request also includes the identification of the authorized device.
  • the accessory device After the accessory device receives the authentication request, if the device sending the authentication request is not the master device, the accessory device will choose to verify the authentication request through the local second credential. Specifically, the accessory device calculates the digest value of the received string M1, and decrypts the digital signature S1 through the public key PK3 in the local second credential to obtain the digest value. If the calculated digest value is consistent with the decrypted digest value, It means that the authorized device has a private key that matches the local public key PK3. The authorized device is a trusted device and the authentication is passed. If the two digest values are inconsistent, it means that the authorized device does not have the same private key as the local public key PK3. Matching private keys, the authorized device is not a trusted device, and the authentication fails.
  • the authentication request Q1 may not carry the string M2, but may carry the digest value of the string M2.
  • the accessory device may compare the decrypted digest value with the digest value carried in the authentication request.
  • the accessory device sends instruction information indicating that the authentication has passed to the authorized device.
  • the accessory device sends indication information indicating authentication failure to the authorized device.
  • Reverse authentication includes but is not limited to some or all of the following steps to determine whether the accessory device actually contains the private key SK3:
  • the accessory device uses the private key SK3 to sign the string M3 to obtain the digital signature S2.
  • the accessory device sends an authentication request Q2 to the authorized device.
  • the authentication request includes the string M3 and the digital signature S2.
  • b10 The authorized device verifies the digital signature S2 through the local public key PK3. If the signature verification passes, execute b11, otherwise execute b12.
  • the authorized device calculates the digest value of the received string M3, and decrypts the digital signature S2 through the public key PK3 in the local second credential to obtain the digest value. If the calculated digest value is consistent with the decrypted digest value , it means that the accessory device has a private key that matches the local public key PK3. The accessory device is a trusted device and the authentication passes; if the two digest values , are inconsistent, it means that the accessory device does not have a private key that matches the local public key PK3. The private key, the accessory device is not a trusted device, and the authentication failed.
  • the authorized device sends instruction information indicating that the authentication has passed to the accessory device.
  • the authorized device sends indication information indicating authentication failure to the accessory device.
  • the reverse authentication process may not be included.
  • the second credentials sent by the master device to the authorized device may only include PK4 and SK4.
  • the authorized device accesses the accessory device in the name of the master device, but because its credentials are indirect credentials, it can be distinguished from the master device and has different permissions from the master device. Accessory devices use different management policies based on different credentials. For details, please refer to the relevant descriptions in the above authorization phase and the following access phase.
  • the above strings M2 and M3 can also be replaced by the public key PK3 or PK4.
  • the public key PK3 and the public key PK4 are stored locally in both the authorized device and the accessory device, and there is no need to carry them in the authentication request.
  • the public key PK3 or PK4 does not need to carry the digest value of the public key PK3 or PK4.
  • the second credentials stored locally on the authorized device do not necessarily include all the second credentials stored on the master device, and may only include the private key SK4, or only the private key SK4 and the public key PK3.
  • the second credentials are PK3, SK3, PK4, and SK4.
  • the second credentials saved locally on the main control device include PK3, PK4, and SK4, and the second credentials saved locally on the accessory device include PK3, SK3, and PK4.
  • the second credentials sent by the master device to the authorized device include PK3 and PK4, that is, the second credentials saved locally by the authorized device include PK3 and PK4, but do not include the private key SK3 of the master device.
  • the authentication method may include two parts: forward authentication and reverse authentication.
  • the forward authentication process may include but is not limited to the following steps to determine whether the authorized device is authorized by the master device:
  • the authorized device sends a signature request to the master device.
  • the signature request includes the public key PK5 and is used to request the master device to perform the signature on PK5.
  • the authorized device includes the public key PK5 and the corresponding private key SK5.
  • the master control device signs the public key PK5 through the private key SK4 to obtain the digital signature S3.
  • the master device sends the digital signature S3 to the authorized device.
  • the authorized device sends an authentication request Q3 to the accessory device.
  • the authentication request includes the public key PK5 and the digital signature S3.
  • c6 The accessory device verifies the digital signature S3 through the local public key PK4. If the signature verification passes, execute c7, otherwise execute c8.
  • the accessory device After receiving the authentication request, the accessory device decrypts the digital signature S3 through the public key PK4 to obtain the digest value of the public key PK5. Further, it calculates the digest value of the public key PK5 included in the authentication request. If the calculated digest value is the same as the decrypted digest value, If the obtained digest values are consistent, the authentication passes, otherwise the authentication fails.
  • the accessory device sends instruction information indicating that the authentication has passed to the authorized device.
  • the accessory device sends indication information indicating authentication failure to the authorized device.
  • the authorized device can perform reverse authentication to determine whether the accessory device actually contains the private key SK3.
  • the reverse authentication process can be the same as the reverse authentication process in Implementation 2 above, which includes but is not limited to the following steps:
  • the accessory device sends an authentication request Q4 to the authorized device.
  • the authentication request includes the string M4 and the digital signature S4.
  • c11 The authorized device verifies the digital signature S4 through the local public key PK3.
  • the authorized device calculates the digest value of the received string M4, and decrypts the digital signature S4 through the public key PK3 in the local second credential to obtain the digest value. If the calculated digest value is consistent with the decrypted digest value , it means that the accessory device has a private key that matches the local public key PK3. The accessory device is a trusted device and the authentication passes; if the two digest values , are inconsistent, it means that the accessory device does not have a private key that matches the local public key PK3. The private key, the accessory device is not a trusted device, and the authentication failed.
  • the authorized device sends instruction information to the accessory device indicating that the authentication has passed.
  • the authorized device sends indication information indicating authentication failure to the accessory device.
  • the above-mentioned string M4 can also be replaced by the public key PK3, PK4 or PK5.
  • the public key PK3, public key PK4 and PK5 are stored locally in both the authorized device and the accessory device (in forward authentication After the accessory device obtains PK5), the authentication request does not need to carry the public key PK3, PK4 or PK5, nor does it need to carry the digest value of the public key PK3, PK4 or PK5.
  • the authorized device After passing the authentication, the authorized device can access data or services in the accessory device.
  • S110 The authorized device sends an access request to the accessory device.
  • the accessory device is a smart speaker
  • the access request carries data to be played and is used to request the accessory device to play the data to be played.
  • the accessory device is a smart camera
  • the access request carries the data to be played and is used to request the data stream captured by the current monitoring of the accessory device.
  • S111 The accessory device processes the access request from the authorized device according to the management policy of the second credential.
  • the accessory device After each accessory device authenticates the authorized device, the number of connections of the authorized device recorded by the accessory device is increased by 1, and the total access time can also be recorded. Then, before each response to the access request, it can be judged whether the access request of the authorized device complies with the The management policy of the second credential (see Table 8) will only respond to the access request when the management policy is met. Specifically, as shown in Figure 6D, the accessory device can perform some or all of the following steps:
  • S1111 Determine whether the number of connections to the authorized device is less than the preset threshold N. If not, execute S1112; if yes, execute S1113.
  • S1112 Return indication information indicating that the connection exceeds N times to the authorized device.
  • S1113 Determine whether the connection duration with the authorized device is less than the preset duration T. If not, execute S1114. If yes, execute S1115.
  • connection duration may refer to a single connection duration between the authorized device using the second credential and the accessory device, or may refer to the total connection duration between the authorized device using the second credential and the accessory device.
  • S1114 Return indication information indicating connection timeout to the authorized device.
  • S1115 Determine whether the service or data to be accessed is within the range of accessible data and/or services corresponding to the second credential. If not, execute S1116; if yes, execute S1117.
  • S1116 Return indication information indicating no access rights to the authorized device.
  • S1117 Process access requests from authorized devices.
  • FIG. 6D exemplarily shows that the management policy may include the number of connections, the duration of connection, accessible data and/or services
  • the accessory device determines whether the service request complies with the second credential before responding to the service request.
  • the judgments in the above steps S1111, S1113 and S1115 can be executed in no particular order.
  • the management policy may include one or two of the number of times that can be connected, the length of time that can be connected, and accessible data and/or services. In this case, it only needs to be judged whether one or two of the included times meet the second requirement.
  • the credential management policy please refer to the judgment method shown in Figure 6D above for details, which will not be described again here.
  • FIG 7 it is a schematic flow chart of a device authorization and authentication method provided by an embodiment of the present application.
  • This method is an example of the device authorization method when both the first credential and the second credential are asymmetric credentials in the device authorization method shown in Figure 4 .
  • the method may include but is not limited to the following steps:
  • the master control device binds the accessory device and generates the first credential and the second credential.
  • the first credential includes the public key PK1 and private key SK1 of the accessory device, and the public key PK2 and private key SK2 of the main control device;
  • the second credential includes the public key PK3 and private key SK3 of the accessory device, and the public key of the main control device.
  • the second credentials stored by the accessory device include the public key PK1 and private key SK1 of the accessory device, and the public key PK2 of the main control device; while the second credentials stored by the main control device include the public key PK1 of the accessory device, the main key PK2 of the main control device.
  • the first credential may also be a symmetric key key1, which may be referred to the above-mentioned Embodiment 1, and will not be described again here.
  • S202 The master control device responds to the input user operation and sets the management policy of the credentials.
  • the master control device determines whether the second credential is allowed to be shared based on the attribute information of the second credential. If yes, execute S204; otherwise, output indication information prompting that the credentials cannot be shared.
  • S202 and S203 please refer to S102 and S103 in the above-mentioned Embodiment 1, which will not be described again here.
  • the master device sends the public key PK3 of the accessory device and the private key SK4 of the master device in the second credential to the authorized device.
  • the authorized device receives the public key PK3 of the accessory device and the private key SK4 of the master device.
  • the second credential stored locally on the authorized device includes the private key SK4 of the master device and the public key PK3 of the accessory device.
  • S206 The authorized device establishes a communication connection with the accessory device.
  • connection method may include but is not limited to Bluetooth, WIFI, NFC and other short-range communication connections.
  • the authorized device sends an authentication request to the accessory device, and the authentication request includes the digital signature S5.
  • the accessory device verifies the digital signature S5 based on the public key PK4 in the local second credential.
  • the accessory device After receiving the authentication request, the accessory device decrypts the digital signature S5 through the public key PK4 to obtain the digest value of the public key PK3. Further, it calculates the digest value of the locally stored public key PK3. If the calculated digest value is the same as the decrypted value obtained by If the digest values are consistent, the authentication passes, otherwise the authentication fails.
  • S210 The accessory device sends the signature verification result to the authorized device.
  • the signature verification result is used to indicate that the authentication has passed; when the authentication fails, the signature verification result is used to indicate that the authentication has failed.
  • a reverse authentication process may also be included, specifically including the following steps:
  • the accessory device signs the public key PK4 through the private key SK3 to obtain the digital signature S6.
  • the accessory device sends an authentication request to the authorized device, and the authentication request includes the digital signature S6.
  • the authorized device verifies the digital signature S6 based on the public key PK3 in the local second credential.
  • the authorized device After receiving the authentication request, the authorized device decrypts the digital signature S6 through the public key PK3 to obtain the digest value of the public key PK4. Further, it calculates the digest value of the locally stored public key PK4. If the calculated digest value is the same as the decrypted If the obtained digest values are consistent, the authentication passes, otherwise the authentication fails.
  • the signature verification result is used to indicate that the authentication has passed; when the authentication fails, the signature verification result is used to indicate that the authentication has failed.
  • step S211 the public key PK3 may also be signed.
  • FIGs 8 and 9 there are schematic illustrations and flow charts of the device authorization method.
  • This method can be implemented by the system shown in Figure 2A or Figure 2C, and can include three stages of authorization, authentication and data access.
  • S301 Bind the main control device and the accessory device, and generate a first credential, which includes a pair of public key PK1 and private key SK1 of the accessory device, and a pair of public key PK2 and private key SK2 of the main control device.
  • the main control device and the accessory device exchange, the accessory device obtains the public key PK2, and the main control device obtains the public key PK.
  • the first credentials stored by the accessory device include its own public key PK1 and private key SK1, as well as the public key PK2 of the master device.
  • the first credentials stored by the master device include its own public key PK2 and private key SK2, as well as the public key PK1 of the accessory device.
  • the main control device can conduct trusted communication with the authorized device.
  • the main control device can use the public key PK1 to encrypt the data to be transmitted to the accessory device, and the accessory device decrypts the data through the private key SK1; similarly, the accessory device
  • the public key PK2 can be used to encrypt the data to be transmitted to the master control device, and the master control device decrypts the data through the private key SK2.
  • the master control device responds to the operation input by the user and sets the management policy of the credentials.
  • credentials may be divided into first credentials and non-first credentials.
  • the master control device can set management policies for first credentials and non-first credentials.
  • the management policy may include management of the number of times the device using the credentials can be connected, the duration of the connection, the data and/or services that can be accessed, etc. For example, set the corresponding relationship between the distribution of first credentials and non-first credentials and the number of connections, duration of connection, accessible data and/or services. Further, the corresponding relationship can also be sent to the accessory device to implement a credential-based management policy of the accessory device to handle access requests from different devices. As shown in Table 9, an example of credential management:
  • S302 may also be performed by an accessory device. S302 can also occur at any stage or at any time during any stage.
  • S303 The authorized device sends an endorsement request to the master device, and the endorsement request includes the third credential.
  • the endorsement request is used to request the main control device to endorse the third credential.
  • the third credential can be a symmetric key or an asymmetric key.
  • the authorized device may generate a pair of public and private keys, namely the public key PK5 and the private key SK5.
  • the third credential stored by the authorized device includes the public key PK5 and the private key SK5.
  • the third credential carried by the endorsement request includes the public key PK5 but not the private key SK5.
  • the authorized device may generate a symmetric key, such as symmetric key Key3, and at this time, the third credential includes symmetric key Key3.
  • the master control device calculates the digest value of the third credential (public key PK5 or symmetric key Key3), and then encrypts the digest value with its own private key SK2 to obtain its digital signature, which is also called in the embodiment of this application. is the signed third credential.
  • the third credential public key PK5 or symmetric key Key3
  • S305 The master control device sends the signed third credential to the authorized device.
  • S306 The authorized device receives the signed third credential.
  • S307 The authorized device establishes a communication connection with the accessory device.
  • connection method may include but is not limited to Bluetooth, WIFI, NFC and other short-range communication connections.
  • S308 The authorized device sends an authentication request to the accessory device, where the authentication request includes the third credential and the signature of the third credential.
  • the authentication request carries the public key PK5.
  • S309 The accessory device verifies the signature of the third credential based on the local public key PK2.
  • the accessory device stores the first credentials, including its own public key PK1 and private key SK1, as well as the public key PK2 of the main control device.
  • the accessory device can decrypt the signature of the third credential through the local public key PK2 to obtain the digest value, calculate the digest value of the third credential carried in the authentication request, and compare the decrypted digest value with the calculated digest value. If If they are consistent, the signature verification is successful; otherwise, the signature verification fails.
  • S310 The accessory device sends the signature verification result to the authorized device.
  • the accessory device can store the third credential and send indication information indicating that the signature verification is successful to the authorized device. If the signature verification fails, indication information indicating the signature verification failure or authentication failure is sent to the authorized device.
  • the accessory device When the third credential is an asymmetric key, the accessory device also sends the public key PK1 to the authorized device.
  • the third credentials stored by the accessory device include: the public key PK5 of the authorized device, its own public key PK1 and private key SK1.
  • the third credentials stored by the authorized device include: its own public key PK5 and private key SK5, and the public key PK1 of the accessory device.
  • a reverse authentication process is also included.
  • the third credential can be used for authentication.
  • the authorized device After passing the authentication, the authorized device can access data or services in the accessory device.
  • the encrypted transmission channel agreed upon in the authentication phase can be used for transmission between the authorized device and the accessory device.
  • the authorized device and the accessory device may communicate based on the symmetric key Key3.
  • the authorized device when the third credential is the public key PK5, the authorized device can use the public key PK1 to encrypt the data to be transmitted to the accessory device, and the accessory device can decrypt the data through the private key SK1; similarly, the accessory device can use the public key PK1.
  • the key PK5 encrypts the data to be transmitted to the authorized device, and the authorized device decrypts the data through the private key SK5.
  • S311 The authorized device sends an access request to the accessory device.
  • the authorized device After passing the authentication, the authorized device can access data or services in the accessory device.
  • the accessory device is a smart speaker
  • the access request carries data to be played and is used to request the accessory device to play the data to be played.
  • the accessory device is a smart camera
  • the access request carries the data to be played and is used to request the data stream captured by the current monitoring of the accessory device.
  • S312 Process the access request from the authorized device according to the management policy of the third credential.
  • the accessory device first determines whether the third credential obtained through signature verification is the first credential. If not, the access request is processed through a management policy other than the first credential. At this time, the management policy of the third credential is the management policy of the non-first credential (see Table 9).
  • the accessory device or the main control device can set the management policy of the third credential, for example, the number of connections, the duration of the connection, the accessible data and/or the business. one or more of. As shown in Table 10, it is an example of the management policy of the third credential:
  • S312 The specific implementation principle of S312 is the same as the above-mentioned S111.
  • S111 the specific implementation of S111 in the above-mentioned Embodiment 1, which will not be described again here.
  • FIG 10 there is a schematic illustration and flow chart of the device authorization and authentication method. This method can be implemented by the system shown in Figure 2A or Figure 2C, and can include three stages of authorization, authentication and data access.
  • S401 Bind the main control device and the accessory device, and generate the first credential, which includes the symmetric key Key1.
  • S402 The master control device responds to the operation input by the user and sets the management policy of the credentials.
  • S402 please refer to S302 in the above-mentioned Embodiment 3, which will not be described again here.
  • S403 The authorized device sends an endorsement request to the master device, and the endorsement request includes the third credential.
  • the third credential can be a symmetric key or an asymmetric key.
  • the authorized device may generate a pair of public and private keys, namely the public key PK5 and the private key SK5.
  • the third credential includes the public key PK5.
  • the authorized device may generate a symmetric key, such as the symmetric key Key3, in which case the third credential includes the symmetric Sexual key Key3.
  • the master control device calculates the message authentication code (MAC) of the third credential through the symmetric key Key1.
  • the master control device calculates the digest value of the third credential, and then encrypts the digest value using the symmetric key Key1, and the resulting ciphertext is the MAC value.
  • S405 The master device sends the MAC value of the third credential to the authorized device.
  • S406 The authorized device receives the MAC value of the third credential.
  • S407 The authorized device establishes a communication connection with the accessory device.
  • connection method may include but is not limited to Bluetooth, WIFI, NFC and other short-range communication connections.
  • the authorized device sends an authentication request to the accessory device.
  • the authentication request includes the third credential and the MAC value of the third credential.
  • S409 The accessory device verifies the MAC value of the third credential based on the local credential.
  • the accessory device calculates the MAC value of the third credential based on the local credential, that is, the symmetric key Key1.
  • the accessory device compares the calculated MAC value with the MAC value carried in the authentication request. If they are the same, it means that the third credential is encrypted by the same symmetric key.
  • the accessory device confirms that the authorized device has the same symmetric key Key1 as itself. The authorized device is trusted and the verification passes; if they are different, it means that the third credential is The tampered or authorized device has a symmetric key Key1 that is different from its own. The authorized device is not trustworthy and the verification fails, so it is an untrusted device.
  • S410 The accessory device sends the verification result to the authorized device.
  • the accessory device may store the third credential and send indication information indicating that the verification or authentication is passed to the authorized device. If the verification fails, indication information indicating verification failure or authentication failure is sent to the authorized device.
  • the authorized device can authenticate the accessory device through the third credential and access data or services in the accessory device.
  • the access process please refer to the above-mentioned Embodiment 3, which will not be described again here.
  • the signed third credential and the MAC value of the third credential can be called the verification information of the third credential, which are both based on the locally stored first credential of the master control device. Obtained by processing the third credential.
  • FIG. 11 shows a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
  • the electronic device 100 may be the above-mentioned main control device, accessory device, authorized device, etc.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (SIM) card interface 195, etc.
  • a processor 110 an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display
  • the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) wait.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • NPU neural-network processing unit
  • different processing units can be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 100 .
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If processor 110 needs to The first time the instruction or data is used, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • processor 110 may include one or more interfaces.
  • Interfaces may include integrated circuit (inter-integrated circuit, I2C) interface, integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, pulse code modulation (pulse code modulation, PCM) interface, universal asynchronous receiver and transmitter (universal asynchronous receiver/transmitter (UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and /or universal serial bus (USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART universal asynchronous receiver and transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (derail clock line, SCL).
  • processor 110 may include multiple sets of I2C buses.
  • the processor 110 can separately couple the touch sensor 180K, charger, flash, camera 193, etc. through different I2C bus interfaces.
  • the processor 110 can be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to implement the touch function of the electronic device 100 .
  • the I2S interface can be used for audio communication.
  • processor 110 may include multiple sets of I2S buses.
  • the processor 110 can be coupled with the audio module 170 through the I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface to implement the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface to implement the function of answering calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is generally used to connect the processor 110 and the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface to implement the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 110 and the camera 193 communicate through the CSI interface to implement the shooting function of the electronic device 100 .
  • the processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100 .
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, display screen 194, wireless communication module 160, audio module 170, sensor module 180, etc.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio through them. This interface can also be used to connect other electronic devices, such as AR devices, etc.
  • the interface connection relationships between the modules illustrated in the embodiments of the present application are only schematic illustrations and do not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive wireless charging input through the wireless charging coil of the electronic device 100 . While the charging management module 140 charges the battery 142, it can also provide power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, wireless communication module 160, etc.
  • the power management module 141 can also be used to monitor battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
  • the mobile communication module 150 can provide solutions for wireless communication including 2G/3G/4G/5G applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be disposed in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194.
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110 and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellites.
  • WLAN wireless local area networks
  • System global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), fifth generation wireless communication system ( 5G, the 5th Generation of wireless communication system), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • CDMA code division multiple access
  • WCDMA broadband Code division multiple access
  • WCDMA wideband code division multiple access
  • time division code division multiple access time-division code division multiple access
  • TD-SCDMA time-division code division
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi) -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is an image processing microprocessor and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the display screen 194 is used to display images, videos, etc.
  • Display 194 includes a display panel.
  • the display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • AMOLED organic light-emitting diode
  • FLED flexible light-emitting diode
  • Miniled MicroLed, Micro-oLed, quantum dot light emitting diode (QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
  • the ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera sensor through the lens, the optical signal is converted into an electrical signal, and the camera sensor passes the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or video.
  • the camera 193 may include a 3D camera that can collect depth data of the photographed object. according to.
  • the object passes through the lens to produce an optical image that is projected onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other format image signals.
  • the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
  • Video codecs are used to compress or decompress digital video.
  • Electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, etc.
  • NPU is a neural network (NN) computing processor.
  • NN neural network
  • Intelligent cognitive applications of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, etc.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the electronic device 100 .
  • the internal memory 121 may include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.).
  • the storage data area may store data created during use of the electronic device 100 (such as audio data, phone book, etc.).
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
  • the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110 , or some functional modules of the audio module 170 may be provided in the processor 110 .
  • Speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to hands-free calls.
  • Receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or a voice message, the voice can be heard by bringing the receiver 170B close to the human ear.
  • Microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak close to the microphone 170C with the human mouth and input the sound signal to the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which in addition to collecting sound signals, may also implement a noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions, etc.
  • the headphone interface 170D is used to connect wired headphones.
  • the headphone interface 170D may be a USB interface 130, or may be a 3.5mm open mobile terminal platform (OMTP) standard interface, or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA Cellular Telecommunications Industry Association of the USA
  • the pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals.
  • pressure sensor 180A may be disposed on display screen 194 .
  • pressure sensors 180A there are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc.
  • a capacitive pressure sensor may include at least two parallel plates of conductive material.
  • the electronic device 100 determines the intensity of the pressure based on the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position based on the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch location but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
  • the gyro sensor 180B may be used to determine the motion posture of the electronic device 100 .
  • gyroscope sensing may be Detector 180B determines the angular velocity of electronic device 100 about three axes (ie, x, y, and z axes).
  • the gyro sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyro sensor 180B detects the angle at which the electronic device 100 shakes, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shake of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • Air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • Magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 may utilize the magnetic sensor 180D to detect opening and closing of the flip holster.
  • the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. Then, based on the detected opening and closing status of the leather case or the opening and closing status of the flip cover, features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices and be used in horizontal and vertical screen switching, pedometer and other applications.
  • Distance sensor 180F for measuring distance.
  • Electronic device 100 can measure distance via infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may utilize the distance sensor 180F to measure distance to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 100 emits infrared light outwardly through the light emitting diode.
  • Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
  • the electronic device 100 can use the proximity light sensor 180G to detect when the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in holster mode, and pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touching.
  • Fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering of incoming calls, etc.
  • Temperature sensor 180J is used to detect temperature.
  • the electronic device 100 utilizes the temperature detected by the temperature sensor 180J to execute the temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the low temperature from causing the electronic device 100 to shut down abnormally. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K can be disposed on the display screen 194.
  • the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near the touch sensor 180K.
  • the touch sensor can pass the detected touch operation to the application processor to determine the touch event type.
  • Visual output related to the touch operation may be provided through display screen 194 .
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a location different from that of the display screen 194 .
  • Bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human body's vocal part.
  • the bone conduction sensor 180M can also contact the human body's pulse and receive blood pressure beating signals.
  • the bone conduction sensor 180M can also be provided in an earphone and combined into a bone conduction earphone.
  • the audio module 170 can analyze the voice signal based on the vibration signal of the vocal vibrating bone obtained by the bone conduction sensor 180M to implement the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M to implement the heart rate detection function.
  • the buttons 190 include a power button, a volume button, etc.
  • Key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback.
  • touch operations for different applications can correspond to different vibration feedback effects.
  • the motor 191 can also respond to different vibration feedback effects for touch operations in different areas of the display screen 194 .
  • Different application scenarios such as time reminders, receiving information, alarm clocks, games, etc.
  • the touch vibration feedback effect can also be customized.
  • the indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
  • the SIM card interface 195 is used to connect a SIM card.
  • the SIM card can be connected to or separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. number.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the plurality of cards may be the same or different.
  • the SIM card interface 195 is also compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications.
  • the electronic device 100 uses an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of this application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
  • the processor 110 is configured to call instructions in the memory or internal memory 121 to execute the method executed by the master device in any one of the above-mentioned embodiments one to four.
  • the processor 110 is configured to call instructions in the memory or internal memory 121 to execute the method executed by the accessory device in any one of the above-mentioned embodiments one to four.
  • the processor 110 is configured to call instructions in the memory or internal memory 121 to execute the method executed by the authorized device in any one of the above-mentioned Embodiments 1 to 4.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Telephonic Communication Services (AREA)

Abstract

一种设备授权方法及电子设备、系统,该方法可以包括主控设备与配件设备绑定,协商第一凭据和第二凭据;所述第一凭据不可分发,用于所述主控设备的认证;所述第二凭据可分发,用于被授权设备的认证;所述主控设备响应于针对所述第二凭据的分享操作,在所述第二凭据的属性为可分发时,向所述被授权设备发送所述第二凭据,被授权设备向配件设备发送认证请求,第一信息和验证信息,验证信息是基于主控设备存储的第二凭据对第一信息处理得到的,配件设备基于本地的第二凭据对验证信息进行校验,在校验通过时,被授权设备通过认证。该方法,可以离线使用,不依赖于云端的处理,可以保证了主控设备访问配件设备的凭据的安全,具有更广泛的应用场景。

Description

设备授权方法及电子设备、系统
本申请要求于2022年06月22日提交中国专利局、申请号为202210712120.9、申请名称为“设备授权方法及电子设备、系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及终端技术领域,尤其涉及一种设备授权方法及电子设备、系统。
背景技术
随着物联网技术的发展,物联网设备也越来越多,例如智能音响、智能锁、智能摄像头和智能电视等。这些设备(也可以称为配件设备)除可以被其主人使用外,有些场景需要授权给其他用户使用,例如,智能摄像头的主人可以授权其他家人或朋友访问智能摄像头。这些设备之间的互联需要建立可信且安全的连接通道。
如图1所示设备的授权方法,用户A的主控设备把自己的配件设备(如第一配件设备和第二配件设备)分享给用户B的设备(被授权设备)使用时或之前,需要主控设备、第一配件设备和第二配件设备均登录用户A的账号连接其设备云,并同步要分享的配件设备的授权信息,如主控设备同步其设备标识DevID_1、公钥PK_1,本地保存其私钥SP_1;第一配件设备同步其设备标识DevID_2、公钥PK_2(即为访问其所需的凭据),本地保存其私钥SP_2;第二配件设备同步其设备标识DevID_3和对称密钥Key1(即为访问其所需的凭据)。被授权设备也需要登录用户B的账号连接其设备云,同步其公钥PK_3,本地保存其私钥SP_3。其中,公钥
具体授权的过程可以包括:
1、用户授权,即用户A通过主控设备向其设备云发送授权请求,以请求将第一配件设备和第二配件设备授权给用户B。
2、用户A的设备云同步授权信息给用户B的设备云。
3、同步授权关系给信任环云,获得信任环云的签名。其中,信任环云签名前,需要楞个设备云协商用户密钥,以对称密钥Key2为例,该用于加密签名后的挑战信息S1。另外,信任环云不管理对称凭据,因此不同步第二配件设备的信息,而且,信任环云也不需要同步设备的凭据,凭据无需要保存多份,挑战信息可以用于管控授权凭据的过程,以防重叠。
4、被授权设备登录其设备云。
5、用户B的设备云同步授权信息给被授权设备,即同步互信凭据。
上述方法,依赖云端处理,当用户没有设备云的账号或者设备无法登陆设备云时,则无法将配件设备授权给主控设备之外的其他设备使用。
发明内容
本申请实施例提供了一种设备授权方法及电子设备、系统,不依赖云端处理,可离线授权。
第一方面,本发明实施例提供了一种设备授权方法,包括;
主控设备与配件设备绑定,协商第一凭据和第二凭据;所述第一凭据不可分发,用于所述主控设备的认证;所述第二凭据可分发,用于被授权设备的认证;
所述主控设备响应于针对所述第二凭据的分享操作,在所述第二凭据的属性为可分发时,向所述被授权设备发送所述第二凭据。
上述方法,通过生成两个凭据,一个不可分发,用于主控设备与配件设备之间的认证,一个可分发,用于被授权设备与配件设备之间的认证,既保证了主控设备访问配件设备的凭据的安全,又可以离线使用,不依赖于云端的处理,具有更广泛的应用场景。
在一种可能的实现中,所述主控设备与配件设备绑定,协商第一凭据和第二凭据,包括:
所述主控设备与所述配件设备建立通信连接;
所述主控设备根据带外共享口令生成共享密钥;所述带外共享口令用于绑定所述配件设备;所述配件设备包括所述共享密钥或已根据所述带外共享口令生成所述共享密钥;
所述主控设备基于所述共享密钥与所述配件设备协商出所述第一凭据;
所述主控设备基于所述共享密钥与所述配件设备协商出所述第二凭据。
在一种可能的实现中,所述配件设备包括第一公钥和所述第一公钥对应的第一私钥,所述主控设备包括第二公钥和所述第二公钥对应的第二私钥,所述主控设备基于所述共享密钥与所述配件设备协商出所述第一凭据,包括:
所述主控设备基于所述共享密钥与所述配件设备与所述配件设备交换公钥,得到所述第一公钥;
所述主控设备存储所述第一凭据,所述主控设备存储的所述第一凭据包括:所述第一公钥、所述第二公钥和所述第二私钥;所述配件设备存储的所述第一凭据包括:所述第一公钥、所述第一私钥和所述第二公钥。
在一种可能的实现中,所述配件设备包括第三公钥和所述第三公钥对应的第三私钥,所述主控设备包括第四公钥和所述第四公钥对应的第四私钥,所述主控设备基于所述共享密钥与所述配件设备协商出所述第二凭据,包括:
所述主控设备基于所述共享密钥与所述配件设备与所述配件设备交换公钥,得到所述第三公钥;
所述主控设备存储所述第二凭据,所述主控设备存储的所述第二凭据包括所述第三公钥、所述第四公钥和所述第四私钥;所述配件设备存储的第二凭据包括所述第三公钥、所述第三私钥和所述第四公钥。
可选地,向所述被授权设备发送的所述第二凭据包括所述第四公钥;或包括所述第四公钥、所述第三公钥和所述第四公钥。
可选地,向所述被授权设备发送的所述第二凭据包括包括所述第三公钥和所述第四公钥,所述方法还包括:
所述主控设备接收来自所述被授权请求的签名请求,所述签名请求携带所述第五公钥,所述第五公钥为所述被授权设备的公钥;
所述主控设备通过所述第四私钥对所述第五公钥进行签名,得到数字签名;
所述主控设备向所述被授权设备发送所述数字签名,所述数字签名用于所述被授权设备向所述配件设备认证。
在一种可能的实现中,所述方法还包括:
所述主控设备响应于输入的用户操作,设置所述第一凭据的管理策略和所述第二凭据的管理策略,所述管理策略包括可连接次数,可连接时长,可访问的数据和/或业务中的至少一种;
所述主控设备将所述第一凭据的管理策略和所述第二凭据的管理策略发送至所述配件设备。
第二方面,本申请实施例还提供了一种设备认证方法,包括;
配件设备与主控设备绑定,协商第一凭据和第二凭据;所述第一凭据不可分发,用于所述主控设备的认证;所述第二凭据可分发,用于被授权设备的认证;
所述配件设备接收来自所述被授权设备的第一认证请求,所述第一认证请求包括第一信息和验证信息,所述验证信息是基于主控设备存储的所述第二凭据对所述第一信息处理得到的;
所述配件设备基于本地的所述第二凭据对所述验证信息进行校验;
所述配件设备在校验通过时,向所述被授权设备发送用于指示认证通过的指示信息。
上述方法,通过生成两个凭据,一个不可分发,用于主控设备与配件设备之间的认证,一个可分发,用于被授权设备与配件设备之间的认证,既保证了主控设备访问配件设备的凭据的安全,又可以离线使用,不依赖于云端的处理,具有更广泛的应用场景。
在一种可能的实现中,所述主控设备存储的所述第二凭据包括所述第三公钥、所述第四公钥和所述第四私钥;所述配件设备存储的第二凭据包括所述第三公钥、所述第三私钥和所述第四公钥。
在一种可能的实现中,所述第一信息为第一字符串,所述验证信息为第一数字签名,所述第一数字签名是所述第一字符串使用所述第四私钥的签名;所述配件设备基于本地的所述第二凭据对所述验证信息进行校验,包括:
所述配件设备通过本地的所述第三公钥解密所述第一数字签名,得到摘要值;
所述配件设备计算所述第一字符串的摘要值;
在计算得到的摘要值与解密得到的摘要值相同时,则校验通过;
在计算得到的摘要值与解密得到的摘要值不同时,则校验失败。
在一种可能的实现中,所述方法还包括:所述被授权设备包括第五公钥和所述第五公钥对应的第五私 钥,所述第一信息为所述第五公钥,所述验证信息为第三数字签名,所述第三数字签名是所述第五公钥使用所述第三私钥的签名;所述配件设备基于本地的所述第二凭据对所述验证信息进行校验,包括:
所述配件设备通过本地的所述第三公钥解密所述第三数字签名,得到摘要值;
所述配件设备计算所述第五公钥的摘要值;
在计算得到的摘要值与解密得到的摘要值相同时,则校验通过;
在计算得到的摘要值与解密得到的摘要值不同时,则校验失败。
在一种可能的实现中,所述方法还包括:
所述配件设备使用所述第三私钥对第二字符串进行签名,得到第二数字签名;
所述配件设备向所述被授权设备发送第二认证请求,所述第二认证请求包括所述第二字符和所述第二数字签名;所述第二数字签名用于所述被授权设备基于本地的第三公钥验签。
在一种可能的实现中,所述第二凭据为对称密钥;所述第一信息为字符串,所述验证信息为所述第一信息的MAC值,所述配件设备基于本地的所述第二凭据对所述验证信息进行校验,包括:
所述配件设备通过本地存储的第二凭据对验证信息进行解密,得到摘要值;
所述配件设备计算所述第一信息的摘要值;
在计算得到的摘要值与解密得到的摘要值相同时,则校验通过;
在计算得到的摘要值与解密得到的摘要值不同时,则校验失败。
在一种可能的实现中,所述方法还包括:
所述配件设备接收所述第一凭据的管理策略和所述第二凭据的管理策略,所述管理策略包括可连接次数,可连接时长,可访问的数据和/或业务中的至少一种;
所述配件设备接收访问请求,
所述配件设备在所述访问请求来源于所述主控设备时,通过所述第一凭据的管理策略响应所述访问请求;
所述配件设备在所述访问请求来源于所述被授权设备或不是所述主控设备时,通过所述第二凭据的管理策略响应所述访问请求。
上述方法可以实现针对不同凭据的不同访问管理,可以提高配件设备内部数据的安全性。
在一种可能的实现中,在所述访问请求来源于所述被授权设备时,所述通过所述第二凭据的管理策略响应所述访问请求,包括如下步骤中的至少一个:
判断与所述被授权设备的连接次数是否小于N,N为正整数;
判断与所述被授权设备的连接时长是否小于预设时长;
判断所述访问请求所要访问的业务或数据是否在所述第二凭据对应的可访问数据和/或业务的范围内。
上述方法可以实现针对不同凭据的不同访问管理,可以提高配件设备内部数据的安全性。
第三方面,本申请实施例还提供了一种设备认证方法,包括;
配件设备与主控设备绑定,协商第一凭据,
所述配件设备接收来自所述被授权设备的认证请求,所述认证请求包括第三凭据和所述验证信息,所述验证信息是所述主控设备基于本地存储的第一凭据对所述第三凭据进行处理得到的;
所述配件设备通过本地的第一凭据验证所述验证信息;
所述配件设备在验证通过时,向所述被授权设备发送用于指示认证通过的指示信息。
上述方法,通过主控设备为被授权设备的凭据作背书,而不需要向其发送主控设备的凭据,可以保证了主控设备访问配件设备的凭据的安全,且可以离线使用,不依赖于云端的处理,具有更广泛的应用场景。
在一种可能的实现中,所述第一凭据包括所述配件设备的第一公钥、所述第一公钥对应的第一私钥、所述主控设备的第二公钥和所述第二公钥对应的第二私钥;所述第三凭据为所述被授权设备的公钥或对称密钥;所述验证信息为所述第三凭据通过所述主控设备存储的所述第二私钥的签名;所述配件设备通过本地的第一凭据验证所述验证信息,包括:
所述配件设备通过所述第二公钥对所述第三凭据的签名进行验签,在验签通过时,则验证通过。
在一种可能的实现中,所述第一凭据包括第一对称密钥,所述验证信息为通过所述主控设备存储的所述第一对称密钥计算的所述第三凭据的MAC值;所述配件设备通过本地的第一凭据验证所述验证信息,包括:
所述配件设备通过本地的所述第一对称密钥计算所述第三凭据的MAC值;
所述配件设备在计算得到的MAC值与所述认证请求携带的MAC值相同时,确定验证通过。
在一种可能的实现中,所述方法还包括:
所述配件设备接收所述第一凭据的管理策略和非第一凭据的管理策略,所述管理策略包括可连接次数,可连接时长,可访问的数据和/或业务中的至少一种;
所述配件设备接收访问请求,
所述配件设备在所述访问请求来源于所述主控设备时,通过所述第一凭据的管理策略响应所述访问请求;
所述配件设备在所述访问请求来源于所述被授权设备或不是所述主控设备时,通过所述非第一凭据的管理策略响应所述访问请求。
在一种可能的实现中,在所述访问请求来源于所述被授权设备时,所述通过所述非第一凭据的管理策略响应所述访问请求,包括如下步骤中的至少一个:
判断与所述被授权设备的连接次数是否小于N,N为正整数;
判断与所述被授权设备的连接时长是否小于预设时长;
判断所述访问请求所要访问的业务或数据是否在所述第二凭据对应的可访问数据和/或业务的范围内。
第四方面,本申请实施例还提供了一种设备认证方法,包括:
被授权设备向主控设备发送背书请求,所述背书请求包括第三凭据;
所述被授权设备接收来自所述主控设备的验证信息,所述验证信息是所述主控设备基于本地存储的第一凭据对所述第三凭据进行处理得到的;所述第一凭据用于所述主控设备和所述配件设备的可信通信;
所述被授权设备向配件设备发送认证请求,所述认证请求包括第三凭据和所述验证信息,以使所述配件设备通过本地的所述第一凭据验证所述验证信息。
上述方法,通过主控设备为被授权设备的凭据作背书,而不需要向其发送主控设备的凭据,可以保证了主控设备访问配件设备的凭据的安全,且可以离线使用,不依赖于云端的处理,具有更广泛的应用场景。
在一种可能的实现中,所述第一凭据包括所述配件设备的第一公钥、所述第一公钥对应的第一私钥、所述主控设备的第二公钥和所述第二公钥对应的第二私钥;所述第三凭据为所述被授权设备的公钥或对称密钥;所述验证信息为所述第三凭据通过所述主控设备存储的所述第二私钥的签名;
或,所述第一凭据包括第一对称密钥,所述验证信息为通过所述主控设备存储的所述第一对称密钥计算的所述第三凭据的MAC值。
第五方面,本申请实施例还提供了一种电子设备,包括至少一个处理器和至少一个存储器,所述至少一个处理器耦合所述至少一个存储器,所述至少一个存储器用于存储计算机指令,当所述处理器执行所述计算机指令时,所述电子设备执行如第一方面或其任意一种实现中所述主控设备执行的方法,或执行如第二方面或第三方面或其任意一种实现中所述配件设备执行的方法,或执行如第四方面或其任意一种实现中所述被授权设备执行的方法。
可选地,上述电子设备还可以包括其他用于实现上述第一方面或第一方面任意一种可能的实现所述的方法中的元件或模块,或包括其他用于实现上述第二至三方面或第二至三方面任意一种可能的实现所述的方法中的元件或模块、包括其他用于实现上述第四方面或第四方面任意一种可能的实现所述的方法中的元件或模块该电子设备中处理器执行的各个步骤的具体实现和达到的有益效果可以参见上述第一至四方面或它们的任意一种可能的实现中相关描述,这里不再赘述。
第六方面,本申请实施例还提供了一种通信系统,该系统可以包括主控设备、被授权设备和配件设备,其中,主控设备用于实现如上述第一方面或第一方面任意一种可能的实现所述的方法;配件设备用于实现上述第二至三方面或第二至三方面任意一种可能的实现所述的方法,被授权设备用于实现上述第四方面或第四方面任意一种可能的实现所述的方法。
第七方面,本申请实施例还提供了一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序指令,所述计算机程序指令当被处理器执行时使所述处理器执行执行如第一方面或其任意一种实现中所述主控设备执行的方法,或执行如第二方面或第三方面或其任意一种实现中所述配件设备执行的方法,或执行如第四方面或其任意一种实现中所述被授权设备执行的方法。
附图说明
下面将对本申请实施例所涉及的附图进行说明。
图1是现有技术提供的一种设备的授权方法的示意性说明图;
图2A是本申请实施例提供的一种通信系统的架构示意图;
图2B是本申请实施例提供的又一种通信系统的架构示意图;
图2C是本申请实施例提供的又一种通信系统的架构示意图;
图3是本申请实施例提供的一种设备授权方法的示意性说明图;
图4是本申请实施例提供的一种设备授权方法的流程示意图;
图5是本申请实施例提供的一种主控设备与配件设备的绑定方法的流程示意图;
图6A-图6C是本申请实施例提供的一些认证方法的流程示意图;
图6D是本申请实施例提供的一种根据第二凭据的管理策略处理访问请求的方法的流程示意图;
图7是本申请实施例提供的又一种设备授权和认证方法的流程示意图;
图8是本申请实施例提供的一种设备授权方法的示意性说明图;
图9是本申请实施例提供的一种设备授权方法的流程示意图;
图10是本申请实施例提供的又一种设备授权和认证方法的流程示意图;
图11是本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
下面将结合附图对本申请实施例中的技术方案进行清除、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
如下对本申请涉及的技术术语进行说明。
(1)凭据、对称凭据和非对称凭据
本申请实施例中,凭据可以用于身份合法性的认证,以实现两个设备之间的可信通信。在一些实施例中,凭据还可以用于传输的数据的加密。其中,对称凭据是指通信的双方使用的凭据相同。非对称凭据是指通信的双方使用的凭据不同。
例如,认证码(authentication code)是一种对称凭据,是可信通信双方可以提前协商/交换相同的秘密。
又例如,认证对称密钥(symmetric key)是一种对称凭据,需要通信双方提前协商并共享该对称密钥。发送方和接收方也可以使用相同的对称密钥对所要传输的数据进行加密和解密运算。
又例如,认证公钥(public key)跟私钥配合是一种非对称凭据。通信双方可以交换各自的公钥,保存自己的私钥(private key)。通信双方均可以用对方的公钥进行加密,用自己的私钥进行解密;发送方可以用自己的私钥进行签名,接收方可以用发送发的公钥进行验签。
在本申请一些实施例中,主控设备和配件设备可以交换各自的公钥,主控设备可以使用自己的私钥对被授权设备发过来的凭据(可以是对称凭据或非对称凭据)进行签名,也即为被授权设备背书,被授权设备使用签名后的凭据向配件设备认证。
(2)直接凭据和间接凭据
在本申请实施例中,凭据可以设置属性,其中一种属性可以包括直接和间接,属性为直接和间接的凭据分别称为直接凭据和间接凭据。其中,直接凭据用于配件设备与其主控设备之间的通信,间接凭据用于配件设备与被授权设备之间的通信。也可以说,直接凭据是被授权设备和配件设备直接使用的凭据,间接凭据是主控设备不直接使用,而由被授权设备使用的凭据。
(3)认证:
认证的是为了确认对方身份合法。其中,非对称密钥中的私钥、对称密钥可以代表身份,认证不在于传输数据的机密性,而在于验证对方是否真的持有私钥、对称密钥。为了保证私钥、对称密钥的信息安全,在认证过程中一般不直接传输私钥、对称密钥,而是采用“零知识证明(zero knowledge proof)”的技术。
(4)、签名和验签
签名:在发送数据D之前,发送方首先使用通信双方协商好的散列函数计算其摘要值,进一步地使用自己的私钥对摘要值进行加密,得到的密文即签名或消息认证码(message authentication code,MAC),将签名(MAC值)、数据D一起发送给接收方。
验签:接收方接收到报文后,采用发送方的公钥对签名进行解密,得到摘要值;将报文中的数据通过与发送方同样的运算计算摘要值;再将计算出的摘要值与解密得到的摘要值进行对比,如果二者一致,则说明数据D没有被篡改,如果不一致,则说明数据D被篡改。
如图2A所示为本申请实施例提供的一种通信系统的架构图,该通信系统可以包括但不限于主控设备11、配件设备12和被授权设备13。
配件设备12可以是如,智能音响、智能摄像头、智能锁、智能电视、灯具、空调、电饭煲、热水器、扫地机器人等智能家居设备,还可以是打印机、投影仪等办公设备或其他设备。
主控设备11或被授权设备13可以是手机、平板电脑、笔记本电脑等终端设备。
主控设备11可以是绑定配件设备12的设备。主控设备11可以与配件设备12在建立通信连接后,可以基于带外共享口令或者约定信息等生成至少一个凭据,该凭据可以作为主控设备11或被授权设备13访问或控制配件设备12的凭据。
在将配件设备授权给被授权设备使用时,需要被授权设备基于凭据进行认证,以保证设备之间的安全、可信通信。
在一些实施例中,主控设备11与配件设备12进行绑定时,可以生成两个凭据,分别为直接凭据(也称为第一凭据)和间接凭据(也称为第二凭据)。其中,主控设备11可以通过直接凭据与备件配件设备12建立可信通信。主控设备11可以将间接凭据发送給被授权设备13,被授权设备13基于该间接凭据与配件设备建立可信通信连接。具体实现可以参见实施例一和实施例二,这里不再赘述。
在一些实施例中,主控设备11与配件设备12进行绑定时,可以生成至少一个非对称凭据。被授权设备13可向主控设备11发送背书请求,以请求其为自己的凭据(可以是对称凭据,也可以是非对称凭据,本申请实施例称为第三凭据)背书,主控设备11可以通过自己的私钥对第三凭据进行签名,并将第三凭据的签名发送给被授权设备13。此时,被授权设备13可以基于第三凭据的签名与配件设备建立可信通信连接。具体实现可以参见实施例三和实施例四,这里不再赘述。
如图2B所示,为本申请实施例提供的另一种通信系统的架构图,其中:
主控设备11可以包括第一凭据协商模块111、第一凭据分享模块112、凭据属性设置模块113。其中,第一凭据协商模块111用于与配件设备12协商得到至少一个凭据,例如第一凭据和第二凭据;第一凭据分享模块112用于基于凭据的属性判断要分享的凭据(如第二凭据)是否可分享,若可分享则将第二凭据分享至分享被授权设备13;凭据属性设置模块113用于设置凭据的属性,例如,设置第一凭据的属性为直接,不可分发,第二凭据的属性为间接、可分发;第一凭据分享模块112用于实现将第二凭据分享至分享被授权设备13。
被授权设备13可以包括第二凭据分享模块131和第二凭据可信交换模块132。其中,第二凭据分享模块131用于接收主控设备11分享的第二凭据,进一步地通过第二凭据可信交换模块132向配件设备12向配件设备12发送凭据,以验证身份,并接收来自配件设备12的验证结果。
配件设备12可以包括第二凭据协商模块121、凭据访问控制模块122、第一凭据可信交换模块123和数据/业务模块124。其中,第二凭据协商模块121用于与主控设备11协商得到至少一个凭据,例如第一凭据和第二凭据。凭据访问控制模块122用于基于凭据的管理策略,确定该凭据对应的可访问次数、可访问时长以及可访问数据和/或业务等。第一凭据可信交换模块123用于基于第二凭据验证被授权设备的身份。数据/业务模块124用于存储数据和业务,以处理来自主控设备11和被授权设备13的访问请求。
具体实现可以参见实施例一和实施例二,这里不再赘述。
如图2C所示,为本申请实施例提供的另一种通信系统的架构图,其中:
主控设备11可以包括第一凭据协商模块111、凭据背书模块114。其中,第一凭据协商模块111用于与配件设备12协商得到至少一个凭据,例如第一凭据;凭据背书模块114用于对来自被授权设备的凭据(即第三凭据)进行签名,以为其背书,并将第三凭据的签名发送至被授权设备13。
被授权设备13可以包括凭据请求背书模块133和第二凭据可信交换模块132。其中,凭据请求背书模 块133用于向主控设备111发送背书请求,以请求主控设备11为其凭据(第三凭据)背书,以及接受主控设备11发送的第三凭据的签名;进一步地通过第二凭据可信交换模块132向配件设备12向配件设备12发送第三凭据和第三凭据的签名,以验证身份,并接收来自配件设备12的验证结果。
配件设备12可以包括第二凭据协商模块121、凭据访问控制模块122、第一凭据可信交换模块123和数据/业务模块124。其中,第二凭据协商模块121用于与主控设备11协商得到至少一个凭据,例如第一凭据。凭据访问控制模块122用于基于凭据的管理策略,确定该凭据对应的可访问次数、可访问时长以及可访问数据和/或业务等。第一凭据可信交换模块123用于基于第三凭据的签名验证被授权设备的身份。数据/业务模块124用于存储数据和业务,以处理来自主控设备11和被授权设备13的访问请求。
具体实现可以参见实施例三和实施例四,这里不再赘述。
如下介绍本申请实施例提供的方法。
实施例一
如图3和图4所示的设备授权方法的示意性说明图和流程示意图,该方法可以由上述图2A或图2B所示的系统实现,可以包括授权、认证和数据访问三个阶段。
(一)授权阶段:
S101:主控设备与配件设备绑定,协商第一凭据和第二凭据。其中,该第一凭据的属性包括直接、不可分发;第二凭据的属性为间接、可分发。
具体地,主控设备与配件设备可以通过蓝牙、WIFI等通信方式建立通信连接,绑定配件设备。绑定过程中,除生成用于主控设备与配件设备之间建立可信通信的凭据,即第一凭据外,还协商出一份用于授权其他设备与配件设备之间建立可信通信的凭据,即第二凭据。其中,第一凭据为直接凭据,第二凭据为间接凭据。
如图5所示,为本申请实施例提供的一种主控设备与配件设备的绑定方法,该方法可以包括但不限于如下步骤:
S1011:主控设备与配件设备建立通信连接。
具体地,主控设备可以与配件设备建立蓝牙、WIFI、NFC等近距离通信连接。在建立通信连接后,可以执行S1012和S1013。
S1012:主控设备获取带外共享口令,根据带外共享口令生成共享密钥。
其中,带外共享口令可以是用户已知的秘密。用户可以将该带外共享口令分别输入到主控设备和配件设备。主控设备和配件设备在接收到带外共享口令后,分别根据该带外共享口令通过相同的算法进行运算,可以产生相同的密钥,这里称为共享密钥。
例如,主控设备和配件设备可以采用密码认证密钥交换(Password authenticated key exchange,PAKE)协议、SPAKE协议来协商生成共享密钥。
S1013:配件设备获取带外共享口令,根据带外共享口令生成共享密钥。
应理解,配件设备和主控设备使用相同的,生成的共享密钥也是相同的。具体实现可以参见上述S1012,这里不再赘述。
在一些实施例中,配件设备可以不执行S1013,该共享密钥可以提前存储在配件设备中。
S1014:主控设备与配件设备基于共享密钥协商出第一凭据和第二凭据,并设置第一凭据和第二凭据的属性。
基于第一凭据和第二凭据是否对称性密钥,如下分多个实现方式讨论:
实现方式1:第一凭据和第二凭据均为对称密钥。
在一些实施例中,在得到共享密钥后,主控设备和配件设备基于共享密钥通过PAKE协议或SPAKE协议分别进行2次协商,得到第一凭据(对称密钥Key1)和第二凭据(对称密钥Key2)。
在另一些实施例中,第一凭据为对称密钥,上述共享密钥即为第一凭据。基于共享密钥通过PAKE协议或SPAKE协议再进行一次协商,得到第二凭据,例如对称密钥Key2。
此时,主控设备和配件设备均存储了相同的对称密钥。例如,主控设备和配件设备均存储了下述表1的内容。

表1
其中,凭据的属性可以由主控设备和配件设备之一设置,再共享给对方,也可以各自设置,这里不作限定。
实现方式2:第一凭据和第二凭据均为非对称密钥。
具体地,主控设备和配件设备可以分别生成两对公私钥。例如,配件设备生成的一对公私钥对为公钥PK1和私钥SK1,另一对公私钥为公钥PK3、私钥SK3;主控设备生成的一对公私钥对为公钥PK2和私钥SK2,另一对公私钥为公钥PK4、私钥SK4。进一步地,主控设备和配件设备均可以交换各自的公钥,得到第一凭据和第二凭据。其中,第一凭据包括配件设备的公钥PK1和私钥SK1、主控设备的公钥PK2和私钥SK2;第二凭据包括配件设备的公钥PK3和私钥SK3、主控设备的公钥PK4和私钥SK4。在采用公钥和私钥作为凭据时,通常凭据时分布式存储于多个设备。此时,配件设备存储的凭据和凭据的属性如下述表2所示,主控设备存储的凭据和凭据的属性如下述表3所示。
表2
表3
实现方式3:第一凭据为对称密钥,第二凭据为非对称密钥。
第一凭据为上述共享密钥或上述对称密钥Key1,主控设备和配件设备可以分别生成一对公私钥。例如,配件设备生成的一对公私钥对为公钥PK3、私钥SK3;主控设备生成的一对公私钥对为公钥PK4、私钥SK4。其中,对称密钥Key1作为第一凭据。进一步地,主控设备和配件设备可以交换各自的公钥,得到第二凭据。第二凭据包括配件设备的公钥PK3和私钥SK3、主控设备的公钥PK4和私钥SK4。配件设备存储的凭据凭据的属性如下述表4所示,主控设备存储的凭据和凭据的属性如下述表5所示。
表4
表5
实现方式4:第一凭据为非对称密钥,第二凭据为对称密钥。
主控设备和配件设备可以分别生成一对公私钥。例如,配件设备生成的一对公私钥对为公钥PK1、私钥SK1;主控设备生成的一对公私钥对为公钥PK3、私钥SK3。进一步地,主控设备和配件设备均可以交换各自的公钥,从而得到第一凭据。其中,第一凭据包括配件设备的公钥PK1和私钥SK1、主控设备的公钥PK2和私钥SK2。在一些实施例中,第二凭据为上述共享密钥或上述对称密钥Key1或对称密钥Key2,具体实现可以参见上述实施方式1,这里不再赘述。
此时,以第二凭据为对称密钥Key2为例,在交换公钥后,配件设备存储的凭据和凭据的属性如下述表6所示,主控设备存储的第一凭据和第二凭据如下述表7所示。
表6

表7
在得到第一凭据后,主控设备可以与被授权设备进行可信通信。
例如,主控设备与配件设备可以通过对称密钥Key1进行加密要传输给对方的数据,同样使用该对称密钥解密接收到的来自对方的数据。
又例如,主控设备可以利用公钥PK1对要传输给配件设备的数据进行加密,配件设备通过私钥SK1解密该数据;同理,配件设备可以利用公钥PK2对要传输给主控设备的数据进行加密,主控设备通过私钥SK2解密该数据。
需要说明的是,虽然本申请中,将公钥PK1、私钥SK1、公钥PK2和私钥SK2都称为第一凭据的内容,然而,也可以将存储于配件设备的私钥SK1和公钥PK2称为一个凭据,将存储于主控设备的公钥私钥SK2和公钥PK1称为另一个凭据,这两个凭据为一对凭据。也就是说,本申请第一凭据可以理解为一对凭据。同理,第二凭据也可以理解为一对凭据。
S102:主控设备响应于输入的用户操作,设置凭据的管理策略。
用户可以通过主控设备设置凭据的管理策略。其中,管理策略可以包括对使用该凭据的设备的可连接次数,可连接时长,可访问的数据和/或业务等的管理。例如,主控设备响应于用户的操作,可以,针对不同的凭据或不同属性的凭据可以设置不同的管理策略,得到凭据与可连接次数、可连接时长、可访问的数据和/或业务的对应关系。进一步地,还可以将该对应关系发送到配件设备,以实现配件设备基于凭据的管理策略来处理来自不同设备的访问请求。如表8所示,为凭据管理的一个示例:
表8
其中,N为正整数,N可以是1次,也可以是多次,如2次、10次等;T可以是1分钟、10分钟、20分钟等。应理解,可以基于应用场景的需要来设置N和T,此处不作限定。
在一些实施例中,S102还可以由配件设备来执行。
S102还可以在其他时间执行,例如,当设置的对应关系是凭据的属性与可连接次数、可连接时长、可访问的数据和/或业务之间的对应关系时,S102可以发生在任何阶段或任何阶段的任何时候。
S103:主控设备响应于针对第二凭据的分享操作,根据第二凭据的属性判断该第二凭据是否允许被分享。如果是,则执行S104;否则,输出用于提示凭据不可分享的指示信息。
当用户A想要分享凭据给用户B时,用户A可以输入针对第二凭据的分享操作,主控设备在接收到针对凭据的分享操作后,根据要分享的凭据的属性信息判断该凭据是否允许被分享,如果所要分享的凭据的属性是间接和/或可分享,则向该凭据允许被分享,否则该凭据不允许被分享。
S104:主控设备向被授权设备发送第二凭据。
在一些实施例中,主控设备可以主动向被授权设备发送第二凭据。例如,主控设备通过即时通讯的方式向被授权发送第二凭据。此时,主控设备还向被授权设备发送配件设备的标识,以指示该凭据应用的配件设备。
在另一些实施例中,被授权设备可以向主控设备发送凭据请求,凭据请求携带配件设备的标识,以请求使用该配件设备的凭据。主控设备响应于该凭据请求,执行S103和S104以向被授权设备发送第二凭据。
在一些实施例中,第二凭据为对称密钥,发送的第二凭据为对称密钥Key2。
在另一些实施例中,第二凭据为非对称密钥,发送的第二凭据为配件设备的公钥PK3,或者第二凭据公钥PK3,还发送了私钥SK4。发送的内容不同,其认证方法也有所差异,将在步骤S107-S108中详细描述。
S105:被授权设备接收第二凭据。
(二)认证阶段:
S106:被授权设备与配件设备建立通信连接。
具体地,连接方式可以包括但不限于蓝牙、WIFI、NFC等近距离通信连接。
S107:被授权设备基于第二凭据向配件设备发送认证请求,认证请求携带第一信息和第一信息的验证信息。
S108:配件设备基于本地的凭据信息对验证信息进行校验。
其中,配件设备本地的凭据信息包括其本地存储的第一凭据和第二凭据。具体参见上述实现方式1-4中表1、2、4和6,这里不再赘述。
例如,第一信息为字符串,验证信息为数字签名,该数字签名是该字符串使用第四私钥的签名。又例如,第一信息为公钥,验证信息为该公钥使用第四私钥第三数字签名,又例如,第一信息为字符串,验证信息为第一信息的MAC值。具体可以参见下述实现1-3中具体描述,这里不再赘述。
该认证请求用于请求配件设备验证被授权设备是否可信设备。在本实施例一和二中,具配件设备可以通过验证被授权设备是否包含与其本地存储第二凭据一致的对称密钥Key2(当第二凭据为对称凭据时)或包含于其本地存储的第二凭据匹配的私钥SK4(当第二凭据为非对称凭据时)。
S109:配件设备向被授权设备发送校验结果。
校验结果包括校验成功和校验失败,当S108校验通过,配件设备向被授权设备发送用于指示校验通过的指示信息;若校验失败,则配件设备向被授权设备发送校验结果用于指示校验失败的指示信息。
在建立通信连接后,被授权设备可以利用第二凭据尝试与配件设备建立可信连接。基于第二凭据的为对称凭据还是非对称凭据,分两个实现来描述上述认证过程(S107-S109)的具体实现:
实现1:
在实现1中,第二凭据为对称凭据,即为对称密钥Key2。主控设备、被授权设备和配件设备本地均保存对称密钥Key2。
如图6A所示,该认证方法可以包括但不限于如下步骤:
a1:被授权设备随机生成字符串M 1。
a2:被授权设备通过本地对称密钥Key2计算该字符串M 1的MAC值。
具体地,被授权设备先计算字符串M 1的摘要值,在通过对称密钥Key2对该摘要值进行加密,进而得到该字符串M 1的MAC值。
a3:被授权设备发送认证请求,该认证请求包括字符串M1和MAC值。
a4:配件设备通过本地的对称密钥Key2计算接收到的字符串的MAC值。
a5:配件设备判断计算得到的MAC值与认证请求携带的MAC值是否一致,如果是,则执行a6,否则执行a7。
其中,认证请求还包括被授权设备的标识。配件设备在接收到认证请求后,若发送该认证请求的设备不是主控设备,则配件设备会选择通过本地的第二凭据来验证该认证请求。具体地,配件设备通过本地的对称密钥Key2计算接收到的字符串的MAC值,若计算得到的MAC值与认证请求携带的MAC值一致,则说明被授权设备拥有与配件设备相同的对称密钥Key2,被授权设备是可信的设备,认证通过;若两个MAC值不一致,则说明被授权设备本地的对称密钥Key2与配件设备本地的对称密钥Key2不同,被授权设备不是可信的设备,认证失败。
a6:配件设备向被授权设备发送用于指示认证通过的指示信息。
a7:配件设备向被授权设备发送用于指示认证失败的指示信息。
应理解,若发送该认证请求的设备是主控设备,则配件设备会选择通过第一凭据来验证该认证请求,验证的方法同上述通过第二凭据来验证该认证请求,这里不再赘述。
还应理解,被授权设备还可以反向验证配件设备是不是可信设备,此时,方法同上述a1-a7,步骤a1-a7中的被授权设备与配件设备互换。
在另一种实现中,为了保证对称密钥Key2的安全,认证请求可以不包含对称密钥Key2本身,而包括对称密钥Key2的摘要值。配件设备在接收到认证请求后,可以计算本地第二凭据(对称密钥Key2)的摘要值,若计算得到的摘要值中包含与认证请求携带的摘要值一致,则认证通过,否则认证失败。
实现2:
第二凭据为非对称凭据,即为PK3、SK3、PK4、SK4。主控设备本地保存的第二凭据包括PK3、PK4、SK4,配件设备本地保存的第二凭据包括PK3、SK3、PK4。主控设备发送给被授权设备的第二凭据至少包括SK4,例如包括PK3、PK4、SK4,即为被授权设备本地保存的第二凭据包括PK3、PK4、SK4。
如图6B所示,认证方法可以包括正向认证和反向认证两个部分。其中,正向认证包括但不限于如下部分或全部步骤,以确定被授权设备是否真的包含私钥SK4:
b1:被授权设备随机生成字符串M2。
b2:被授权设备使用私钥SK4对字符串M2进行签名,得到数字签名S1。
具体地,被授权设备首先计算字符串M2的摘要值,进一步地,通过私钥SK4对该摘要值进行加密,得到的密文即为数字签名S1。
b3:被授权设备向配件设备发送认证请求Q1,该认证请求Q1包括字符串M2和数字签名S1。
b4:配件设备通过本地的公钥PK3验签该数字签名S1。若验签通过,则执行b5,否则执行b6。
其中,认证请求还包括被授权设备的标识。配件设备在接收到认证请求后,若发送该认证请求的设备不是主控设备,则配件设备会选择通过本地的第二凭据来验证该认证请求。具体地,配件设备计算接收到的字符串M1的摘要值,并通过本地的第二凭据中的公钥PK3解密数字签名S1得到摘要值,若计算得到的摘要值与解密得到的摘要值一致,则说明被授权设备拥有与本地的公钥PK3匹配的私钥,被授权设备是可信的设备,认证通过;若两个摘要值、不一致,则说明被授权设备不具有与本地的公钥PK3匹配的私钥,被授权设备不是可信的设备,认证失败。
在一些实施例中,认证请求Q1还可以不携带字符串M2,而携带字符串M2的摘要值,此时,配件设备可以将解密得到的摘要值与认证请求携带的摘要值比对。
b5:配件设备向被授权设备发送用于指示认证通过的指示信息。
b6:配件设备向被授权设备发送用于指示认证失败的指示信息。
反向认证包括但不限于如下部分或全部步骤,以确定配件设备是否真的包含私钥SK3:
b7:配件设备随机生成字符串M3。
b8:配件设备使用私钥SK3对字符串M3进行签名,得到数字签名S2。
b9:配件设备向被授权设备发送认证请求Q2,该认证请求包括字符串M3和数字签名S2。
b10:被授权设备通过本地的公钥PK3验签该数字签名S2。若验签通过,则执行b11,否则执行b12。
具体地,被授权设备计算接收到的字符串M3的摘要值,并通过本地的第二凭据中的公钥PK3解密数字签名S2得到摘要值,若计算得到的摘要值与解密得到的摘要值一致,则说明配件设备拥有与本地的公钥PK3匹配的私钥,配件设备是可信的设备,认证通过;若两个摘要值、不一致,则说明配件设备不具有与本地的公钥PK3匹配的私钥,配件设备不是可信的设备,认证失败。
b11:被授权设备向配件设备发送用于指示认证通过的指示信息。
b12:被授权设备向配件设备发送用于指示认证失败的指示信息。
需要说明的是,签名和验签的具体实现可以参见术语描述部分,也可以参见上述正向认证中的相关描述,这里不再赘述。
在一些实施例中,也可以不包括反向认证的过程,此时主控设备发送给被授权设备的第二凭据也可以只包括PK4、SK4。
在实现2中,被授权设备以主控设备的名义来访问配件设备,但是由于其凭据属于间接凭据,从而可以区分于主控设备,拥有与主控设备不同的权限。配件设备会基于凭据的不同,而采用不同的管理策略。具体参见上述授权阶段和下述访问阶段中的相关描述。
在一些实施例中,上述字符串M2和M3也可以替换为公钥PK3或PK4,此时,在被授权设备和配件设备本地均存储了公钥PK3和公钥PK4,认证请求中不需要携带公钥PK3或PK4,也不需要携带公钥PK3或PK4的摘要值。
需要说明的是,被授权设备本地存储的第二凭据不一定包含主控设备存储的第二凭据的全部,可以只包含私钥SK4,或者只包含私钥SK4和公钥PK3。
实现3:
第二凭据为PK3、SK3、PK4、SK4。主控设备本地保存的第二凭据包括PK3、PK4、SK4,配件设备本地保存的第二凭据包括PK3、SK3、PK4。主控设备发送给被授权设备的第二凭据包括PK3、PK4,即为被授权设备本地保存的第二凭据包括PK3、PK4,而不包含主控设备的私钥SK3。
如图6C所示,认证方法可以包括正向认证和反向认证两个部分。其中,正向认证的过程可以包括但不限于如下步骤,以确定被授权设备是否被主控设备授权:
c1:被授权设备向主控设备发送签名请求,该签名请求包括公钥PK5,用于请求主控设备对PK5进行 签名,被授权设备包括公钥PK5和对应的私钥SK5。
c2:主控设备通过私钥SK4对公钥PK5进行签名,得到数字签名S3。
c3:主控设备向被授权设备发送数字签名S3。
c4:被授权设备接收数字签名S3。
c5:被授权设备向配件设备发送认证请求Q3,该认证请求包括公钥PK5和数字签名S3。
c6:配件设备通过本地公钥PK4验签数字签名S3。若验签通过,则执行c7,否则执行c8。
配件设备在接收到认证请求后,通过公钥PK4对数字签名S3进行解密,得到公钥PK5的摘要值,进一步地,计算认证请求包含的公钥PK5的摘要值,若计算的摘要值与解密得到的摘要值一致,则认证通过,否则认证失败,。
c7:配件设备向被授权设备发送用于指示认证通过的指示信息。
c8:配件设备向被授权设备发送用于指示认证失败的指示信息。
被授权设备可以反向认证,以确定配件设备是否真的包含私钥SK3。反向认证的过程可以同上述实现2中反向认证的过程,即包括但不限于如下步骤:
c9:配件设备通过私钥SK3对字符串M4进行签名,得到数字签名S4。
c10:配件设备向被授权设备发送认证请求Q4,该认证请求包括字符串M4和数字签名S4。
c11:被授权设备通过本地的公钥PK3验签该数字签名S4。
具体地,被授权设备计算接收到的字符串M4的摘要值,并通过本地的第二凭据中的公钥PK3解密数字签名S4得到摘要值,若计算得到的摘要值与解密得到的摘要值一致,则说明配件设备拥有与本地的公钥PK3匹配的私钥,配件设备是可信的设备,认证通过;若两个摘要值、不一致,则说明配件设备不具有与本地的公钥PK3匹配的私钥,配件设备不是可信的设备,认证失败。
c12:被授权设备向配件设备发送用于指示认证通过的指示信息。
c13:被授权设备向配件设备发送用于指示认证失败的指示信息。
在一些实施例中,上述字符串M4也可以替换为公钥PK3、PK4或PK5,此时,在被授权设备和配件设备本地均存储了公钥PK3、公钥PK4和PK5(在正向认证后配件设备得到了PK5),认证请求中不需要携带公钥PK3、PK4或PK5,也不需要携带公钥PK3、PK4或PK5的摘要值。
(三)访问阶段:
在认证通过后,被授权设备可以访问配件设备中的数据或业务。
S110:被授权设备向配件设备发送访问请求。
在一些应用场景中,配件设备为智能音响,该访问请求携带待播放数据,用于请求配件设备播放待播放数据。
在一些应用场景中,配件设备为智能摄像头,该访问请求携带待播放数据,用于请求配件设备的当前监控拍摄到的数据流。
S111:配件设备根据第二凭据的管理策略,处理来自被授权设备的访问请求。
配件设备在每次认证被授权设备后,其记录的被授权设备的连接次数加1,还可以记录访问总时长,进而在每次响应访问请求之前,可以判断被授权设备的访问请求是否符合第二凭据的管理策略(参见表8),在符合管理策略时,才响应访问请求。具体地,如图6D所示,配件设备可以执行如下步骤中的部分或全部:
S1111:判断与该被授权设备的连接次数是否小于预设阈值N,如果否,执行S1112;如果是,则执行S1113。
S1112:向被授权设备返回用于指示连接超过N次的指示信息。
S1113:判断与该授权设备的连接时长是否小于预设时长T,如果否,则执行S1114,如果是则,执行S1115。
其中,连接时长可以指第二凭据的被授权设备与配件设备的单次连接时长,也可以是指使用该第二凭据的被授权设备与配件设备的总连接时长。
S1114:向被授权设备返回用于指示连接超时的指示信息。
S1115:判断所要访问的业务或数据是否在第二凭据对应的可访问数据和/或业务的范围内,如果否,则执行S1116;如果是,执行S1117。
S1116:向被授权设备返回用于指示无访问权限的指示信息。
S1117:处理来自被授权设备的访问请求。
应理解,上述图6D示例性的示出了管理策略可以包括可连接次数、可连接时长、可访问的数据和/或业务时,配件设备响应业务请求前的判断业务请求是否符合第二凭据的管理策略的实现方式,应理解,上述步骤S1111、S1113和S1115的判断可以不分先后执行。
在一些实施例中,管理策略可以包括可连接次数、可连接时长、可访问的数据和/或业务中的一个或两个,此时,仅需要判断其包括的一个或两个是否符合第二凭据的管理策略,具体参见上述图6D所示的判断方法,这里不再赘述。
应理解,当主控设备访问时,也可以判断主控设备的访问请求是否符合第一凭据的管理策略(参见表8),具体实现原理同上述S1111-S1117,这里不再赘述。
实施例二
如图7所示,为本申请实施例提供的一种设备授权和认证方法的流程示意图。该方法是在图4所示的设备授权方法中,第一凭据和第二凭据均为非对称凭据时,设备授权方法的一个示例。如图7所示,该方法可以包括但不限于如下步骤:
S201:主控设备绑定配件设备,生成第一凭据和第二凭据。其中,第一凭据包括配件设备的公钥PK1和私钥SK1、主控设备的公钥PK2和私钥SK2;第二凭据包括配件设备的公钥PK3和私钥SK3、主控设备的公钥PK4和私钥SK4。
需要指出的是,配件设备存储的第二凭据包括配件设备的公钥PK1和私钥SK1、主控设备的公钥PK2;而主控设备存储的第二凭据包括配件设备的公钥PK1、主控设备的公钥PK2和私钥SK4。
和私钥SK4。
其中,第一凭据和第二凭据的生成方法可以参见上述实施例一中步骤S101的实施方式2中相关描述,这里在不在赘述。
应理解,第一凭据还可以是对称密钥key1,可以参见上述实施例一,这里不再赘述。
S202:主控设备响应于输入的用户操作,设置凭据的管理策略。
S203:主控设备响应于接收到的针对第二凭据的分享操作,根据第二凭据的属性信息判断该第二凭据是否允许被分享。如果是,则执行S204;否则,输出用于提示凭据不可分享的指示信息。
其中,S202和S203的具体实现可以参见上述实施例一中的S102和S103,这里不在赘述。
S204:主控设备向被授权设备发送第二凭据中的配件设备的公钥PK3和主控设备的私钥SK4。
S205:被授权设备接收配件设备的公钥PK3和主控设备的私钥SK4。
此时被授权设备本地存储的第二凭据包含主控设备的私钥SK4和配件设备的公钥PK3。
S206:被授权设备与配件设备建立通信连接。
具体地,连接方式可以包括但不限于蓝牙、WIFI、NFC等近距离通信连接。
S207:被授权设备通过私钥SK4对公钥PK3进行签名,得到数字签名S5。
S208:被授权设备向配件设备发送认证请求,该认证请求包括该数字签名S5。
S209:配件设备基于本地的第二凭据中的公钥PK4验签该数字签名S5。
配件设备在接收到认证请求后,通过公钥PK4对数字签名S5进行解密,得到公钥PK3的摘要值,进一步地,计算本地存储的公钥PK3的摘要值,若计算的摘要值与解密得到的摘要值一致,则认证通过,否则认证失败,。
S210:配件设备向被授权设备发送验签结果。
其中,在认证通过时,验签结果用于指示认证通过;在认证失败时,验签结果用于指示认证失败。
进一步地,还可以包括反向认证的过程,具体包括如下步骤:
S211:配件设备通过私钥SK3对公钥PK4进行签名,得到数字签名S6。
S212:配件设备向被授权设备发送认证请求,该认证请求包括该数字签名S6。
S213:被授权设备基于本地的第二凭据中的公钥PK3验签该数字签名S6。
被授权设备在接收到认证请求后,通过公钥PK3对数字签名S6进行解密,得到公钥PK4的摘要值,进一步地,计算本地存储的公钥PK4的摘要值,若计算的摘要值与解密得到的摘要值一致,则认证通过,否则认证失败。
S214:被授权设备向配件设备发送验签结果。
其中,在认证通过时,验签结果用于指示认证通过;在认证失败时,验签结果用于指示认证失败。
应理解,在步骤S211中,也可以对公钥PK3进行签名。
实施例三
如图8和图9所示的设备授权方法的示意性说明图和流程示意图,该方法可以由上述图2A或图2C所示的系统实现,可以包括授权、认证和数据访问三个阶段。
(一)授权阶段:
S301:绑定主控设备和配件设备,生成第一凭据,该第一凭据包括配件设备的一对公钥PK1和私钥SK1、主控设备的一对公钥PK2和私钥SK2。
主控设备和配件设备通过交换,配件设备得到了公钥PK2,主控设备得到了公钥PK。此时,配件设备存储的第一凭据包括自己的公钥PK1和私钥SK1,以及主控设备的公钥PK2。主控设备存储的第一凭据包括自己的公钥PK2和私钥SK2,以及配件设备的公钥PK1。主控设备可以与被授权设备进行可信通信,具体地,主控设备可以利用公钥PK1对要传输给配件设备的数据进行加密,配件设备通过私钥SK1解密该数据;同理,配件设备可以利用公钥PK2对要传输给主控设备的数据进行加密,主控设备通过私钥SK2解密该数据。
S302:主控设备响应于用户输入的操作,设置凭据的管理策略。
在一些实施例中,凭据可以划分为第一凭据和非第一凭据。主控设备可以设置第一凭据和非第一凭据的管理策略。其中,管理策略可以包括对使用该凭据的设备的可连接次数,可连接时长,可访问的数据和/或业务等的管理。例如设置第一凭据和非第一凭据分布与可连接次数、可连接时长、可访问的数据和/或业务的对应关系。进一步地,还可以将该对应关系发送到配件设备,以实现配件设备基于凭据的管理策略来处理来自不同设备的访问请求。如表9所示,为凭据管理的一个示例:
表9
在一些实施例中,S302还可以由配件设备来执行。S302还可以发生在任何阶段或任何阶段的任何时候。
S303:被授权设备向主控设备发送背书请求,该背书请求包括第三凭据。
其中,背书请求用于请求主控设备为第三凭据背书。第三凭据可以使对称性密钥或非对称性密钥。
在一些实施例中,被授权设备可以生成一对公私钥,即公钥PK5和私钥SK5。此时,被授权设备存储的第三凭据包括公钥PK5和私钥SK5。背书请求携带的第三凭据包括公钥PK5而不包括私钥SK5。
在一些实施例中,被授权设备可以生成一对称密钥,如对称密钥Key3,此时,第三凭据包括对称密钥Key3。
S304:主控设备通过自己的私钥SK2对第三凭据进行签名。
具体地,主控设备计算第三凭据(公钥PK5或对称密钥Key3)的摘要值,进而通过自己的私钥SK2对该摘要值进行加密,得到其数字签名,本申请实施例中也称为签名后的第三凭据。
S305:主控设备向被授权设备发送签名后的第三凭据。
S306:被授权设备接收签名后的第三凭据。
(二)认证阶段:
S307:被授权设备与配件设备建立通信连接。
具体地,连接方式可以包括但不限于蓝牙、WIFI、NFC等近距离通信连接。
S308:被授权设备基于向配件设备发送认证请求,该认证请求包括第三凭据和第三凭据的签名。
当第三凭据为非对称密钥时,该认证请求所携带的是公钥PK5。
S309:配件设备基于本地的公钥PK2对第三凭据的签名进行验签。
具体的,配件设备存储了第一凭据,包括自己的公钥PK1和私钥SK1,以及主控设备的公钥PK2。配件设备可以通过本地的公钥PK2对第三凭据的签名进行解密,得到摘要值,并计算认证请求携带的第三凭据的摘要值,比对解密得到的摘要值与计算得到的摘要值,若一致,则验签成功;否则验签失败。
S310:配件设备向被授权设备发送验签结果。
在验签通过后,配件设备可以存储第三凭据,向被授权设备发送验签成功的指示信息。若验签失败,则向被授权设备发送用于指示验签失败或认证失败的指示信息。
当第三凭据为非对称密钥时,配件设备还向被授权设备发送公钥PK1。
此时,配件设备存储的第三凭据包括:被授权设备的公钥PK5、自己的公钥PK1和私钥SK1。被授权设备存储的第三凭据包括:自己的公钥PK5和私钥SK5,配件设备的公钥PK1。
在第三凭据为非对称密钥时,还包括反向认证过程,具体实现可以参见上述实施例一种反向认证过程的实现方式,这里不再赘述。
应理解,在配件设备与被授权设备下一次连接和认证时,可以通过第三凭据来认证。
(三)访问阶段:
在认证通过后,被授权设备可以访问配件设备中的数据或业务。可选地,被授权设备与配件设备之间可以采用认证阶段约定的加密传输通道进行传输。
例如,在第三凭据为对称密钥Key3时,被授权设备和配件设备可以基于对称密钥Key3进行通信。
又例如,在第三凭据为公钥PK5时,被授权设备可以利用公钥PK1对要传输给配件设备的数据进行加密,配件设备通过私钥SK1解密该数据;同理,配件设备可以利用公钥PK5对要传输给被授权设备的数据进行加密,被授权设备通过私钥SK5解密该数据。
S311:被授权设备向配件设备发送访问请求。
在认证通过后,被授权设备可以访问配件设备中的数据或业务。
在一些应用场景中,配件设备为智能音响,该访问请求携带待播放数据,用于请求配件设备播放待播放数据。
在一些应用场景中,配件设备为智能摄像头,该访问请求携带待播放数据,用于请求配件设备的当前监控拍摄到的数据流。
S312:根据第三凭据的管理策略,处理来自被授权设备的访问请求。
在一些实施例中,配件设备首先判断验签得到的第三凭据是否为第一凭据,如果否,则通过非第一凭据的管理策略来处理该访问请求。此时,第三凭据的管理策略即为非第一凭据的管理策略(参见表9)。
在一些实施例中,在第三凭据验签通过后,配件设备或主控设备可以设置该第三凭据的管理策略,例如,可连接次数、可连接时长、可访问的数据和/或业务中的一个或多个。如表10所示,为第三凭据的管理策略的一个示例:
表10
S312的具体实现原理同上述S111,具体可以参见上述实施例一中S111的具体实现,这里不再赘述。
实施例四
如图10所示的设备授权、认证方法的示意性说明图和流程示意图,该方法可以由上述图2A或图2C所示的系统实现,可以包括授权、认证和数据访问三个阶段。
(一)授权阶段:
S401:绑定主控设备和配件设备,生成第一凭据,第一凭据包括为对称密钥Key1。
S402:主控设备响应于用户输入的操作,设置凭据的管理策略。S402的具体实现可以参见上述实施例三中S302这里不再赘述。
S403:被授权设备向主控设备发送背书请求,该背书请求包括第三凭据。
其中,第三凭据可以使对称性密钥或非对称性密钥。
在一些实施例中,被授权设备可以生成一对公私钥,即公钥PK5和私钥SK5。此时,第三凭据包括公钥PK5。
在一些实施例中,被授权设备可以生成一对称密钥,如对称性密钥Key3,此时,第三凭据包括对称 性密钥Key3。
S404:主控设备通过对称密钥Key1计算第三凭据的消息认证码(MAC)。
例如,主控设备响应于背书请求,计算第三凭据的摘要值,进而通过对称密钥Key1对该摘要值进行加密,得到的密文即为MAC值。
S405:主控设备向被授权设备发送第三凭据的MAC值。
S406:被授权设备接收第三凭据的MAC值。
(二)认证阶段:
S407:被授权设备与配件设备建立通信连接。
具体地,连接方式可以包括但不限于蓝牙、WIFI、NFC等近距离通信连接。
S408:被授权设备向配件设备发送认证请求,该认证请求包括第三凭据和第三凭据的MAC值。
S409:配件设备基于本地的凭据校验第三凭据的MAC值。
具体地,可以执行如下步骤:
S4091:配件设备基于本地的凭据,即对称密钥Key1计算第三凭据的MAC值。
S4092:配件设备将计算得到的MAC值与认证请求携带的MAC值进行比对。若相同,则说明第三凭据被相同的对称密钥加密,配件设备确认被授权设备拥有和自己一样的对称密钥Key1,被授权设备可信,校验通过;若不同,则说明第三凭据被篡改或被授权设备拥有和自己不一样的对称密钥Key1,被授权设备不可信,校验失败,为不可信设备。
S410:配件设备向被授权设备发送校验结果。
在校验通过后,配件设备可以存储第三凭据,向被授权设备发送用于指示校验通过或认证通过的指示信息。若校验失败,则向被授权设备发送用于指示校验失败或认证失败的指示信息。
可选地,还可以设置第三凭据的管理策略,或者,通过非第一凭据的管理策略来处理凭据为第三凭据的设备的访问请求。
在下一次认证时,被授权设备可以通过第三凭据认证配件设备,访问配件设备中的数据或业务。访问过程的具体实现可以参见上述实施例三,这里不再赘述。
需要说明的是,上述实施例三和四中,签名后的第三凭据和第三凭据的MAC值,可以称为第三凭据的验证信息,其均是主控设备基于本地存储的第一凭据对第三凭据进行处理得到的。
下面描述本申请实施例涉及的电子设备。示例性的,图11示出了本申请实施例提供的电子设备100的结构示意图。电子设备100可以是上述主控设备、配件设备或被授权设备等。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再 次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),第五代无线通信系统(5G,the 5th Generation of wireless communication system),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。摄像头193可以包括3D摄像头,能采集被拍摄物体的深度数 据。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感 器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整 数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
在一些实施例中,处理器110用于调用存储器或内部存储器121中的指令,执行上述实施例一至四,任意一个中主控设备所执行的方法。
在一些实施例中,处理器110用于调用存储器或内部存储器121中的指令,执行上述实施例一至四,任意一个中配件设备设备所执行的方法。
在一些实施例中,处理器110用于调用存储器或内部存储器121中的指令,执行上述实施例一至四,任意一个中被授权设备所执行的方法。
本发明实施例中所使用的技术术语仅用于说明特定实施例而并不旨在限定本发明。在本文中,单数形式“一”、“该”及“所述”用于同时包括复数形式,除非上下文中明确另行说明。进一步地,在说明书中所使用的用于“包括”和/或“包含”是指存在所述特征、整体、步骤、操作、元件和/或构件,但是并不排除存在或增加一个或多个其它特征、整体、步骤、操作、元件和/或构件。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (24)

  1. 一种设备授权方法,其特征在于,包括;
    主控设备与配件设备绑定,协商第一凭据和第二凭据;所述第一凭据不可分发,用于所述主控设备的认证;所述第二凭据可分发,用于被授权设备的认证;
    所述主控设备响应于针对所述第二凭据的分享操作,在所述第二凭据的属性为可分发时,向所述被授权设备发送所述第二凭据。
  2. 如权利要求1所述的方法,其特征在于,所述主控设备与配件设备绑定,协商第一凭据和第二凭据,包括:
    所述主控设备与所述配件设备建立通信连接;
    所述主控设备根据带外共享口令生成共享密钥;所述带外共享口令用于绑定所述配件设备;所述配件设备包括所述共享密钥或已根据所述带外共享口令生成所述共享密钥;
    所述主控设备基于所述共享密钥与所述配件设备协商出所述第一凭据;
    所述主控设备基于所述共享密钥与所述配件设备协商出所述第二凭据。
  3. 如权利要求1或2所述的方法,其特征在于,所述配件设备包括第一公钥和所述第一公钥对应的第一私钥,所述主控设备包括第二公钥和所述第二公钥对应的第二私钥,所述主控设备基于所述共享密钥与所述配件设备协商出所述第一凭据,包括:
    所述主控设备基于所述共享密钥与所述配件设备与所述配件设备交换公钥,得到所述第一公钥;
    所述主控设备存储所述第一凭据,所述主控设备存储的所述第一凭据包括:所述第一公钥、所述第二公钥和所述第二私钥;所述配件设备存储的所述第一凭据包括:所述第一公钥、所述第一私钥和所述第二公钥。
  4. 如权利要求1或2所述的方法,其特征在于,所述配件设备包括第三公钥和所述第三公钥对应的第三私钥,所述主控设备包括第四公钥和所述第四公钥对应的第四私钥,所述主控设备基于所述共享密钥与所述配件设备协商出所述第二凭据,包括:
    所述主控设备基于所述共享密钥与所述配件设备与所述配件设备交换公钥,得到所述第三公钥;
    所述主控设备存储所述第二凭据,所述主控设备存储的所述第二凭据包括所述第三公钥、所述第四公钥和所述第四私钥;所述配件设备存储的第二凭据包括所述第三公钥、所述第三私钥和所述第四公钥。
  5. 如权利要求4所述的方法,其特征在于,向所述被授权设备发送的所述第二凭据包括所述第四公钥;或包括所述第四公钥、所述第三公钥和所述第四公钥。
  6. 如权利要求4所述的方法,其特征在于,向所述被授权设备发送的所述第二凭据包括包括所述第三公钥和所述第四公钥,所述方法还包括:
    所述主控设备接收来自所述被授权请求的签名请求,所述签名请求携带所述第五公钥,所述第五公钥为所述被授权设备的公钥;
    所述主控设备通过所述第四私钥对所述第五公钥进行签名,得到数字签名;
    所述主控设备向所述被授权设备发送所述数字签名,所述数字签名用于所述被授权设备向所述配件设备认证。
  7. 如权利要求1-6任一项所述的方法,其特征在于,所述方法还包括:
    所述主控设备响应于输入的用户操作,设置所述第一凭据的管理策略和所述第二凭据的管理策略,所述管理策略包括可连接次数,可连接时长,可访问的数据和/或业务中的至少一种;
    所述主控设备将所述第一凭据的管理策略和所述第二凭据的管理策略发送至所述配件设备。
  8. 一种设备授权方法,其特征在于,包括;
    配件设备与主控设备绑定,协商第一凭据和第二凭据;所述第一凭据不可分发,用于所述主控设备的 认证;所述第二凭据可分发,用于被授权设备的认证;
    所述配件设备接收来自所述被授权设备的第一认证请求,所述第一认证请求包括第一信息和验证信息,所述验证信息是基于主控设备存储的所述第二凭据对所述第一信息处理得到的;
    所述配件设备基于本地的所述第二凭据对所述验证信息进行校验;
    所述配件设备在校验通过时,向所述被授权设备发送用于指示认证通过的指示信息。
  9. 如权利要求8所述的方法,其特征在于,所述主控设备存储的所述第二凭据包括所述第三公钥、所述第四公钥和所述第四私钥;所述配件设备存储的第二凭据包括所述第三公钥、所述第三私钥和所述第四公钥。
  10. 如权利要求9所述的方法,其特征在于,所述第一信息为第一字符串,所述验证信息为第一数字签名,所述第一数字签名是所述第一字符串使用所述第四私钥的签名;所述配件设备基于本地的所述第二凭据对所述验证信息进行校验,包括:
    所述配件设备通过本地的所述第三公钥解密所述第一数字签名,得到摘要值;
    所述配件设备计算所述第一字符串的摘要值;
    在计算得到的摘要值与解密得到的摘要值相同时,则校验通过;
    在计算得到的摘要值与解密得到的摘要值不同时,则校验失败。
  11. 如权利要求10所述的方法,其特征在于,所述方法还包括:所述被授权设备包括第五公钥和所述第五公钥对应的第五私钥,所述第一信息为所述第五公钥,所述验证信息为第三数字签名,所述第三数字签名是所述第五公钥使用所述第三私钥的签名;所述配件设备基于本地的所述第二凭据对所述验证信息进行校验,包括:
    所述配件设备通过本地的所述第三公钥解密所述第三数字签名,得到摘要值;
    所述配件设备计算所述第五公钥的摘要值;
    在计算得到的摘要值与解密得到的摘要值相同时,则校验通过;
    在计算得到的摘要值与解密得到的摘要值不同时,则校验失败。
  12. 如权利要求10或11所述的方法,其特征在于,所述方法还包括:
    所述配件设备使用所述第三私钥对第二字符串进行签名,得到第二数字签名;
    所述配件设备向所述被授权设备发送第二认证请求,所述第二认证请求包括所述第二字符和所述第二数字签名;所述第二数字签名用于所述被授权设备基于本地的第三公钥验签。
  13. 如权利要求8所述的方法,其特征在于,所述第二凭据为对称密钥;所述第一信息为字符串,所述验证信息为所述第一信息的MAC值,所述配件设备基于本地的所述第二凭据对所述验证信息进行校验,包括:
    所述配件设备通过本地存储的第二凭据对验证信息进行解密,得到摘要值;
    所述配件设备计算所述第一信息的摘要值;
    在计算得到的摘要值与解密得到的摘要值相同时,则校验通过;
    在计算得到的摘要值与解密得到的摘要值不同时,则校验失败。
  14. 如权利要求8-13任一项所述的方法,其特征在于,所述方法还包括:
    所述配件设备接收所述第一凭据的管理策略和所述第二凭据的管理策略,所述管理策略包括可连接次数,可连接时长,可访问的数据和/或业务中的至少一种;
    所述配件设备接收访问请求,
    所述配件设备在所述访问请求来源于所述主控设备时,通过所述第一凭据的管理策略响应所述访问请求;
    所述配件设备在所述访问请求来源于所述被授权设备或不是所述主控设备时,通过所述第二凭据的管理策略响应所述访问请求。
  15. 如权利要求14所述的方法,其特征在于,在所述访问请求来源于所述被授权设备时,所述通过所述第二凭据的管理策略响应所述访问请求,包括如下步骤中的至少一个:
    判断与所述被授权设备的连接次数是否小于N,N为正整数;
    判断与所述被授权设备的连接时长是否小于预设时长;
    判断所述访问请求所要访问的业务或数据是否在所述第二凭据对应的可访问数据和/或业务的范围内。
  16. 一种设备授权方法,其特征在于,包括;
    配件设备与主控设备绑定,协商第一凭据,
    所述配件设备接收来自所述被授权设备的认证请求,所述认证请求包括第三凭据和所述验证信息,所述验证信息是所述主控设备基于本地存储的第一凭据对所述第三凭据进行处理得到的;
    所述配件设备通过本地的第一凭据验证所述验证信息;
    所述配件设备在验证通过时,向所述被授权设备发送用于指示认证通过的指示信息。
  17. 如权利要求16所述的方法,其特征在于,所述第一凭据包括所述配件设备的第一公钥、所述第一公钥对应的第一私钥、所述主控设备的第二公钥和所述第二公钥对应的第二私钥;所述第三凭据为所述被授权设备的公钥或对称密钥;所述验证信息为所述第三凭据通过所述主控设备存储的所述第二私钥的签名;所述配件设备通过本地的第一凭据验证所述验证信息,包括:
    所述配件设备通过所述第二公钥对所述第三凭据的签名进行验签,在验签通过时,则验证通过。
  18. 如权利要求16所述的方法,其特征在于,所述第一凭据包括第一对称密钥,所述验证信息为通过所述主控设备存储的所述第一对称密钥计算的所述第三凭据的MAC值;所述配件设备通过本地的第一凭据验证所述验证信息,包括:
    所述配件设备通过本地的所述第一对称密钥计算所述第三凭据的MAC值;
    所述配件设备在计算得到的MAC值与所述认证请求携带的MAC值相同时,确定验证通过。
  19. 如权利要求16-18任一项所述的方法,其特征在于,所述方法还包括:
    所述配件设备接收所述第一凭据的管理策略和非第一凭据的管理策略,所述管理策略包括可连接次数,可连接时长,可访问的数据和/或业务中的至少一种;
    所述配件设备接收访问请求,
    所述配件设备在所述访问请求来源于所述主控设备时,通过所述第一凭据的管理策略响应所述访问请求;
    所述配件设备在所述访问请求来源于所述被授权设备或不是所述主控设备时,通过所述非第一凭据的管理策略响应所述访问请求。
  20. 如权利要求19所述的方法,其特征在于,在所述访问请求来源于所述被授权设备时,所述通过所述非第一凭据的管理策略响应所述访问请求,包括如下步骤中的至少一个:
    判断与所述被授权设备的连接次数是否小于N,N为正整数;
    判断与所述被授权设备的连接时长是否小于预设时长;
    判断所述访问请求所要访问的业务或数据是否在所述第二凭据对应的可访问数据和/或业务的范围内。
  21. 一种设备授权方法,其特征在于,包括:
    被授权设备向主控设备发送背书请求,所述背书请求包括第三凭据;
    所述被授权设备接收来自所述主控设备的验证信息,所述验证信息是所述主控设备基于本地存储的第一凭据对所述第三凭据进行处理得到的;所述第一凭据用于所述主控设备和所述配件设备的可信通信;
    所述被授权设备向配件设备发送认证请求,所述认证请求包括第三凭据和所述验证信息,以使所述配件设备通过本地的所述第一凭据验证所述验证信息。
  22. 如权利要求21所述的方法,其特征在于,
    所述第一凭据包括所述配件设备的第一公钥、所述第一公钥对应的第一私钥、所述主控设备的第二公 钥和所述第二公钥对应的第二私钥;所述第三凭据为所述被授权设备的公钥或对称密钥;所述验证信息为所述第三凭据通过所述主控设备存储的所述第二私钥的签名;
    或,
    所述第一凭据包括第一对称密钥,所述验证信息为通过所述主控设备存储的所述第一对称密钥计算的所述第三凭据的MAC值。
  23. 一种电子设备,其特征在于,包括至少一个处理器和至少一个存储器,所述至少一个处理器耦合所述至少一个存储器,所述至少一个存储器用于存储计算机指令,当所述处理器执行所述计算机指令时,所述电子设备执行如权利要求1-7任一项中所述主控设备执行的方法,或执行如权利要求8-20任一项中所述配件设备执行的方法,或执行如权利要求21-22任一项中所述被授权设备执行的方法。
  24. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序指令,所述计算机程序指令当被处理器执行时使所述处理器执行如如权利要求1-7任一项中所述主控设备执行的方法,或执行如权利要求8-20任一项中所述配件设备执行的方法,或执行如权利要求21-22任一项中所述被授权设备执行的方法。
PCT/CN2023/101051 2022-06-22 2023-06-19 设备授权方法及电子设备、系统 WO2023246695A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210712120.9A CN117318922A (zh) 2022-06-22 2022-06-22 设备授权方法及电子设备、系统
CN202210712120.9 2022-06-22

Publications (1)

Publication Number Publication Date
WO2023246695A1 true WO2023246695A1 (zh) 2023-12-28

Family

ID=89241270

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/101051 WO2023246695A1 (zh) 2022-06-22 2023-06-19 设备授权方法及电子设备、系统

Country Status (2)

Country Link
CN (1) CN117318922A (zh)
WO (1) WO2023246695A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612870A (zh) * 2016-07-11 2018-01-19 香港理工大学深圳研究院 物联网设备的委托授权方法、服务器、终端及物联网设备
US20200169549A1 (en) * 2017-07-05 2020-05-28 Intel Corporation Establishing connections between iot devices using authentication tokens
CN111918263A (zh) * 2020-08-17 2020-11-10 宁波奥克斯电气股份有限公司 蓝牙连接方法、装置及物联网设备
WO2021072685A1 (zh) * 2019-10-16 2021-04-22 Oppo广东移动通信有限公司 设备连接方法、装置、设备及可读存储介质
US20210216306A1 (en) * 2020-01-09 2021-07-15 Myomega Systems Gmbh Secure deployment of software on industrial control systems
US20210226951A1 (en) * 2020-01-22 2021-07-22 Valimail Inc. Automated authentication and authorization in a communication system
US20210409217A1 (en) * 2020-06-27 2021-12-30 Vouch.Io L.L.C. System and method for secure authentication and authorization

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612870A (zh) * 2016-07-11 2018-01-19 香港理工大学深圳研究院 物联网设备的委托授权方法、服务器、终端及物联网设备
US20200169549A1 (en) * 2017-07-05 2020-05-28 Intel Corporation Establishing connections between iot devices using authentication tokens
WO2021072685A1 (zh) * 2019-10-16 2021-04-22 Oppo广东移动通信有限公司 设备连接方法、装置、设备及可读存储介质
US20210216306A1 (en) * 2020-01-09 2021-07-15 Myomega Systems Gmbh Secure deployment of software on industrial control systems
US20210226951A1 (en) * 2020-01-22 2021-07-22 Valimail Inc. Automated authentication and authorization in a communication system
US20210409217A1 (en) * 2020-06-27 2021-12-30 Vouch.Io L.L.C. System and method for secure authentication and authorization
CN111918263A (zh) * 2020-08-17 2020-11-10 宁波奥克斯电气股份有限公司 蓝牙连接方法、装置及物联网设备

Also Published As

Publication number Publication date
CN117318922A (zh) 2023-12-29

Similar Documents

Publication Publication Date Title
EP3820077A1 (en) Login method, token sending method, and device
WO2021052178A1 (zh) 一种Wi-Fi连接方法及设备
CN111373713B (zh) 一种消息传输方法及设备
WO2022143156A1 (zh) 一种加密通话方法、装置、终端及存储介质
CN112995990B (zh) 一种密钥信息的同步方法、系统及设备
WO2021175266A1 (zh) 身份验证方法、装置和电子设备
CN113676879A (zh) 一种分享信息的方法、电子设备和系统
CN114698149A (zh) 一种数据传输方法及设备
WO2021208014A1 (zh) 用于执行加解密处理的装置及方法
EP4138462A1 (en) Information sharing method, electronic devices and system
WO2022267974A1 (zh) 一种投屏方法及相关装置
WO2023246695A1 (zh) 设备授权方法及电子设备、系统
WO2022037405A1 (zh) 信息验证的方法、电子设备及计算机可读存储介质
CN113676440B (zh) 通信过程中的权限协商方法、装置和电子设备
CN114117461A (zh) 一种数据保护方法、电子设备及存储介质
WO2024113865A1 (zh) 视频流的安全传输方法和装置
WO2024037040A1 (zh) 数据处理方法及电子设备
WO2021051964A1 (zh) 配对方法及设备
WO2024037500A1 (zh) 通信方法及相关装置
CN115550919A (zh) 设备配对认证方法、装置、发送方设备及接收方设备
US20230214532A1 (en) Permission negotiation method and apparatus during communication, and electronic device
WO2022042273A1 (zh) 密钥使用方法及相关产品
CN117459241A (zh) 登录方法、电子设备及存储介质
CN115599596A (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: 23826343

Country of ref document: EP

Kind code of ref document: A1