CN106778322A - A kind of data managing method and terminal based on Keychain - Google Patents

A kind of data managing method and terminal based on Keychain Download PDF

Info

Publication number
CN106778322A
CN106778322A CN201611036587.7A CN201611036587A CN106778322A CN 106778322 A CN106778322 A CN 106778322A CN 201611036587 A CN201611036587 A CN 201611036587A CN 106778322 A CN106778322 A CN 106778322A
Authority
CN
China
Prior art keywords
key
value
data
keychain
dictionary
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611036587.7A
Other languages
Chinese (zh)
Inventor
张良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201611036587.7A priority Critical patent/CN106778322A/en
Priority to PCT/CN2017/076517 priority patent/WO2018090508A1/en
Publication of CN106778322A publication Critical patent/CN106778322A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • G06F21/6263Protecting personal data, e.g. for financial or medical purposes during internet communication, e.g. revealing personal data from cookies

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Medical Informatics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a kind of data managing method based on Keychain and terminal.Methods described includes:Build dictionary, a kind of attribute information of each dictionary correspondence some key-value pair Key Value, each Key Value correspondence user;The user profile of user input is received, the user profile includes at least one attribute information;The user profile is generated into corresponding character string;Corresponding character string is encoded;Corresponding character string is set to the Key Value in dictionary according to the attribute information;The dictionary that will be built is write in the Keychain;If receiving the instruction that user accesses Key Value, the Key Value are decoded.The embodiment of the present invention is improved to traditional Keychain, facilitates the storage and reading of user profile.

Description

