CN109787768A - A kind of authentication configuration method, device and computer readable storage medium - Google Patents
A kind of authentication configuration method, device and computer readable storage medium Download PDFInfo
- Publication number
- CN109787768A CN109787768A CN201811518453.8A CN201811518453A CN109787768A CN 109787768 A CN109787768 A CN 109787768A CN 201811518453 A CN201811518453 A CN 201811518453A CN 109787768 A CN109787768 A CN 109787768A
- Authority
- CN
- China
- Prior art keywords
- rule
- authentication
- template
- authentication configuration
- configuration template
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
Abstract
This programme is related to information security field, and providing a kind of authentication configuration method, device and computer readable storage medium, method includes: to encapsulate the data model of encryption, decryption, signature, sign test rule respectively in template engine;Authentication configuration template is established, interchangeable data are arranged by $ { };It is embedded into JAVA application using authentication configuration template as packet is relied on, it is applied in JAVA and authentication configuration template is called by interface, encryption rule, decryption rule, signature rule, sign test rule is set to replace interchangeable data in $ { }, form authentication rule, or, in authentication configuration template presence server, JAVA, which is applied, passes through HTTP access authentication configuration template, with the interchangeable data of $ { } in the encryption of encapsulation, decryption, signature, sign test rule replacement authentication configuration template, authentication rule is formed.The present invention does not need duplicate code development, reduces workload.
Description
Technical field
The present invention relates to field of information security technology, specifically, being related to a kind of authentication configuration method, device and meter
Calculation machine readable storage medium storing program for executing.
Background technique
The mode for generalling use digital signature now carries out authentication.It is general using mark for some newer systems
The modes such as quasi- Basic Auth, OAuth, HMAC realize authentication.But it for some older operation systems, much all uses
Customized identity authentication scheme.This makes the mutual access between these operation systems become complicated --- and interaction both sides are
It needs to develop according to the identification authentication mode of other side, and the rule authenticated is often related to specific business.Thus while
The code of authentication have very big similarity, but be not again it is identical, ninety-nine times out of a hundred docking require carry out identity
The code development of certification.Thus while the code of authentication have very big similarity, but be not again it is identical, therefore
Docking requires to carry out the code development of authentication ninety-nine times out of a hundred.
Summary of the invention
To solve the shortcomings of the prior art, the present invention provides a kind of authentication configuration method, is applied to electronics and fills
It sets, this method comprises: by encryption rule, the number of decryption rule, signature rule, sign test rule in FreeMarker template engine
It is packaged respectively according to model;Authentication configuration template is established by FreeMarker template engine, generates .ftl file,
In, in the authentication configuration template, interchangeable data are set by plus and become symbol $ { };By the authentication
Configuration template is embedded into JAVA application as packet is relied on, and calls the identity to test by interface when JAVA application is run
Configuration template is demonstrate,proved, the encryption rule encapsulated, decryption rule, signature rule, sign test rule is made to replace replacing in plus and become symbol $ { }
The data changed, so that corresponding authentication rule is formed, alternatively, authentication configuration template storage is on the server,
JAVA, which is applied, accesses the authentication configuration template by HTTP, and FreeMarker template engine dynamic translation authentication is matched
Template is set, with $ { .. } in the encryption rule of encapsulation, decryption rule, signature rule, sign test rule replacement authentication configuration template
Interchangeable data, to form corresponding authentication rule.
Preferably, the step of establishing authentication configuration template using FreeMarker template engine includes: newly-built Maven
Project;.xml configuration file is modified, increases freemark and relies on;Catalogue is added under the packet of src/main/java, for storing
All freemarker templates;Addition is existing for .ftl document form under src/main/java/templates catalogue
FreeMarker template.
Preferably, JAVA application is provided with the choice box of corresponding encryption rule, decryption rule, signature rule, sign test rule.
Preferably, the algorithm that encryption rule, decryption rule use includes at least MD5, RSA, DES, AES, Base64.
Preferably, the algorithm that signature rule, sign test rule use includes at least RSA, DSA and ECDSA.
Preferably, AES has CBC, CFB, ECB, OFB, PCBC5 kind mode, and there are three types of filling modes for AES tool:
NoPadding、PKCS5Padding、ISO10126Padding。
The present invention also provides a kind of electronic device, the electronic device includes memory and the place that connect with the memory
Device is managed, is stored with the authentication configurator that can be run on the processor in the memory, the authentication is matched
It sets when program is executed by the processor and realizes following steps: advising encryption rule, decryption in FreeMarker template engine
Then, signature rule, sign test rule data model be packaged respectively;Authentication is established by FreeMarker template engine
Configuration template generates .ftl file, wherein in the authentication configuration template, interchangeable number is arranged by $ { }
According to;It is embedded into JAVA application using the authentication configuration template as packet is relied on, passes through when JAVA application is run
Interface calls the authentication configuration template, and the encryption rule of encapsulation, decryption rule, signature rule, sign test rule are replaced $
Interchangeable data in { }, so that the corresponding authentication page is generated, alternatively, the authentication configuration template is stored in
On server, the authentication configuration template, FreeMarker template engine dynamic translation identity are accessed using by HTTP
Configuration template is verified, replaces authentication configuration template with the encryption rule of encapsulation, decryption rule, signature rule, sign test rule
The interchangeable data of middle $ { }, to generate the corresponding authentication page.
Preferably, the step of establishing authentication configuration template using FreeMarker template engine includes: newly-built Maven
Project;.xml configuration file is modified, increases freemark and relies on;Templates (mould is added under the packet of src/main/java
Plate) catalogue, for storing all freemarker templates;.ftl is added under src/main/java/templates catalogue
FreeMarker template.
Preferably, the algorithm that encryption rule, decryption rule use includes at least MD5, RSA, DES, AES, Base64;Signature
The algorithm that rule, sign test rule use includes at least RSA, DSA and ECDSA.
The present invention also provides a kind of computer readable storage medium, tested in the computer readable storage medium including identity
Configurator is demonstrate,proved, when the authentication configurator is executed by processor, realizes authentication configuration method as described above
The step of.
Using authentication configuration method, device and computer readable storage medium of the present invention, either client, opening
Platform or service side, can by by various encryption rules, decryption rule, signature rule, sign test rule data model
Package arrangements form in the application, come select docking both sides all to approve encryption rule, decryption rule, signature rule, test
Label rule.Do not need duplicate code development, it is possible to reduce the high problem of the error rate as caused by the exploitation of a large amount of duplicated codes,
The process that can be issued to avoid version, real-time perfoming update.By way of configuring, solves API open platform and accessing newly
Development problem during service provider really realizes online zero exploitation of access.
Detailed description of the invention
By the way that embodiment is described in conjunction with following accompanying drawings, features described above of the invention and technological merit will become
More understands and be readily appreciated that.
Fig. 1 is the flow chart for indicating the authentication configuration method of the embodiment of the present invention;
Fig. 2 is the hardware structure schematic diagram for indicating the electronic device of the embodiment of the present invention;
Fig. 3 is the module structure drafting for indicating the authentication configurator of the embodiment of the present invention;
Fig. 4 is the unit composition figure for indicating the authentication rule package module of the embodiment of the present invention.
Specific embodiment
Authentication configuration method, device and computer-readable storage of the present invention described below with reference to the accompanying drawings
The embodiment of medium.Those skilled in the art will recognize, without departing from the spirit and scope of the present invention the case where
Under, described embodiment can be modified with a variety of different modes or combinations thereof.Therefore, attached drawing and description are in essence
On be it is illustrative, be not intended to limit the scope of the claims.In addition, in the present specification, attached drawing is not in scale
It draws, and identical appended drawing reference indicates identical part.
A kind of authentication configuration method, as shown in Figure 1, comprising the following steps:
Step S10, it is that encryption rule, decryption rule, signature rule, sign test is regular in FreeMarker template engine
Data model is packaged respectively, so as to the content in later period replacement plus and become symbol $ { }, to generate corresponding authentication
The page.
Step S30 establishes authentication configuration template by FreeMarker template engine, generates .ftl file.
FreeMarker is a kind of template engine based on template He the data to be changed, and can be used to generate html web page, electronics postal
Part, configuration file, source code etc. export text.Template and data model are composition portions needed for FreeMarker generates output
Point, wherein in the authentication configuration template, interchangeable data are set by plus and become symbol $ { };
Step S50 is embedded into JAVA application using the authentication configuration template as packet is relied on, answers in the JAVA
The authentication configuration template called by interface when with operation, by the encryption rule of encapsulation, decrypt rule, signature rule,
Sign test rule replaces the interchangeable data in plus and become symbol $ { }, to carry out various forms of authentications.For example, usually
Need authentication may include tripartite: client (service user), open platform (intermediary service platform), service side
(service provider), client call the service of ISP by open platform.In communication process, tripartite requires to solve
Certainly authentication and problem of data safety.Client call open platform, open platform need sign test to decrypt;Open platform calls
Service side, need to endorse encryption;Open platform calls service side, after service side returns the result, sign test is needed to decrypt;Open platform
Service side is called, after service side returns the result, before open platform returns result to client, carries out encryption of endorsing.
Illustrated below with authentication between open platform and service side.It needs to adopt between open platform and service side
With a kind of identification authentication mode, the identification authentication mode includes encryption rule, decryption rule, signature rule, sign test rule.Institute
JAVA is stated using the application that can be on the open platform, JAVA application is formed by establishing .java class.It can be in java class
Selection encryption rule, decryption rule, signature rule, some modules, such as button, tick boxes of sign test rule etc. are set.It is open
The suitable encryption rule of the application selection of the JAVA on open platform, decryption rule, label can then be passed through between platform and service side
Name rule, sign test rule.And upon selection, java application, which is then called using api interface, is embedded in java to rely on packet form
Authentication configuration template in, due to being provided in authentication configuration template about encryption rule, decryption rule, label
The encapsulation of name rule, sign test rule, and interchangeable data are also provided with by $ { }.Java application calls authentication to match
Template is set, so that the encryption rule of selection, decryption rule, signature rule, sign test rule replace the replaceable data in $ { }, from
And form the authentication rule being suitable between open platform and service side.Communication between service side and open platform then uses
The encryption rule that is configured, decryption rule, signature rule, sign test rule complete authentication.
Alternatively, the authentication configuration template can also be and be stored on independent server, JAVA application can lead to
It crosses HTTP and accesses the authentication configuration template, for example, the application on open platform accesses the authentication by HTTP
Configuration template.Selection encryption rule, decryption rule, signature rule, some modules of sign test rule, example can be set in JAVA application
Such as button, tick boxes.The encryption that can be then suitble to by the application selection on open platform between open platform and service side
Rule, decryption rule, signature rule, sign test rule.The authentication configuration template, FreeMarker mould are accessed using HTTP
Plate engine dynamic translation authentication configuration template is replaced with the encryption rule of encapsulation, decryption rule, signature rule, sign test rule
The interchangeable data of { .. } are changed in authentication configuration template, to form the body being suitable between open platform and service side
Part certification rule.
By above authentication configuration method, developer can remove many and diverse a large amount of duplicate code development works from
Make, different authentication rules can be configured, it can be suitable for the authentication between open platform, service side, user.
Illustratively FreeMarker template engine establishes the specific steps of authentication configuration template below:
A Maven project is created first;
.xml configuration file is modified, increases freemark and relies on;
Entitled " templates " catalogue is added under the packet of src/main/java, it is all for storing
Freemarker template;
The FreeMarker template of entitled " product.ftl " is added under src/main/java/templates catalogue,
Wherein,
The content of template can be including following content:
Encryption rule: $ { Encryption rules }
Decryption rule: $ { Decryption rules }
Signature rule: $ { Signature rule }
Sign test rule: $ { Inspection rules }.
Template content can be read using FreeMarker, by the encryption rule of selection, decryption rule, signature rule,
Sign test rule replaces the content in corresponding $ { }, and data are bound and rendered with authentication configuration template by FreeMarker
Corresponding Verify Your Identity page.
Preferably, the algorithm that encryption rule, decryption rule use includes at least MD5 (Message Digest Algorithm 5), RSA
(rivest, shamir, adelman), DES (data encryption standards is a kind of block algorithm encrypted using key), AES (superencipherment mark
It is quasi-), Base64 (a method of indicate binary data based on 64 printable characters).
Preferably, the algorithm that signature rule, sign test rule use includes at least RSA (rivest, shamir, adelman), DSA (drives
Sail safe early warning and navigation system) and ECDSA (elliptic curve digital signature algorithm).
Various signature rules, encryption rule, decryption rule, sign test rule are respectively corresponded into encapsulation.For example, signature rule
Algorithm is SHA256WithRSA, and the algorithm of encryption rule is RES, and mode is CFB, and filling mode is PKCS5Padding.Pass through
Plus and become symbol $ { } is set in FreeMarker, is replaced using regular expression search value interposition symbol $ { }, and by content therein
It is changed to signature rule, encryption rule, decryption rule, the sign test rule of corresponding encapsulation.It can be answered suitable for difference to be formed
With the authentication page of scene.
Wherein, AES has CBC (cipher block chaining mode), CFB (Cipher Feedback mode), ECB (electronic codebook mode mould
Formula), 5 kinds of OFB (output feedback mode), PCBC (stopping code block chaining) modes.AES supports three kinds of fillings: NoPadding,
PKCS5Padding, ISO10126Padding.Different encapsulation can be then formed, for example, the algorithm of signature rule is RSA, is added
The algorithm of close rule is AES, and mode is ECB, and filling mode is ISO10126Padding.
It is the hardware structure schematic diagram of electronic device 1 of the present invention shown in Fig. 2.The electronic device 1 is that one kind can be according to
The instruction for being previously set or storing, the automatic equipment for carrying out numerical value calculating and/or information processing.The electronic device 1 can be with
It is computer, is also possible to single network server, the server group of multiple network servers composition or based on cloud computing
The cloud being made of a large amount of hosts or network server, wherein cloud computing is one kind of distributed computing, by a group loose couplings
Computer set composition a super virtual computer.
In the present embodiment, electronic device 1 may include, but be not limited only to, and can be in communication with each other connection by system bus
Memory 13, processor 14, display 15.It should be pointed out that Fig. 2 illustrates only the electronic device 1 with members, but
Be it should be understood that, it is not required that implement all components shown, the implementation that can be substituted is more or less component.
Wherein, main memory 13 includes the readable storage medium storing program for executing of memory and at least one type.Inside save as electronic device 1
Operation provides caching;Readable storage medium storing program for executing can be for if flash memory, hard disk, multimedia card, card-type memory are (for example, SD or DX storage
Device etc.), random access storage device (RAM), static random-access memory (SRAM), read-only memory (ROM), electric erasable can
Program read-only memory (EEPROM), programmable read only memory (PROM), magnetic storage, disk, CD etc. it is non-volatile
Property storage medium.In some embodiments, readable storage medium storing program for executing can be the internal storage unit of electronic device 1, such as the electricity
The hard disk of sub-device 1;In further embodiments, which is also possible to the external storage of electronic device 1
The plug-in type hard disk being equipped in equipment, such as electronic device 1, intelligent memory card (Smart Media Card), secure digital
(Secure Digital) card, flash card (Flash Card) etc..In the present embodiment, the readable storage medium storing program for executing of memory 13 is usual
Authentication configuration for storing the operating system and types of applications software that are installed on electronic device 1, such as in the present embodiment
Program code etc..In addition, memory 13 can be also used for temporarily storing the Various types of data that has exported or will export.
The processor 14 is for running the program code stored in the memory 13 or processing data.
In addition, electronic device 1 further includes network interface, the network interface may include radio network interface or cable network
Interface, the network interface are commonly used in establishing communication connection between the electronic device 1 and other electronic equipments.
Authentication configurator is stored in memory 13, is stored in the computer in memory 13 including at least one
Readable instruction, at least one computer-readable instruction can be executed by processor, the method to realize each embodiment of the application;With
And the function that at least one computer-readable instruction is realized according to its each section is different, can be divided into different logic moulds
Block.
In one embodiment, following steps are realized when above-mentioned authentication configurator is executed by the processor 14:
Step S10, it is that encryption rule, decryption rule, signature rule, sign test is regular in FreeMarker template engine
Data model is packaged respectively, so as to the content in later period replacement $ { }, to generate the corresponding authentication page.
Step S30 establishes authentication configuration template by FreeMarker template engine, generates .ftl file.
FreeMarker is a kind of template engine based on template He the data to be changed, and can be used to generate html web page, electronics postal
Part, configuration file, source code etc. export text.Template and data model are composition portions needed for FreeMarker generates output
Point, wherein in the authentication configuration template, interchangeable data are set by $ { };
Step S50 is embedded into JAVA application using the authentication configuration template as packet is relied on, answers in the JAVA
The authentication configuration template called by interface when with operation, by the encryption rule of encapsulation, decrypt rule, signature rule,
Sign test rule replaces the interchangeable data in $ { }, to carry out various forms of authentications.
Alternatively, the authentication configuration template can also be and be stored on independent server, application can pass through
HTTP accesses the authentication configuration template, for example, the application on open platform accesses the authentication by HTTP and matches
Set template.Encryption rule, decryption rule, signature rule, some modules of sign test rule are selected using can be set, such as by
Button, tick boxes etc..Between open platform and service side then can by the suitable encryption rule of the application selection on open platform,
Decrypt rule, signature rule, sign test rule.The authentication configuration template is accessed using HTTP, FreeMarker template is drawn
Dynamic translation authentication configuration template is held up, replaces body with the encryption rule of encapsulation, decryption rule, signature rule, sign test rule
The interchangeable data of { } in part verifying configuration template, to form the authentication being suitable between open platform and service side
Rule.
Fig. 3 show the Program modual graph of authentication configurator 50.In the present embodiment, authentication configurator
50 are divided into multiple modules, and multiple module is stored in memory 13, and is executed by processor 14, to complete this hair
It is bright.The so-called module of the present invention is the series of computation machine program instruction section for referring to complete specific function.
The authentication configurator 50 can be divided into: authentication rule package module 501, template establish mould
Block 502, authentication configuration template processing module 503,
Wherein, authentication rule package module 501 is used for encryption rule, decryption in FreeMarker template engine
Rule, signature rule, sign test rule data model be packaged respectively, so as to the content in later period replacement $ { }, thus raw
At the corresponding authentication page.
Wherein, template establishes module 502 and establishes authentication configuration template by FreeMarker template engine, generates
.ftl file.FreeMarker is a kind of template engine based on template He the data to be changed, and can be used to generate HTML net
Page, Email, configuration file, source code etc. export text.Template and data model are that FreeMarker is generated needed for output
Component part, wherein in the authentication configuration template, interchangeable data are set by $ { }.
Wherein, authentication configuration template processing module 503 is embedded in using the authentication configuration template as packet is relied on
Into JAVA application, the authentication configuration template is called by interface when JAVA application is run, by adding for encapsulation
Close rule, decryption rule, signature rule, sign test rule replace the interchangeable data in $ { }, to carry out various forms of bodies
Part verifying.
Illustrated below with authentication between open platform and service side.It needs to adopt between open platform and service side
With a kind of identification authentication mode, the identification authentication mode includes encryption rule, decryption rule, signature rule, sign test rule.Institute
JAVA is stated using the application that can be on the open platform, JAVA application is formed by establishing .java class.It can be in java class
Selection encryption rule, decryption rule, signature rule, some modules, such as button, tick boxes of sign test rule etc. are set.It is open
The suitable encryption rule of the application selection of the JAVA on open platform, decryption rule, label can then be passed through between platform and service side
Name rule, sign test rule.And upon selection, java application, which is then called using api interface, is embedded in java to rely on packet form
Authentication configuration template in, due to being provided in authentication configuration template about encryption rule, decryption rule, label
The encapsulation of name rule, sign test rule, and interchangeable data are also provided with by $ { }.Java application calls authentication to match
Template is set, so that the encryption rule of selection, decryption rule, signature rule, sign test rule replace the replaceable data in $ { }, from
And form the authentication rule being suitable between open platform and service side.Communication between service side and open platform then uses
The encryption rule that is configured, decryption rule, signature rule, sign test rule complete authentication.
Alternatively, the authentication configuration template can also be stored in solely by authentication configuration template processing module 503
On vertical server, using the authentication configuration template can be accessed by HTTP, for example, the application on open platform is logical
It crosses HTTP and accesses the authentication configuration template.Using can be set selection encryption rule, decryption rule, signature rule, test
Sign some modules, such as button, tick boxes etc. of rule.It then can be by open platform between open platform and service side
Using the suitable encryption rule of selection, decryption rule, signature rule, sign test rule.The authentication is accessed using HTTP to match
Set template, FreeMarker template engine dynamic translation authentication configuration template, with the encryption rule of encapsulation, decryption rule,
The interchangeable data of $ { .. }, are suitable for open put down to be formed in signature rule, sign test rule replacement authentication configuration template
Authentication rule between platform and service side.
Preferably, template establishes the tool that module 502 establishes authentication configuration template by FreeMarker template engine
Steps are as follows for body:
A Maven project is created first;
.xml configuration file is modified, increases freemark and relies on;
Entitled " templates " catalogue is added under the packet of src/main/java, it is all for storing
Freemarker template;
The FreeMarker template of entitled " product.ftl " is added under src/main/java/templates catalogue,
Wherein,
The content of template can be including following content:
Encryption rule: $ { Encryption rules }
Decryption rule: $ { Decryption rules }
Signature rule: $ { Signature rule }
Sign test rule: $ { Inspection rules }.
Template content can be read using FreeMarker, data are bound with template and render corresponding identity and are recognized
Demonstrate,prove the page.Specifically, according to different encryption rules, the encapsulation of decryption rule, signature rule, sign test rule, the interior of $ { } is replaced
Hold, to realize different encryption rules, decryption rule, signature rule, sign test rule.
Preferably, as shown in figure 4, authentication rule package module 501 includes signature rule encapsulation unit 5011, encryption
Regular encapsulation unit 5012 decrypts regular encapsulation unit 5013, sign test rule encapsulation unit 5014.The signature rule encapsulation is single
Various signature rules for being packaged by member 5011, and encryption rule encapsulation unit 5012 is for sealing various decryption rules
Dress.Decrypt regular encapsulation unit 5013 for being packaged to various decryption rules, sign test rule encapsulation unit 5014 is used for pair
Various sign test rules are packaged.
Preferably, the algorithm that encryption rule, decryption rule use includes at least MD5, RSA, DES, AES, Base64.
Preferably, the algorithm that signature rule, sign test rule use includes at least RSA, DSA and ECDSA.
Preferably, authentication configuration template processing module 503 uses regular expression search value interposition symbol $ { }, and will
Selected signature rule, encryption rule, decryption rule, sign test rule replace the replaceable content in plus and become symbol $ { }.
Various signature rules, encryption rule, decryption rule, sign test rule are respectively corresponded into encapsulation.For example, signature rule
Algorithm is SHA256WithRSA, and the algorithm of encryption rule is RES, and mode is CFB, and filling mode is PKCS5Padding.Pass through
Plus and become symbol $ { } is set in FreeMarker, is replaced using regular expression search value interposition symbol $ { }, and by content therein
It is changed to signature rule, encryption rule, decryption rule, the sign test rule of corresponding encapsulation.It can be answered suitable for difference to be formed
With the authentication page of scene.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium
It can be hard disk, multimedia card, SD card, flash card, SMC, read-only memory (ROM), Erasable Programmable Read Only Memory EPROM
(EPROM), any one in portable compact disc read-only memory (CD-ROM), USB storage etc. or several timess
Meaning combination.It include authentication configurator etc., the authentication configurator quilt in the computer readable storage medium
Following operation is realized when processor 12 executes:
Step S10, it is that encryption rule, decryption rule, signature rule, sign test is regular in FreeMarker template engine
Data model is packaged respectively, so as to the content in later period replacement $ { }, to generate the corresponding authentication page.
Step S30 establishes authentication configuration template by FreeMarker template engine, generates .ftl file.
FreeMarker is a kind of template engine based on template He the data to be changed, and can be used to generate html web page, electronics postal
Part, configuration file, source code etc. export text.Template and data model are composition portions needed for FreeMarker generates output
Point, wherein in the authentication configuration template, interchangeable data are set by $ { };
Step S50 is embedded into JAVA application using the authentication configuration template as packet is relied on, answers in the JAVA
The authentication configuration template called by interface when with operation, by the encryption rule of encapsulation, decrypt rule, signature rule,
Sign test rule replaces the interchangeable data in $ { }, to carry out various forms of authentications.
Alternatively, the authentication configuration template can also be and be stored on independent server, application can pass through
HTTP accesses the authentication configuration template, for example, the application on open platform accesses the authentication by HTTP and matches
Set template.Encryption rule, decryption rule, signature rule, some modules of sign test rule are selected using can be set, such as by
Button, tick boxes etc..Between open platform and service side then can by the suitable encryption rule of the application selection on open platform,
Decrypt rule, signature rule, sign test rule.The authentication configuration template is accessed using HTTP, FreeMarker template is drawn
Dynamic translation authentication configuration template is held up, replaces body with the encryption rule of encapsulation, decryption rule, signature rule, sign test rule
The interchangeable data of { .. }, recognize to form the identity being suitable between open platform and service side in part verifying configuration template
Card rule.
The specific embodiment of the computer readable storage medium of the present invention and above-mentioned storehouse monitoring method and electronics fill
Set 1 specific embodiment it is roughly the same, details are not described herein.
The above description is only a preferred embodiment of the present invention, is not intended to restrict the invention, for those skilled in the art
For member, the invention may be variously modified and varied.All within the spirits and principles of the present invention, it is made it is any modification,
Equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.
Claims (10)
1. a kind of authentication configuration method is applied to electronic device, which is characterized in that this method comprises:
The data model of encryption rule, decryption rule, signature rule, sign test rule is distinguished in FreeMarker template engine
It is packaged;
Authentication configuration template is established by FreeMarker template engine, generates .ftl file, wherein test in the identity
It demonstrate,proves in configuration template, interchangeable data is set by plus and become symbol $ { };
It is embedded into JAVA application using the authentication configuration template as packet is relied on, passes through when JAVA application is run
Interface calls the authentication configuration template, makes encryption rule, the decryption rule, signature rule, the replacement of sign test rule of encapsulation
Interchangeable data in plus and become symbol $ { }, so that corresponding authentication rule is formed,
Alternatively, the authentication configuration template storage is on the server, JAVA, which is applied, accesses the authentication by HTTP
Configuration template, FreeMarker template engine dynamic translation authentication configuration template are advised with the encryption rule of encapsulation, decryption
Then, signature rule, sign test rule replace the interchangeable data of $ { .. } in authentication configuration template, to be formed corresponding
Authentication rule.
2. authentication configuration method according to claim 1, which is characterized in that
The step of establishing authentication configuration template using FreeMarker template engine include:
Newly-built Maven project;
.xml configuration file is modified, increases freemark and relies on;
Templates catalogue is added under the packet of src/main/java;
Addition is under src/main/java/templates catalogue with FreeMarker template existing for .ftl document form.
3. authentication configuration method according to claim 1, which is characterized in that
JAVA application is provided with the choice box of corresponding encryption rule, decryption rule, signature rule, sign test rule.
4. authentication configuration method according to claim 1, which is characterized in that
The algorithm that encryption rule, decryption rule use includes at least MD5, RSA, DES, AES, Base64.
5. authentication configuration method according to claim 1, which is characterized in that
The algorithm that signature rule, sign test rule use includes at least RSA, DSA and ECDSA.
6. authentication configuration method according to claim 4, which is characterized in that
AES has CBC, CFB, ECB, OFB, PCBC5 kind mode.
7. a kind of electronic device, which is characterized in that the electronic device includes memory and the processing that connect with the memory
Device is stored with the authentication configurator that can be run on the processor, the authentication configuration in the memory
Program realizes following steps when being executed by the processor:
The data model of encryption rule, decryption rule, signature rule, sign test rule is distinguished in FreeMarker template engine
It is packaged;
Authentication configuration template is established by FreeMarker template engine, generates .ftl file, wherein test in the identity
It demonstrate,proves in configuration template, interchangeable data is set by $ { };
It is embedded into JAVA application using the authentication configuration template as packet is relied on, passes through when JAVA application is run
Interface calls the authentication configuration template, and the encryption rule of encapsulation, decryption rule, signature rule, sign test rule are replaced $
Interchangeable data in { }, so that the corresponding authentication page is generated,
Alternatively, the authentication configuration template storage is on the server, configured using the authentication is accessed by HTTP
Template, FreeMarker template engine dynamic translation authentication configuration template, with the encryption rule of encapsulation, decryption rule, label
The interchangeable data of $ { .. }, are tested to generate corresponding identity in name rule, sign test rule replacement authentication configuration template
Demonstrate,prove the page.
8. electronic device according to claim 7, which is characterized in that
The step of establishing authentication configuration template using FreeMarker template engine include:
Newly-built Maven project;
.xml configuration file is modified, increases freemark and relies on;
Catalogue is added under the packet of src/main/java, for storing all freemarker templates;
The FreeMarker template of .ftl is added under src/main/java/templates catalogue.
9. electronic device according to claim 7, which is characterized in that
The algorithm that encryption rule, decryption rule use includes at least MD5, RSA, DES, AES, Base64;Signature rule, sign test rule
The algorithm then used includes at least RSA, DSA and ECDSA.
10. a kind of computer readable storage medium, which is characterized in that include authentication in the computer readable storage medium
Configurator when the authentication configurator is executed by processor, is realized as described in any one of claims 1 to 6
The step of authentication configuration method.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811518453.8A CN109787768B (en) | 2018-12-12 | 2018-12-12 | Identity authentication configuration method and device and computer readable storage medium |
PCT/CN2019/089183 WO2020119037A1 (en) | 2018-12-12 | 2019-05-30 | Identity authentication configuration method and device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811518453.8A CN109787768B (en) | 2018-12-12 | 2018-12-12 | Identity authentication configuration method and device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109787768A true CN109787768A (en) | 2019-05-21 |
CN109787768B CN109787768B (en) | 2021-08-03 |
Family
ID=66495850
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811518453.8A Active CN109787768B (en) | 2018-12-12 | 2018-12-12 | Identity authentication configuration method and device and computer readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109787768B (en) |
WO (1) | WO2020119037A1 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110336819A (en) * | 2019-07-09 | 2019-10-15 | 四川新网银行股份有限公司 | The self-service combined method of encryption and decryption based on machine learning |
CN110611674A (en) * | 2019-09-20 | 2019-12-24 | 北京三快在线科技有限公司 | Protocol interaction method, system and storage medium between different computer systems |
CN111190587A (en) * | 2019-12-26 | 2020-05-22 | 曙光信息产业(北京)有限公司 | Method and system for automatically generating engineering front-end code based on JDBC |
WO2020119037A1 (en) * | 2018-12-12 | 2020-06-18 | 平安科技(深圳)有限公司 | Identity authentication configuration method and device and computer readable storage medium |
CN111917783A (en) * | 2020-08-06 | 2020-11-10 | 吉林亿联银行股份有限公司 | Method, device and storage medium for verifying general message |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050144586A1 (en) * | 2003-12-24 | 2005-06-30 | Institute For Information Industry | Automated generation method of hardware/software interface for SIP development |
KR20090049384A (en) * | 2007-11-13 | 2009-05-18 | 에스케이 텔레콤주식회사 | System and method for building dynamic blog, and server applied to the same |
CN102629204A (en) * | 2012-03-09 | 2012-08-08 | 中国联合网络通信集团有限公司 | Generating method and device for webpage source code |
CN104537012A (en) * | 2014-12-17 | 2015-04-22 | 广州酷狗计算机科技有限公司 | Data processing method and device |
CN106447277A (en) * | 2015-08-10 | 2017-02-22 | 威海兴达信息科技有限公司 | Office automation management system |
CN106598620A (en) * | 2016-12-21 | 2017-04-26 | 深圳南北互联网金融服务有限公司 | Code generation method and code generator |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9274755B2 (en) * | 2012-09-05 | 2016-03-01 | Red Hat Israel, Ltd. | Infrastructure for generating code using annotation and template generators |
CN106453517A (en) * | 2016-09-20 | 2017-02-22 | 郑州云海信息技术有限公司 | Configuration file generation method based on freemarker |
CN109787768B (en) * | 2018-12-12 | 2021-08-03 | 平安科技(深圳)有限公司 | Identity authentication configuration method and device and computer readable storage medium |
-
2018
- 2018-12-12 CN CN201811518453.8A patent/CN109787768B/en active Active
-
2019
- 2019-05-30 WO PCT/CN2019/089183 patent/WO2020119037A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050144586A1 (en) * | 2003-12-24 | 2005-06-30 | Institute For Information Industry | Automated generation method of hardware/software interface for SIP development |
KR20090049384A (en) * | 2007-11-13 | 2009-05-18 | 에스케이 텔레콤주식회사 | System and method for building dynamic blog, and server applied to the same |
CN102629204A (en) * | 2012-03-09 | 2012-08-08 | 中国联合网络通信集团有限公司 | Generating method and device for webpage source code |
CN104537012A (en) * | 2014-12-17 | 2015-04-22 | 广州酷狗计算机科技有限公司 | Data processing method and device |
CN106447277A (en) * | 2015-08-10 | 2017-02-22 | 威海兴达信息科技有限公司 | Office automation management system |
CN106598620A (en) * | 2016-12-21 | 2017-04-26 | 深圳南北互联网金融服务有限公司 | Code generation method and code generator |
Non-Patent Citations (2)
Title |
---|
林钰杰 等: "基于FreeMarker的企业Web应用代码生成器研究", 《信息技术》 * |
谢满 等: "基于FreeMarker自定义访问控制的设计与实现", 《东莞理工学院学报》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020119037A1 (en) * | 2018-12-12 | 2020-06-18 | 平安科技(深圳)有限公司 | Identity authentication configuration method and device and computer readable storage medium |
CN110336819A (en) * | 2019-07-09 | 2019-10-15 | 四川新网银行股份有限公司 | The self-service combined method of encryption and decryption based on machine learning |
CN110611674A (en) * | 2019-09-20 | 2019-12-24 | 北京三快在线科技有限公司 | Protocol interaction method, system and storage medium between different computer systems |
CN111190587A (en) * | 2019-12-26 | 2020-05-22 | 曙光信息产业(北京)有限公司 | Method and system for automatically generating engineering front-end code based on JDBC |
CN111917783A (en) * | 2020-08-06 | 2020-11-10 | 吉林亿联银行股份有限公司 | Method, device and storage medium for verifying general message |
Also Published As
Publication number | Publication date |
---|---|
CN109787768B (en) | 2021-08-03 |
WO2020119037A1 (en) | 2020-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109787768A (en) | A kind of authentication configuration method, device and computer readable storage medium | |
CN108197891B (en) | Electronic signing device and method based on block chain | |
US9530011B2 (en) | Method and system for provision of cryptographic services | |
CN102171652A (en) | Method for provisioning trusted software to an electronic device | |
US9973480B2 (en) | Multi-level security enforcement utilizing data typing | |
CN109992987B (en) | Script file protection method and device based on Nginx and terminal equipment | |
CN111131278A (en) | Data processing method and device, computer storage medium and electronic equipment | |
US9178703B2 (en) | Method of protecting a control vector in an optional block of a standard key block | |
CN113055380B (en) | Message processing method and device, electronic equipment and medium | |
CN108768963A (en) | The communication means and system of trusted application and safety element | |
CA3029661A1 (en) | Standardisation method and apparatus for erroneous transactions | |
CN109086578A (en) | A kind of method that soft ware authorization uses, equipment and storage medium | |
CN107196907A (en) | A kind of guard method of Android SO files and device | |
CN106682521B (en) | File transparent encryption and decryption system and method based on driver layer | |
CN108416224B (en) | A kind of data encryption/decryption method and device | |
CN107423583B (en) | A kind of software protecting device remapping method and device | |
CN112270001A (en) | Key management method, device, server, medium and system | |
CN111614658A (en) | Calculation force contract generation method based on block chain network, electronic device and medium | |
KR102272928B1 (en) | Operating method for machine learning model using encrypted data and apparatus based on machine learning model | |
CN112783847B (en) | Data sharing method and device | |
CN111628863B (en) | Data signature method and device, electronic equipment and storage medium | |
CN111343170B (en) | Electronic signing method and system | |
CN112817615B (en) | File processing method, device, system and storage medium | |
WO2023283460A1 (en) | Secure device programming system with hardware security module and security interop layer | |
US20130058487A1 (en) | Method of building optional blocks |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |