A method for generating object storage service signatures for Flutter applications
By generating object storage service signatures in Flutter applications, the problem of lack of signature tools is solved, and a user-friendly object storage service acquisition experience is achieved, which is suitable for cloud storage development projects.
Patent Information
- Application Number
- CN202211080982.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-09-05
AI Technical Summary
Existing Flutter applications lack a signature tool for object storage services, which causes inconvenience for users when obtaining object storage services and affects user experience.
Provides an object storage service signature generation method suitable for Flutter applications by obtaining the access key identification information, private access key information, HTTP verb information, message summary information, message type information and object storage service request header information input by the user. , perform judgment, time generation, string splicing, UTF-8 encoding and HMAC-SHA1 signature calculation, and finally Base64 encoding to generate an object storage service signature.
Provides object storage service-oriented signature tools for Flutter applications, simplifying the process of users obtaining object storage services and improving user experience. It is especially suitable for cloud storage-related development projects.
Smart Images

Figure CN115459927B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electronic signatures, and in particular relates to an object storage service signature generation method suitable for a Flutter application. Background Art
[0002] An electronic signature refers to data contained or attached in electronic form in a data message that is used to identify the signatory and indicate that the signatory approves the content. In layman's terms, an electronic signature is an electronic signature of an electronic document using cryptographic technology. It is not a digital image of a written signature. It is similar to a handwritten signature or seal, and can also be said to be an electronic seal.
[0003] Object Storage Service is an object-based mass storage service that provides customers with massive, secure, highly reliable and low-cost data storage capabilities. Since the object storage service system and a single bucket have no restrictions on the total data capacity and the number of objects / files, it provides users with ultra-large storage capacity, suitable for storing any type of files, and suitable for ordinary users, websites, enterprises and developers. Specifically, the object storage service is a service for Internet access, providing a Web service interface based on the HTTP / HTTPS protocol (Hyper Text Transfer Protocol / Hypertext Transfer Protocol Secure: Hypertext Transfer Protocol / Hypertext Transfer Security Protocol). Users can access and manage data stored in the object storage service system through the object storage service management console or various object storage service tools on computers connected to the Internet anytime and anywhere. At present, the object storage service infrastructure has been deployed in multiple regions around the world, with high scalability and reliability. Users can specify areas to use the object storage service according to their own needs, thereby obtaining faster access speeds and affordable service prices.
[0004] Flutter is an open source user interface toolkit from Google that helps developers efficiently build beautiful multi-platform applications through a set of code bases, supporting mobile, web, desktop, and embedded platforms. However, in current Flutter applications, there is no signature tool for object storage services, which makes it inconvenient for users to obtain object storage services based on Flutter applications, seriously affecting the user experience of Flutter applications. It is necessary to provide a corresponding solution. Summary of the invention
[0005] The purpose of the present invention is to provide an object storage service signature generation method, device, computer equipment and computer-readable storage medium suitable for Flutter applications, so as to solve the problem that there is no signature tool for object storage service in existing Flutter applications, which makes users have many inconveniences when obtaining object storage service based on Flutter applications, thereby seriously affecting the user experience.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, a method for generating an object storage service signature applicable to a Flutter application is provided, which is executed by a Flutter application client and includes:
[0008] Obtain access key identification information, private access key information, HTTP verb information, message summary information, message type information, object storage service request header information, and object storage service resource specification information input by the user;
[0009] Determine whether the access key identification information and the private access key information are both empty information;
[0010] If it is determined that the access key identification information and the private access key information are not empty information, then determining whether the object storage service resource designation information begins with a character “ / ”;
[0011] If it is determined that the object storage service resource specified information begins with the character " / ", a time string of the specified format of the current time is generated;
[0012] Performing string concatenation processing on the HTTP verb information, the message summary information, the message type information, the time string of the specified format of the current time, the object storage service request header information, and the object storage service resource specified information to obtain a request string;
[0013] Perform UTF-8 encoding on the request string to obtain an encoding result;
[0014] Using the access key identification information and the private access key information in combination, the encoding result is subjected to a calculation process using an HMAC-SHA1 signature algorithm to obtain a calculation result;
[0015] The calculation result is processed by Base64 encoding to obtain the object storage service signature.
[0016] Based on the above invention content, a convenient and feasible new solution for generating a signature for an object storage service is provided, that is, after obtaining the access key identification information, private access key information, HTTP verb information, message summary information, message type information, object storage service request header information and object storage service resource specification information input by the user, the Flutter application client can automatically generate an object storage service signature for the user based on the aforementioned user input information through a judgment step, a time generation step, a string concatenation step, a UTF-8 encoding step, a signature calculation step and a Base64 encoding step performed in sequence. In this way, a signature tool for an object storage service can be provided for the Flutter application, which provides convenience for the user when obtaining the object storage service based on the Flutter application, thereby improving the user experience. The solution is particularly suitable for Flutter-related development projects that need to use the object storage service system for cloud storage, and is convenient for practical application and promotion.
[0017] In one possible design, after determining whether the access key identification information and the private access key information are both empty information, the method further includes:
[0018] If it is determined that the access key identification information and / or the private access key information is empty information, a first error prompt information is output and displayed to remind the user to re-enter the access key identification information and / or the private access key information.
[0019] In one possible design, after determining whether the object storage service resource specification information begins with a character “ / ”, the method further includes:
[0020] If it is determined that the object storage service resource specifying information does not start with the character “ / ”, a second error prompt message is output and displayed to remind the user to re-enter the object storage service resource specifying information.
[0021] In one possible design, after determining that the object storage service resource specification information begins with the character “ / ” and before generating a time string of a specified format of the current time, the method further includes:
[0022] The object storage service request header information is subjected to a merging process for fields with duplicate names to obtain new object storage service request header information for performing a string concatenation process.
[0023] In a possible design, the object storage service request header information is subjected to a merging process for fields with duplicate names to obtain new object storage service request header information for string concatenation, including:
[0024] Sort all key fields in the object storage service request header information in ascending order to obtain a key field sequence;
[0025] Using preset characters to replace each subsequent field in the key field sequence that has the same name as the previous field, to obtain a new field sequence;
[0026] For each key field in the object storage service request header information, a corresponding field in the new field sequence is used to perform replacement processing to obtain new object storage service request header information used for string concatenation processing.
[0027] In one possible design, the message digest information includes an MD5 digest string of the message body calculated according to the RFC 1864 standard.
[0028] In one possible design, the specified format time string of the current time adopts the RFC1123 format time string.
[0029] In a second aspect, an object storage service signature generation device suitable for a Flutter application is provided, which is used to be arranged in a Flutter application client, including an information acquisition module, a first judgment module, a second judgment module, a time generation module, a string concatenation module, a first encoding module, a signature calculation module, and a second encoding module;
[0030] The information acquisition module is used to obtain access key identification information, private access key information, HTTP verb information, message summary information, message type information, object storage service request header information and object storage service resource specification information input by the user;
[0031] The first determination module is communicatively connected to the information acquisition module, and is used to determine whether the access key identification information and the private access key information are both empty information;
[0032] The second judgment module is communicatively connected to the first judgment module, and is used to judge whether the object storage service resource specified information starts with a character “ / ” when it is determined that the access key identification information and the private access key information are not empty information respectively;
[0033] The time generation module is communicatively connected to the second determination module, and is used to generate a time string of a specified format of the current time when it is determined that the object storage service resource specified information begins with the character “ / ”;
[0034] The string concatenation module is respectively connected to the information acquisition module and the time generation module for performing string concatenation processing on the HTTP verb information, the message summary information, the message type information, the time string of the specified format of the current time, the object storage service request header information and the object storage service resource specified information to obtain a request string;
[0035] The first encoding module is communicatively connected to the string concatenation module, and is used to perform UTF-8 encoding on the request string to obtain an encoding result;
[0036] The signature calculation module is respectively connected to the information acquisition module and the first encoding module for performing a calculation process on the encoding result using the HMAC-SHA1 signature algorithm in combination with the access key identification information and the private access key information to obtain a calculation result;
[0037] The second encoding module is communicatively connected to the signature calculation module, and is used to perform Base64 encoding on the calculation result to obtain the object storage service signature.
[0038] In a third aspect, the present invention provides a computer device comprising a memory, a processor and a transceiver which are communicatively connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the object storage service signature generation method as described in the first aspect or any possible design of the first aspect.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium having instructions stored thereon. When the instructions are executed on a computer, the object storage service signature generation method as described in the first aspect or any possible design of the first aspect is executed.
[0040] In a fifth aspect, the present invention provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the object storage service signature generation method as described in the first aspect or any possible design of the first aspect.
[0041] Beneficial effects of the above scheme:
[0042] (1) The present invention creatively provides a convenient and feasible new solution for generating a signature for an object storage service, that is, after obtaining access key identification information, private access key information, HTTP verb information, message summary information, message type information, object storage service request header information, and object storage service resource designation information input by a user, the Flutter application client can automatically generate an object storage service signature for the user based on the aforementioned user input information by sequentially performing a judgment step, a time generation step, a string concatenation step, a UTF-8 encoding step, a signature calculation step, and a Base64 encoding step. In this way, a signature tool for an object storage service can be provided for Flutter applications, which can provide convenience for users when obtaining object storage services based on Flutter applications, thereby improving user experience. The present invention is particularly suitable for Flutter-related development projects that need to use an object storage service system for cloud storage, and is convenient for practical application and promotion. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A flowchart of a method for generating an object storage service signature for a Flutter application provided in an embodiment of the present application.
[0045] Figure 2 A schematic diagram of the structure of an object storage service signature generation device suitable for a Flutter application provided in an embodiment of the present application.
[0046] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
[0048] It should be understood that although the terms first and second, etc. may be used herein to describe various objects, these objects should not be limited by these terms. These terms are only used to distinguish one object from another object. For example, a first object can be referred to as a second object, and similarly, a second object can be referred to as a first object without departing from the scope of the exemplary embodiments of the present invention.
[0049] It should be understood that the term "and / or" that may appear in this document is merely a description of the association relationship between associated objects, indicating that there may be three relationships. For example, A and / or B can indicate three situations: A exists alone, B exists alone, or A and B exist at the same time. For another example, A, B and / or C can indicate the existence of any one of A, B and C or any combination of them. The term " / and" that may appear in this document describes another type of association object relationship, indicating that there may be two relationships. For example, A / and B can indicate two situations: A exists alone or A and B exist at the same time. In addition, the character " / " that may appear in this document generally indicates that the previous and next associated objects are in an "or" relationship.
[0050] Example:
[0051] like Figure 1 As shown, the object storage service signature generation method provided in the first aspect of this embodiment and applicable to Flutter applications can be, but is not limited to, executed by a computer device having certain computing resources and communicating with the Flutter application server, such as a personal computer (PC, a multi-purpose computer with a size, price and performance suitable for personal use; desktops, laptops, small laptops, tablets and ultrabooks are all personal computers), smart phones, personal digital assistants (PDA) or wearable devices and other electronic devices. Figure 1 As shown, the object storage service signature generation method applicable to the Flutter application is executed by the Flutter application client and may include but is not limited to the following steps S1 to S8.
[0052] S1. Obtain the access key identification information, private access key information, HTTP verb information, message summary information, message type information, object storage service request header information, and object storage service resource specification information input by the user.
[0053] In step S1, the Flutter application client refers to an electronic device held by a user and used to run a Flutter application client program, such as a personal computer, a smart phone, a personal digital assistant (PDA) or a wearable device, so the access key identification information, the private access key information, the HTTP verb information, the message summary information, the message type information, the object storage service request header information and the object storage service resource specification information can be obtained through conventional human-computer interaction operation input. Specifically, the access key identification information is used to record the unique identifier associated with the private access key, so that it can be used together with the private access key for subsequent encryption and signing; the private access key information is used to record the user's private access key for subsequent encryption and signing, which can identify the sender (i.e., the Flutter application client) and prevent the sent message (e.g., HTTP request message) from being tampered with; the HTTP verb information is used to record the verb VERB of the HTTP request operation, that is, to record the interface operation method for the representational state transfer REST (Representational State Transfer) interface; the message digest information is used to record the summary content of the HTTP request message body. Specifically, the message digest information includes but is not limited to the MD5 (i.e., MD5 Message-Digest Algorithm) summary string of the message body calculated according to the RFC1864 standard (i.e., an existing standard), that is, the message body 128-bit The string obtained by base64 encoding the MD5 value can be empty; the message type information is used to record the specified message type / content type; the object storage service request header information is used to record the object storage service request header field content located in the header field of the HTTP request message (i.e. the header field with "x-obs-" as the prefix), which generally contains multiple key fields that may have the same name; the object storage service resource specification information is used to record the specified object storage service resource.
[0054] S2. Determine whether the access key identification information and the private access key information are both empty information.
[0055] In step S2, since the access key identifier and the private access key will be used for encrypted signing later, the access key identifier information and the private access key information need not be empty information. In this way, through the above-mentioned information judgment method, it can be estimated whether the signature can be successfully generated: if both are not empty information, the signature may be successfully generated, otherwise the signature cannot be successfully generated.
[0056] S3. If it is determined that the access key identification information and the private access key information are not empty information, determine whether the object storage service resource designation information starts with the character “ / ”.
[0057] In step S3, the aforementioned starting character judgment method can be used to estimate whether a valid signature can be generated: if it starts with the character " / ", it indicates that there is a specified object storage service resource that meets the format requirements, and a valid signature can be generated; otherwise, it indicates that there is no specified object storage service resource that meets the format requirements, and even if a signature is generated, it is invalid and cannot be used in practice. In addition, after determining whether the access key identification information and the private access key information are empty information respectively, the method also includes but is not limited to: if it is determined that the access key identification information and / or the private access key information are empty information, a first error prompt message is output to remind the user to re-enter the access key identification information and / or the private access key information, and then return to execute step S1.
[0058] S4. If it is determined that the object storage service resource designation information begins with the character “ / ”, a time string of the current time in a designated format is generated.
[0059] In step S4, the specific method for generating the specified format time string of the current time is the existing conventional method. In order to facilitate the subsequent string concatenation processing, the specified format time string of the current time preferably adopts the RFC1123 format time string. In addition, after determining whether the object storage service resource specified information begins with the character " / ", the method also includes but is not limited to: if it is determined that the object storage service resource specified information does not begin with the character " / ", a second error prompt message is output to remind the user to re-enter the object storage service resource specified information, and then return to execute step S1.
[0060] In the step S4, considering that there may be repeated and redundant content (such as key fields with duplicate names, etc.) in the object storage service request header information, in order to reduce the computing resources required for subsequent encoding and / or calculations and quickly obtain the signature result, preferably, after determining that the object storage service resource designation information begins with the character " / " and before generating a time string in a specified format for the current time, the method also includes but is not limited to: merging the duplicate name fields of the object storage service request header information to obtain new object storage service request header information for string concatenation. Specifically, merging the duplicate name fields of the object storage service request header information to obtain new object storage service request header information for string concatenation includes but is not limited to the following steps S401 to S403.
[0061] S401. Ascendingly sort all the key fields in the object storage service request header information to obtain a key field sequence.
[0062] In step S401, the specific ascending sorting method can be, but is not limited to, based on the common ASCII code size rule: 0-9 < A-Z < a-z.
[0063] S402. Use a preset character to replace each subsequent field in the key field sequence that has the same name as the previous field, to obtain a new field sequence.
[0064] In step S402, the preset character can be, but is not limited to, the character ",".
[0065] S403. For each key field in the object storage service request header information, use the corresponding field in the new field sequence for replacement processing, to obtain a new object storage service request header information for string concatenation processing.
[0066] S5. Perform string concatenation processing on the HTTP verb information, the message digest information, the message type information, the specified format time string of the current time, the object storage service request header information, and the object storage service resource specified information, to obtain a request string.
[0067] In step S5, during the specific string concatenation process, a specific character can be used as a delimiter to distinguish the characters corresponding to different information. For example, the request string can be expressed as: the string of "HTTP verb information" + "\n" + the string of "message digest information" + "\n" + the string of "message type information" + "\n" + the specified format time string of the current time + "\n" + the string of "object storage service request header information" + "\n" + the object storage service resource specified information, where "\n" is the specific character.
[0068] S6. Perform UTF-8 encoding processing on the request string to obtain an encoding result.
[0069] In step S6, UTF-8 (8-bit, Universal Character Set / Unicode Transformation Format) is a variable-length character encoding for Unicode, which can be used to represent any character in the Unicode standard, and the first byte in its encoding is still compatible with ASCII (American Standard Code for Information Interchange), so that the original software that processes ASCII characters can continue to be used without or with only a small modification, so the UTF-8 encoding process is an existing encoding method.
[0070] S7. Using the access key identification information and the private access key information in combination, the encoding result is calculated using the HMAC-SHA1 signature algorithm to obtain a calculation result.
[0071] In step S7, the HMAC-SHA1 signature algorithm is a commonly used signature algorithm for generating a signature digest for a piece of information, wherein HMAC is a Hash-based Message Authentication Code, and the HMAC operation uses a hash algorithm, takes a key and a message as input, and generates a message digest as output. Therefore, in the process of the calculation process, the access key identification information and the private access key information can be used as key inputs, and the encoding result can be used as message input, and the obtained message digest output is used as the calculation result.
[0072] S8. Perform Base64 encoding on the calculation result to obtain the object storage service signature.
[0073] In step S8, Base64 is a method for representing binary data based on 64 printable characters. In this way, through the aforementioned Base64 encoding process, the object storage service signature for 8-bit byte transmission can be obtained for practical application, for example, when initiating an object storage service request, the Flutter application server can perform signature verification on the Flutter application client.
[0074] Therefore, based on the object storage service signature generation method described in the aforementioned steps S1 to S8 and applicable to Flutter applications, a convenient and feasible new object storage service signature generation scheme is provided, that is, after obtaining the access key identification information, private access key information, HTTP verb information, message summary information, message type information, object storage service request header information and object storage service resource specification information input by the user, the Flutter application client can automatically generate an object storage service signature for the user based on the aforementioned user input information through the judgment step, time generation step, string concatenation step, UTF-8 encoding step, signature calculation step and Base64 encoding step performed in sequence. In this way, a signature tool for object storage services can be provided for Flutter applications, which provides convenience for users when obtaining object storage services based on Flutter applications, thereby improving user experience. It is particularly suitable for Flutter-related development projects that need to use object storage service systems for cloud storage, and is convenient for practical application and promotion.
[0075] like Figure 2 As shown, the second aspect of this embodiment provides a virtual device for implementing the object storage service signature generation method described in the first aspect, which is used to be arranged in a Flutter application client, including an information acquisition module, a first judgment module, a second judgment module, a time generation module, a string concatenation module, a first encoding module, a signature calculation module, and a second encoding module;
[0076] The information acquisition module is used to obtain access key identification information, private access key information, HTTP verb information, message summary information, message type information, object storage service request header information and object storage service resource specification information input by the user;
[0077] The first determination module is communicatively connected to the information acquisition module, and is used to determine whether the access key identification information and the private access key information are both empty information;
[0078] The second judgment module is communicatively connected to the first judgment module, and is used to judge whether the object storage service resource specified information starts with a character “ / ” when it is determined that the access key identification information and the private access key information are not empty information respectively;
[0079] The time generation module is communicatively connected to the second determination module, and is used to generate a time string of a specified format of the current time when it is determined that the object storage service resource specified information begins with the character “ / ”;
[0080] The string concatenation module is respectively connected to the information acquisition module and the time generation module for performing string concatenation processing on the HTTP verb information, the message summary information, the message type information, the time string of the specified format of the current time, the object storage service request header information and the object storage service resource specified information to obtain a request string;
[0081] The first encoding module is communicatively connected to the string concatenation module, and is used to perform UTF-8 encoding on the request string to obtain an encoding result;
[0082] The signature calculation module is respectively connected to the information acquisition module and the first encoding module for performing a calculation process on the encoding result using the HMAC-SHA1 signature algorithm in combination with the access key identification information and the private access key information to obtain a calculation result;
[0083] The second encoding module is communicatively connected to the signature calculation module, and is used to perform Base64 encoding on the calculation result to obtain the object storage service signature.
[0084] The working process, working details, and technical effects of the aforementioned device provided in the second aspect of this embodiment can be found in the object storage service signature generation method described in the first aspect, and will not be described in detail here.
[0085] like Figure 3 As shown, the third aspect of this embodiment provides a computer device for executing the object storage service signature generation method as described in the first aspect, including a memory, a processor and a transceiver that are sequentially connected in communication, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program to execute the object storage service signature generation method as described in the first aspect. For example, the memory may include, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a flash memory, a first-in-first-out memory (FIFO) and / or a first-in-last-out memory (FILO), etc.; the processor may include, but is not limited to, a microprocessor of the STM32F105 series. In addition, the computer device may also include, but is not limited to, a power module, a display screen and other necessary components.
[0086] The working process, working details, and technical effects of the aforementioned computer device provided in the third aspect of this embodiment can be found in the object storage service signature generation method described in the first aspect, and will not be described in detail here.
[0087] In a fourth aspect of this embodiment, a computer-readable storage medium is provided that stores instructions including the object storage service signature generation method as described in the first aspect, that is, the computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the object storage service signature generation method as described in the first aspect is executed. The computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to computer-readable storage media such as floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or memory sticks, and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0088] The working process, working details, and technical effects of the aforementioned computer-readable storage medium provided in the fourth aspect of this embodiment can be referred to the object storage service signature generation method described in the first aspect, and will not be repeated here.
[0089] In a fifth aspect, this embodiment provides a computer program product including instructions, which, when executed on a computer, causes the computer to execute the object storage service signature generation method as described in the first aspect. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0090] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for generating an object storage service signature suitable for a Flutter application, characterized in that: Executed by the Flutter app client, including: Obtain access key identification information, private access key information, HTTP verb information, message summary information, message type information, object storage service request header information, and object storage service resource specification information input by the user; Determine whether the access key identification information and the private access key information are both empty information; If it is determined that the access key identification information and the private access key information are not empty information, then determining whether the object storage service resource designation information begins with a character " / "; If it is determined that the object storage service resource specified information begins with the character " / ", a time string of the specified format of the current time is generated; Performing string concatenation processing on the HTTP verb information, the message summary information, the message type information, the time string of the specified format of the current time, the object storage service request header information, and the object storage service resource specified information to obtain a request string; Perform UTF-8 encoding on the request string to obtain an encoding result; Using the access key identification information and the private access key information in combination, the encoding result is subjected to a calculation process using an HMAC-SHA1 signature algorithm to obtain a calculation result; The calculation result is processed by Base64 encoding to obtain the object storage service signature.
2. The object storage service signature generation method according to claim 1, characterized in that: After determining whether the access key identification information and the private access key information are both empty information, the method further includes: If it is determined that the access key identification information and / or the private access key information is empty information, a first error prompt information is output and displayed to remind the user to re-enter the access key identification information and / or the private access key information.
3. The object storage service signature generation method according to claim 1, characterized in that: After determining whether the object storage service resource specification information begins with a character " / ", the method further includes: If it is determined that the object storage service resource specifying information does not start with the character " / ", a second error prompt message is output and displayed to remind the user to re-enter the object storage service resource specifying information.
4. The object storage service signature generation method according to claim 1, characterized in that: After determining that the object storage service resource designation information begins with the character " / " and before generating a time string of a specified format of the current time, the method further includes: The object storage service request header information is subjected to a merging process for fields with duplicate names to obtain new object storage service request header information for performing a string concatenation process.
5. The object storage service signature generation method according to claim 4, characterized in that: The object storage service request header information is subjected to a merging process for fields with duplicate names to obtain new object storage service request header information for string concatenation, including: Sort all key fields in the object storage service request header information in ascending order to obtain a key field sequence; Using preset characters to replace each subsequent field in the key field sequence that has the same name as the previous field, to obtain a new field sequence; For each key field in the object storage service request header information, a corresponding field in the new field sequence is used to perform replacement processing to obtain new object storage service request header information used for string concatenation processing.
6. The object storage service signature generation method according to claim 1, characterized in that: The message digest information includes an MD5 digest string of the message body calculated according to the RFC 1864 standard.
7. The object storage service signature generation method according to claim 1, characterized in that: The specified format time string of the current time adopts the RFC1123 format time string.
8. An object storage service signature generation device suitable for Flutter applications, characterized in that: Used to be arranged in the Flutter application client, including an information acquisition module, a first judgment module, a second judgment module, a time generation module, a string splicing module, a first encoding module, a signature calculation module and a second encoding module; The information acquisition module is used to obtain access key identification information, private access key information, HTTP verb information, message summary information, message type information, object storage service request header information and object storage service resource specification information input by the user; The first determination module is communicatively connected to the information acquisition module, and is used to determine whether the access key identification information and the private access key information are both empty information; The second judgment module is communicatively connected to the first judgment module, and is used to judge whether the object storage service resource specified information starts with a character " / " when it is determined that the access key identification information and the private access key information are not empty information respectively; The time generation module is communicatively connected to the second determination module, and is used to generate a time string of a specified format of the current time when it is determined that the object storage service resource specified information begins with the character " / "; The string concatenation module is respectively connected to the information acquisition module and the time generation module for performing string concatenation processing on the HTTP verb information, the message summary information, the message type information, the time string of the specified format of the current time, the object storage service request header information and the object storage service resource specified information to obtain a request string; The first encoding module is communicatively connected to the string concatenation module, and is used to perform UTF-8 encoding on the request string to obtain an encoding result; The signature calculation module is respectively connected to the information acquisition module and the first encoding module for performing a calculation process on the encoding result using the HMAC-SHA1 signature algorithm in combination with the access key identification information and the private access key information to obtain a calculation result; The second encoding module is communicatively connected to the signature calculation module, and is used to perform Base64 encoding on the calculation result to obtain the object storage service signature.
9. A computer device, characterized in that: The method comprises a memory, a processor and a transceiver which are communicatively connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the object storage service signature generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on the computer, the object storage service signature generation method as described in any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Authentication method and device, computer equipment and storage medium
CN111949974A
Updating method and device of Flutter application, equipment and storage medium
CN114529066A
Securely processing client credentials used for Web-based access to resources
US20040098609A1
Visual, tactile and motion-sensation system for representing music for an audience
US20120216666A1