A kind of data managing method and terminal based on Keychain
Technical field
The present invention relates to field of computer technology, more particularly to a kind of data managing method and end based on Keychain End.
Background technology
Most application APP in the market have recorded user profile, and user profile is retained in end by needs On end, it is used to realize exempt to log in certain period of time, and can rapidly show the function of user profile.Wherein, such as gold Melt industry field, user profile is extreme security sensitive, and irregular Developmental Engineer uses unsafe mode in order to avoid level Preserve user profile, and reduce most of Developmental Engineer's repeated workload purpose, it is necessary to a kind of safe ready method with Storage and reading user profile.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of data managing method and terminal based on Keychain, the present invention Embodiment is improved to traditional Keychain, facilitates the storage and reading of user profile.
A kind of data managing method based on Keychain, the method includes:
Build dictionary, one kind of each dictionary correspondence some key-value pair Key-Value, each Key-Value correspondence user Attribute information;
The user profile of user input is received, the user profile includes at least one attribute information;
The user profile is generated into corresponding character string;
Corresponding character string is set to the Key-Value in dictionary according to the attribute information;
The Key-Value is encoded;
The dictionary that will be built is write in the Keychain;
If receiving the instruction that user accesses Key-Value, the Key-Value is decoded.
Specifically, described encode to the Key-Value, specifically include:
Call coding function and obtain encoder;
The Key-Value is encoded using the encoder.
Specifically, described decode to the Key-Value, specifically include:
Call decoding functions and obtain decoder;
The Key-Value is decoded using the decoder.
Specifically, methods described also includes:
If during using enabling again, all user profile are read from Keychain.
Specifically, in the Keychain by the dictionary for building write-in, specifically including:
Data-interface is closed and generated to the Keychain, and the data-interface includes data storage interface, reads Take data-interface and delete data-interface;
According to the data-interface, the dictionary that will be built is write in the Keychain.
A kind of terminal, the terminal includes:
Construction unit, for building dictionary, each dictionary corresponds to some key-value pair Key-Value, each Key-Value couples Using a kind of attribute information at family;
Receiving unit, the user profile for receiving user input, the user profile includes at least one attribute information;
Generation unit, for the user profile to be generated into corresponding character string;
Setting unit, for the Key-Value being set to corresponding character string according to the attribute information in dictionary;
Coding unit, for being encoded to the Key-Value;
Writing unit, the dictionary for that will build is write in the Keychain;
Decoding unit, if accessing the instruction of Key-Value for receiving user, decodes to the Key-Value.
Specifically, the coding unit, specifically includes:
First call unit, for calling coding function and obtaining encoder;
Coded sub-units, for being encoded to the Key-Value using the encoder.
Specifically, the decoding unit, specifically includes:
Second call unit, for calling decoding functions and obtaining decoder;
Decoding subunit, for being decoded to the Key-Value using the decoder.
Specifically, the terminal also includes:
Reading unit, if during for using being again started up, all user profile are read from Keychain.
Specifically, said write unit, specifically includes:
Encapsulation unit, for being packaged to the Keychain and generates data-interface, and the data-interface includes depositing Storage data-interface, reading data-interface and deletion data-interface;
Write-in subelement, for according to the data-interface, the dictionary that will be built to be write in the Keychain.
Therefore, the embodiment of the present invention is stored by building dictionary using corresponding key-value pair Key-Value in dictionary User profile, and the dictionary write-in Keychain of the user profile that is stored with is facilitated the storage of user profile, and in user Before information is set to the Key-Value in the dictionary, user profile is encoded so that user profile is supported NSCoding agreements;In the user profile in reading Keychain, the user profile to reading is decoded and is converted into phase Corresponding data type, the convenient use to the user profile.
Brief description of the drawings
Technical scheme in order to illustrate more clearly the embodiments of the present invention, embodiment will be described below needed for be used Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the present invention, general for this area For logical technical staff, on the premise of not paying creative work, other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of schematic flow diagram of data managing method based on Keychain that the embodiment of the present invention one is provided.
Fig. 2 is a kind of another exemplary flow of data managing method based on Keychain that the embodiment of the present invention one is provided Figure.
Fig. 3 is a kind of another exemplary flow of data managing method based on Keychain that the embodiment of the present invention one is provided Figure.
Fig. 4 is a kind of another exemplary flow of data managing method based on Keychain that the embodiment of the present invention one is provided Figure.
Fig. 5 is a kind of schematic flow diagram of data managing method based on Keychain that the embodiment of the present invention two is provided.
Fig. 6 is a kind of schematic block diagram of terminal provided in an embodiment of the present invention.
Fig. 7 is a kind of another schematic block diagram of terminal provided in an embodiment of the present invention.
Fig. 8 is a kind of another schematic block diagram of terminal provided in an embodiment of the present invention.
Fig. 9 is a kind of another schematic block diagram of terminal provided in an embodiment of the present invention.
Figure 10 is a kind of another schematic block diagram of terminal provided in an embodiment of the present invention.
Figure 11 is a kind of structure composition schematic diagram of another embodiment of terminal provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is a part of embodiment of the invention, rather than whole embodiments.Based on this hair Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained under the premise of creative work is not made Example, belongs to the scope of protection of the invention.
It should be appreciated that when using in this specification and in the appended claims, term " including " and "comprising" instruction The presence of described feature, entirety, step, operation, element and/or component, but it is not precluded from one or more of the other feature, whole The presence or addition of body, step, operation, element, component and/or its set.
It is also understood that the term used in this description of the invention is merely for the sake of the mesh for describing specific embodiment And be not intended to limit the present invention.As used in description of the invention and appended claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singulative, " one " and " being somebody's turn to do " is intended to include plural form.
As shown in figure 1, a kind of flow of the data managing method based on Keychain for the offer of the embodiment of the present invention one Schematic diagram.The method comprising the steps of S101~S107.
S101, builds dictionary, each dictionary correspondence some key-value pair Key-Value, each Key-Value correspondence user's A kind of attribute information.In embodiments of the present invention, Keychain (i.e. key chain) is to operate in a kind of storage work in IOS systems Tool, and can provide safety coefficient data storage higher for the application in system, it is ensured that the security of data;Keychain can By the storage mode of key-value pair Key-Value, necessary data to be preserved, and ensure that the data will not be general File in be found or expose, will not also be read by other applications in system.For example, when user is first in the application When registration is logged in, using the user data by building dictionary NSDictionary storage user inputs, if each dictionary correspondence Dry key-value pair Key-Value, wherein using the account of user as Key, being stored user model as Value.
The attribute information refers to the mapping relations of Key and Value in key-value pair Key-Value, in storage one every time It is that storage is indexed according to Key during individual data;It is corresponding in the user data of user input, such as user data Be user account number and user model, then each user account number corresponds to a kind of user model, using user account number as Key and Stored user model as Value, it is corresponding by calling Key just can inquire about when user data is inquired about Value。
S102, receives the user profile of user input, and the user profile includes at least one attribute information.
S103, corresponding character string is generated by the user profile.In embodiments of the present invention, the number of users of user input In key-value pair Key-Value can not being directly inputted according to (such as including user account number, user model), Key-Value storages Data type is character string type, it is necessary to the user data of user input is converted into the corresponding character string types of Key-Value.
S104, corresponding character string is set to the Key-Value in dictionary according to the attribute information.Of the invention real Apply in example, after User logs in application success, create singleton operation class PHKeychainManager by the number of users of user input According to the Key-Value being set in dictionary, such as, using user account number as Key, the user model corresponding with user account number is made It is Value, by the user account number of user input and user model input key-value pair Key-Value.It should be noted that being created Singleton operation class PHKeychainManager be used for being managed collectively the input and reading of user data, singleton operation class The establishment process of PHKeychainManager is created for standardization, for example, a global change can be stated in class realizes file Amount _ instance, it is stipulated that such unified access function be+sharedManager, and judge in this function global variable _ Whether instance is initialized, if so, then returning to the variable in itself, otherwise uses function dispatch_once:, with true Guarantor _ instance Exactly-onces are initialized, and cover other methods there may be new object, such as+ allocWithZone:Or-copyWithZone:Deng.
S105, encodes to the Key-Value.In embodiments of the present invention, due under development for storing use Object model where the Key-Value of user data is a solid data class, such as the entity number of self-defined establishment of the invention According to class, and be inherited from NSObject classes, solid data class can have multinomial attribute, comprising user account number, name, the pet name, the age, The specifying informations such as sex, head portrait or URL addresses, but solid data class does not support NSCoding when initially creating Agreement, it is therefore desirable to encoded to solid data class so that user data supports NSCoding agreements, and is the dictionary The step of NSDictionary is stored in Keychain is prepared.
Specifically, as shown in Fig. 2 step S104 includes step S201~S202.
S201, calls coding function and obtains encoder.The coding function is-encodeWithCoder:, call this Can an incoming encoder aCoder during function.
S202, is encoded using the encoder to the Key-Value.To each Key- in solid data class Value is encoded once with encoder, and the attribute of coding is not supported for the Key-Value in solid data class, such as Int classes The attribute of type, by NSString class functions+StringWithFormat:NSString types are converted into, encoder is recycled Attribute after conversion is encoded.
S106, the dictionary that will be built is write in the Keychain.In embodiments of the present invention, by corresponding character string After being set to the Key-Value in dictionary, singleton is called to operate class PHKeychainManager again, by the number of users that is stored with According to dictionary NSDictionary write-in Keychain in.Additionally, in the feasible embodiment of other, the present invention can lead to The active state for monitoring application is crossed, if detecting using when being closed, will be used by singleton operation class PHKeychainManager User data is stored in dictionary NSDictionary, and call operation class PHKeychainWrapper, by operating class The data-interface of PHKeychainWrapper preserves dictionary NSDictionary into Keychain in time.
Specifically, as shown in figure 3, step S106 includes step S301~S302.
S301, is packaged and generates data-interface to the Keychain, and the data-interface connects including data storage Mouth, reading data-interface and deletion data-interface.The embodiment of the present invention operates class by encapsulating a Keychain PHKeychainWrapper facilitates developer to operate the direct Operational Key chain of class PHKeychainManager by singleton;Tool Body, three data-interfaces are packaged and generated to Keychain, facilitate the user to carry out Keychain by data-interface Directly operate, three data-interfaces generated after being packaged to Keychain are respectively, data storage interface+ saveObject:toService:ServiceID, reading data-interface+saveObject:toService:ServiceID with And delete data-interface+deleteKeychainBy:serviceID.
S302, according to the data-interface, the dictionary that will be built is write in the Keychain.The embodiment of the present invention passes through Singleton operation class PHKeychainManager carries out data manipulation to the Keychain, can be encapsulated by Keychain Three data-interfaces for generating afterwards are directly operated, for example, can be by data storage interface+saveObject: toService:ServiceID can pass through in the dictionary NSDictionary write-ins Keychain of the user data that is stored with Read data-interface+saveObject:toService:ServiceID reads Keychain and obtains user data, Ke Yitong Cross deletion data-interface+deleteKeychainBy:The user data that serviceID will be stored in Keychain is deleted, Therefore, by operate the convenient unified management user data of the data-interface of class PHKeychainWrapper and generation storage, The operation such as reading and deletion.
S107, if receiving the instruction that user accesses Key-Value, decodes to the Key-Value.
Specifically, as shown in figure 4, step S107 includes step S401~S402.
S401, calls decoding functions and obtains decoder.Decoding functions are called when user data is read from Keychain, The decoding functions are-initWithCoder:, can an incoming decoder aDecoder when calling the function.
S402, is decoded using the decoder to the Key-Value.To from Keychain read each Key-Value is decoded once with decoder, and user data that will be in each Key-Value is decoded once with decoder, And it is decoded into NSString types, further according to needing to be converted into the corresponding data type of each user data, and it is assigned to corresponding Object.
As seen from the above, the embodiment of the present invention is deposited by building dictionary using corresponding key-value pair Key-Value in dictionary Storage user profile, and the dictionary of the user profile that is stored with write-in Keychain is facilitated the storage of user profile, and with Before family information is set to the Key-Value in the dictionary, user profile is encoded so that user profile is supported NSCoding agreements;In the user profile in reading Keychain, the user profile to reading is decoded and is converted into phase Corresponding data type, the convenient use to the user profile.
In a kind of another embodiment of the data managing method based on Keychain of the present invention, as shown in figure 5, being this The flow diagram that another embodiment is provided is invented, it includes step S501~S508 (wherein step S501~S507 and the present invention Embodiment one is identical, will not be described in detail herein).
S501, builds dictionary, each dictionary correspondence some key-value pair Key-Value, each Key-Value correspondence user's A kind of attribute information.
S502, receives the user profile of user input, and the user profile includes at least one attribute information.
S503, corresponding character string is generated by the user profile.
S504, corresponding character string is set to the Key-Value in dictionary according to the attribute information.
S505, encodes to the Key-Value.
S506, the dictionary that will be built is write in the Keychain.
S507, if receiving the instruction that user accesses Key-Value, decodes to the Key-Value.
S508, if during using enabling again, all user profile are read from Keychain.The embodiment of the present invention is in detection Monitoring is provided with when being again turned on to application, if detecting using when enabling again, class is operated by singleton PHKeychainManager is timely responded to, and call operation class PHKeychainWrapper, by operating class The data-interface of PHKeychainWrapper reads the user data in Keychain.
As seen from the above, the embodiment of the present invention can prevent the loss of user data by monitoring the state applied.
As shown in fig. 6, a kind of above-mentioned data managing method based on Keychain of correspondence, the present invention also proposes a kind of whole End, the terminal 100 includes:Construction unit 10, receiving unit 20, generation unit 30, coding unit 40, setting unit 50, write-in Unit 60, decoding unit 70.
Wherein construction unit 10, for building dictionary, each dictionary correspondence some key-value pair Key-Value, each Key- A kind of attribute information of Value correspondence users.In embodiments of the present invention, Keychain (i.e. key chain) is to operate in IOS systems A kind of storage instrument on system, and can provide safety coefficient data storage higher for the application in system, it is ensured that the peace of data Quan Xing;Keychain can be preserved necessary data, and ensure by the storage mode of key-value pair Key-Value The data will not be found or expose in general file, will not also be read by other applications in system.For example, working as User registers when logging in the application for the first time, using the number of users by building dictionary NSDictionary storage user inputs According to, each dictionary some key-value pair Key-Value of correspondence, wherein using the account of user as Key, using user model as Value is stored.The attribute information refers to the mapping relations of Key and Value in key-value pair Key-Value, each It is that storage is indexed according to Key during one data of storage;It is corresponding in the user data of user input, for example use User data be user account number and user model, then each user account number correspond to a kind of user model, using user account number as Key and stored user model as Value, it is corresponding by calling Key just can inquire about when user data is inquired about Value.
Receiving unit 20, the user profile for receiving user input, the user profile includes at least one attribute letter Breath.
Generation unit 30, for the user profile to be generated into corresponding character string.In embodiments of the present invention, user is defeated The user data (such as including user account number, user model) for entering can not be directly inputted in key-value pair Key-Value, Key- The data type of Value storages is character string type, it is necessary to that the user data of user input is converted into Key-Value is corresponding Character string type.
Setting unit 40, for the Key-Value being set to corresponding character string according to the attribute information in dictionary. In embodiments of the present invention, after User logs in application success, singleton operation class PHKeychainManager is created user is defeated The user data for entering is set to the Key-Value in dictionary, such as corresponding with user account number using user account number as Key The user account number of user input and user model are input into key-value pair Key-Value by user model as Value.Need explanation , the singleton operation class PHKeychainManager for being created is for being managed collectively the input and reading of user data, singleton The establishment process of operation class PHKeychainManager is created for standardization, for example, one can be stated in class realizes file Global variable _ instance, it is stipulated that such unified access function is+sharedManager, and judge in this function global Whether variable _ instance is initialized, if so, then returning to the variable in itself, otherwise uses function dispatch_once:, To ensure _ instance Exactly-onces initialization, and other methods there may be new object are covered, such as+ allocWithZone:Or-copyWithZone:Deng.
Coding unit 50, for being encoded to the Key-Value.In embodiments of the present invention, due under development A solid data class for the object model where the Key-Value for storing user data, such as self-defined wound of the invention The solid data class built, and be inherited from NSObject classes, solid data class can have multinomial attribute, comprising user account number, name, The specifying informations such as the pet name, age, sex, head portrait or URL addresses, but solid data class is not propped up when initially creating Hold NSCoding agreements, it is therefore desirable to which solid data class is encoded so that user data supports NSCoding agreements, and The step of being stored in Keychain for the dictionary NSDictionary is prepared.
Writing unit 60, the dictionary for that will build is write in the Keychain.In embodiments of the present invention, by phase After the character string answered is set to the Key-Value in dictionary, call singleton to operate class PHKeychainManager again, will deposit Contain user data dictionary NSDictionary write-in Keychain in.Additionally, in the feasible embodiment of other, this Invention, if detecting using when being closed, class can be operated by singleton by monitoring the active state of application Be stored in user data in dictionary NSDictionary by PHKeychainManager, and call operation class PHKeychainWrapper, by operating the data-interface of class PHKeychainWrapper in time dictionary NSDictionary Preserve into Keychain..
Decoding unit 70, if accessing the instruction of Key-Value for receiving user, solves to the Key-Value Code.
Further, as shown in fig. 7, the coding unit 50, specifically includes:
First call unit 501, for calling coding function and obtaining encoder.The coding function for- encodeWithCoder:, can an incoming encoder aCoder when calling the function.
Coded sub-units 502, for being encoded to corresponding character string using the encoder.To in solid data class Each Key-Value with encoder encode once, and for the Key-Value in solid data class do not support coding category Property, such as attribute of Int types, by NSString class functions+StringWithFormat:NSString types are converted into, then The attribute after conversion is encoded using encoder.
Further, as shown in figure 8, the decoding unit 70, specifically includes:
Second call unit 701, for calling decoding functions and obtaining decoder.User data is read from Keychain When call decoding functions, the decoding functions are-initWithCoder:, can an incoming decoder when calling the function aDecoder。
Decoding subunit 702, for being decoded to the Key-Value using the decoder.To from Keychain Each Key-Value of middle reading is decoded once with decoder, and user data that will be in each Key-Value is decoded Device is decoded once, and is decoded into NSString types, further according to needing to be converted into the corresponding data type of each user data, and It is assigned to corresponding object.
Further, as shown in figure 9, the terminal 100, also includes:
Reading unit 80, if during for using being again started up, all user profile are read from Keychain.It is of the invention real Apply example and be provided with monitoring when detecting and applying and be again turned on, if detecting using when enabling again, class is operated by singleton PHKeychainManager is timely responded to, and call operation class PHKeychainWrapper, by operating class The data-interface of PHKeychainWrapper reads the user data in Keychain.
Further, as shown in Figure 10, said write unit 60, specifically includes:
Encapsulation unit 601, for being packaged to the Keychain and generates data-interface, and the data-interface includes Data storage interface, reading data-interface and deletion data-interface.The embodiment of the present invention is operated by encapsulating a Keychain Class PHKeychainWrapper facilitates developer to operate the direct Operational Key chain of class PHKeychainManager by singleton; Specifically, being packaged to Keychain and generating three data-interfaces, user is facilitated to enter Keychain by data-interface Row is directly operated, and three data-interfaces generated after being packaged to Keychain are respectively, and data storage interface+ saveObject:toService:ServiceID, reading data-interface+saveObject:toService:ServiceID with And delete data-interface+deleteKeychainBy:serviceID.
Write-in subelement 602, for according to the data-interface, the dictionary that will be built to be write in the Keychain.This Inventive embodiments carry out data manipulation by singleton operation class PHKeychainManager to the Keychain, can pass through To Keychain encapsulate after generate three data-interfaces directly operated, for example, can by data storage interface+ saveObject:toService:The dictionary NSDictionary of the user data that is stored with is write Keychain by serviceID In, can be by reading data-interface+saveObject:toService:ServiceID reads Keychain and obtains user Data, can be by deleting data-interface+deleteKeychainBy:The number of users that serviceID will be stored in Keychain According to being deleted, therefore, by operating the convenient unified management user of the data-interface of class PHKeychainWrapper and generation The operations such as storage, reading and the deletion of data.
Figure 11 is the structure composition schematic diagram of another embodiment of terminal of the invention.As shown in figure 11, it may include:It is defeated Enter device 99, output device 88, R-T unit 77, memory 66 and processor 55, wherein:
The input unit 99, the input data for receiving outside access control device.In implementing, the present invention is real Apply the input unit 99 described in example may include keyboard, mouse, light device of electrical input, acoustic input dephonoprojectoscope, touch input unit, Scanner etc..
The output device 88, for the output data of external output access control device.In implementing, the present invention is real Applying the output device 88 described in example may include display, loudspeaker, printer etc..
The R-T unit 77, for sending data to other equipment by communication link or receiving number from other equipment According to.In implementing, the R-T unit 77 of the embodiment of the present invention may include the transceiving devices such as radio-frequency antenna.
The memory 66, for storing the routine data with various functions.Memory 66 is deposited in the embodiment of the present invention The data of storage include the routine data that can be called and run.In implementing, the memory 66 of the embodiment of the present invention can be System memory, such as, and volatile (such as RAM), the combination of non-volatile (such as ROM, flash memory etc.), or both.Tool During body is realized, the memory 66 of the embodiment of the present invention can also be the external memory storage outside system, such as, disk, CD, magnetic Band etc..
The processor 55, for calling the routine data stored in the memory 66, and performs following operation:
Build dictionary, one kind of each dictionary correspondence some key-value pair Key-Value, each Key-Value correspondence user Attribute information;The user profile of user input is received, the user profile includes at least one attribute information;By user letter The corresponding character string of breath generation;Corresponding character string is set to the Key-Value in dictionary according to the attribute information;To institute Key-Value is stated to be encoded;The dictionary that will be built is write in the Keychain;If receiving user accesses Key-Value Instruction, the Key-Value is decoded.
Further, the processor 55 also performs following operation:
Call coding function and obtain encoder;The Key-Value is encoded using the encoder.
Further, the processor 55 also performs following operation:
Call decoding functions and obtain decoder;The Key-Value is decoded using the decoder.
Further, the processor 55 also performs following operation:
If during using enabling again, all user profile are read from Keychain.
Further, the processor 55 also performs following operation:
Data-interface is closed and generated to the Keychain, and the data-interface includes data storage interface, reads Take data-interface and delete data-interface;According to the data-interface, the dictionary that will be built is write in the Keychain.
Unit in all embodiments of the invention can be by universal integrated circuit, such as CPU (Central Processing Unit, central processing unit), or by ASIC (Application Specific Integrated Circuit, application specific integrated circuit) realize.
Step in present invention method can according to actual needs carry out order adjustment, merge and delete.
Unit in embodiment of the present invention terminal can according to actual needs be merged, divides and deleted.
One of ordinary skill in the art will appreciate that all or part of flow in realizing above-described embodiment method, can be The hardware of correlation is instructed to complete by computer program, described program can be stored in a computer read/write memory medium In, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
The above, specific embodiment only of the invention, but protection scope of the present invention is not limited thereto, and it is any Those familiar with the art the invention discloses technical scope in, various equivalent modifications can be readily occurred in or replaced Change, these modifications or replacement should all be included within the scope of the present invention.Therefore, protection scope of the present invention should be with right It is required that protection domain be defined.

Claims (10)

1. a kind of data managing method based on Keychain, it is characterised in that methods described includes:
Build dictionary, an attribute of each dictionary correspondence some key-value pair Key-Value, each Key-Value correspondence user Information;
The user profile of user input is received, the user profile includes at least one attribute information;
The user profile is generated into corresponding character string;
Corresponding character string is set to the Key-Value in dictionary according to the attribute information;
The Key-Value is encoded;
The dictionary that will be built is write in the Keychain;
If receiving the instruction that user accesses Key-Value, the Key-Value is decoded.
2. the method for claim 1, it is characterised in that described to be encoded to the Key-Value, specifically includes:
Call coding function and obtain encoder;
The Key-Value is encoded using the encoder.
3. the method for claim 1, it is characterised in that described to be decoded to the Key-Value, specifically includes:
Call decoding functions and obtain decoder;
The Key-Value is decoded using the decoder.
4. the method for claim 1, it is characterised in that methods described also includes:
If during using enabling again, all user profile are read from Keychain.
5. the method as described in claim 1-4 any one, it is characterised in that described that the dictionary for building write-in is described In Keychain, specifically include:
Data-interface is packaged and generated to the Keychain, and the data-interface includes data storage interface, receive data According to interface and deletion data-interface;
According to the data-interface, the dictionary that will be built is write in the Keychain.
6. a kind of terminal, it is characterised in that the terminal includes:
Construction unit, for building dictionary, some key-value pair Key-Value of each dictionary correspondence, each Key-Value is to application A kind of attribute information at family;
Receiving unit, the user profile for receiving user input, the user profile includes at least one attribute information;
Generation unit, for the user profile to be generated into corresponding character string;
Setting unit, for the Key-Value being set to corresponding character string according to the attribute information in dictionary;
Coding unit, for being encoded to the Key-Value;
Writing unit, the dictionary for that will build is write in the Keychain;
Decoding unit, if accessing the instruction of Key-Value for receiving user, decodes to the Key-Value.
7. terminal as claimed in claim 6, it is characterised in that the coding unit, specifically includes:
First call unit, for calling coding function and obtaining encoder;
Coded sub-units, for being encoded to the Key-Value using the encoder.
8. terminal as claimed in claim 6, it is characterised in that the decoding unit, specifically includes:
Second call unit, for calling decoding functions and obtaining decoder;
Decoding subunit, for being decoded to the Key-Value using the decoder.
9. terminal as claimed in claim 6, it is characterised in that the terminal also includes:
Reading unit, if during for using being again started up, all user profile are read from Keychain.
10. the terminal as described in claim 6-9 any one, it is characterised in that said write unit includes:
Encapsulation unit, for being packaged to the Keychain and generates data-interface, and the data-interface includes storage number According to interface, read data-interface and deletion data-interface;
Write-in subelement, for according to the data-interface, the dictionary that will be built to be write in the Keychain.
CN201611036587.7A 2016-11-15 2016-11-15 A kind of data managing method and terminal based on Keychain Pending CN106778322A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201611036587.7A CN106778322A (en) 2016-11-15 2016-11-15 A kind of data managing method and terminal based on Keychain
PCT/CN2017/076517 WO2018090508A1 (en) 2016-11-15 2017-03-14 Keychain-based data management method, terminal and device, and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611036587.7A CN106778322A (en) 2016-11-15 2016-11-15 A kind of data managing method and terminal based on Keychain

Publications (1)

Publication Number Publication Date
CN106778322A true CN106778322A (en) 2017-05-31

Family

ID=58970358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611036587.7A Pending CN106778322A (en) 2016-11-15 2016-11-15 A kind of data managing method and terminal based on Keychain

Country Status (2)

Country Link
CN (1) CN106778322A (en)
WO (1) WO2018090508A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857389B (en) * 2019-01-14 2022-08-12 平安科技(深圳)有限公司 Model data generation method and device, computer equipment and storage medium
CN112130860B (en) * 2020-09-23 2023-09-05 北京奇艺世纪科技有限公司 JSON object analysis method and device, electronic equipment and storage medium
CN117375859A (en) * 2022-06-29 2024-01-09 中兴通讯股份有限公司 Information transmission method and device, storage medium and electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101616003A (en) * 2008-06-25 2009-12-30 鸿富锦精密工业(深圳)有限公司 Cipher protection system and method
US20150006907A1 (en) * 2010-04-07 2015-01-01 Apple Inc. System and method for content protection based on a combination of a user pin and a device specific identifier

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750495A (en) * 2012-06-07 2012-10-24 北京锐安科技有限公司 System for cracking and restoring iPhone encrypted backup files
CN106066808A (en) * 2016-05-30 2016-11-02 浪潮软件股份有限公司 A kind of ios application build server, cluster and method
CN106096337A (en) * 2016-06-21 2016-11-09 北京医视时代科技发展有限公司 A kind of system and method for digital publishing copyright protection

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101616003A (en) * 2008-06-25 2009-12-30 鸿富锦精密工业(深圳)有限公司 Cipher protection system and method
US20150006907A1 (en) * 2010-04-07 2015-01-01 Apple Inc. System and method for content protection based on a combination of a user pin and a device specific identifier

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
KEITH HARRISON: "Simple iPhone Keychain Access", 《USE YOUR LOAF》 *
张才千等: "《iOS开发从入门到精通》", 31 August 2014, 北京希望电子出版社 *

Also Published As

Publication number Publication date
WO2018090508A1 (en) 2018-05-24

Similar Documents

Publication Publication Date Title
CN102096625B (en) Monitor and track application service condition
WO2017000928A1 (en) Application program-based privacy information storage method and device
WO2020232884A1 (en) Data table migration method, apparatus, computer device and storage medium
US9948676B2 (en) System and method for securing documents prior to transmission
CN110196718B (en) Script confusion method
US10911492B2 (en) System and method for securing documents prior to transmission
CN106778322A (en) A kind of data managing method and terminal based on Keychain
US10176317B2 (en) Method and apparatus for managing super user password on smart mobile terminal
US10320624B1 (en) Access control policy simulation and testing
WO2016058291A1 (en) Method and system for packaging mobile application
US7802089B2 (en) Analyzing interpretable code for harm potential
US20150113506A1 (en) Method and system for adaptive loading of application
US9477538B2 (en) Method and system for the support of application specific policies for conventional operating systems
CN110188308B (en) Client automatic dotting reporting method, storage medium, equipment and system
CN110045952B (en) Code calling method and device
CN105159668B (en) Class load implementation method and device in PaaS system
CN114936189A (en) Application program operation method and device, computer equipment and readable storage medium
CN112911024B (en) Method and system for collecting data of Internet of things, electronic device and storage medium
US20220391510A1 (en) Firmware policy enforcement via a security processor
KR101699046B1 (en) File Security system based on filter driver and method thereof
KR102272635B1 (en) System and method for converting large scale application
CN111858020B (en) User resource limiting method and device and computer storage medium
CN110442636B (en) Data reading and writing method and device and data reading and writing equipment
WO2018040271A1 (en) Thread processor and thread processing method
CN114978649B (en) Information security protection method, device, equipment and medium based on big data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170531