Commit 60131df6 authored by gao's avatar gao

法人身份认证服务

parent c4b9e2e8
<component name="ArtifactManager">
<artifact name="LegalPersonChapter:jar">
<output-path>$PROJECT_DIR$/out/artifacts/LegalPersonChapter_jar</output-path>
<root id="root">
<element id="archive" name="LegalPersonChapter.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/META-INF/MANIFEST.MF" />
</element>
<element id="module-output" name="LegalPersonChapter" />
</element>
<element id="library" level="project" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" />
<element id="file-copy" path="$PROJECT_DIR$/lib/jit-pkivstk-jdk15-1.0.jar" />
<element id="library" level="project" name="Maven: org.glassfish.jersey.core:jersey-server:2.10" />
<element id="library" level="project" name="Maven: commons-logging:commons-logging:1.2" />
<element id="library" level="project" name="Maven: org.glassfish.hk2:osgi-resource-locator:1.0.1" />
<element id="library" level="project" name="Maven: org.glassfish.jersey.containers:jersey-container-jetty-http:2.10" />
<element id="library" level="project" name="Maven: redis.clients:jedis:2.9.0" />
<element id="library" level="project" name="Maven: org.eclipse.jetty:jetty-util:9.3.18.v20170406" />
<element id="library" level="project" name="Maven: org.glassfish.jersey.core:jersey-client:2.10" />
<element id="file-copy" path="$PROJECT_DIR$/lib/commons-logging-1.1.1.jar" />
<element id="library" level="project" name="Maven: org.eclipse.jetty:jetty-security:9.3.18.v20170406" />
<element id="library" level="project" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" />
<element id="library" level="project" name="Maven: javax.ws.rs:javax.ws.rs-api:2.0" />
<element id="library" level="project" name="Maven: org.eclipse.jetty:jetty-servlet:9.3.18.v20170406" />
<element id="library" level="project" name="Maven: org.eclipse.jetty:jetty-continuation:9.1.1.v20140108" />
<element id="library" level="project" name="Maven: org.glassfish.jersey.containers:jersey-container-servlet-core:2.10" />
<element id="library" level="project" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" />
<element id="library" level="project" name="Maven: net.sf.json-lib:json-lib:jdk15:2.4" />
<element id="library" level="project" name="Maven: commons-beanutils:commons-beanutils:1.8.0" />
<element id="library" level="project" name="Maven: org.glassfish.hk2.external:javax.inject:2.3.0-b05" />
<element id="library" level="project" name="Maven: commons-lang:commons-lang:2.5" />
<element id="library" level="project" name="Maven: javax.servlet:javax.servlet-api:3.1.0" />
<element id="library" level="project" name="Maven: org.javassist:javassist:3.18.1-GA" />
<element id="library" level="project" name="Maven: org.eclipse.jetty:jetty-io:9.3.18.v20170406" />
<element id="file-copy" path="$PROJECT_DIR$/lib/jitpkisctk1.0.jar" />
<element id="library" level="project" name="Maven: commons-codec:commons-codec:1.9" />
<element id="library" level="project" name="Maven: javax.validation:validation-api:1.1.0.Final" />
<element id="library" level="project" name="Maven: org.glassfish.jersey.bundles.repackaged:jersey-guava:2.10" />
<element id="library" level="project" name="Maven: org.glassfish.hk2:hk2-utils:2.3.0-b05" />
<element id="library" level="project" name="Maven: org.apache.commons:commons-pool2:2.4.2" />
<element id="library" level="project" name="Maven: org.eclipse.jetty:jetty-server:9.3.18.v20170406" />
<element id="file-copy" path="$PROJECT_DIR$/lib/jit-pkitool-2.3.0.25-beta2.jar" />
<element id="library" level="project" name="Maven: org.glassfish.hk2.external:aopalliance-repackaged:2.3.0-b05" />
<element id="library" level="project" name="Maven: org.glassfish.jersey.core:jersey-common:2.10" />
<element id="library" level="project" name="Maven: org.glassfish.hk2:hk2-locator:2.3.0-b05" />
<element id="library" level="project" name="Maven: org.glassfish.hk2:hk2-api:2.3.0-b05" />
<element id="library" level="project" name="Maven: commons-collections:commons-collections:3.2.1" />
<element id="library" level="project" name="Maven: javax.annotation:javax.annotation-api:1.2" />
<element id="library" level="project" name="Maven: org.eclipse.jetty:jetty-http:9.3.18.v20170406" />
<element id="library" level="project" name="commons-httpclient-3.1" />
</root>
</artifact>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AliAccessStaticViaInstance" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AliAccessToNonThreadSafeStaticFieldFromInstance" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AliArrayNamingShouldHaveBracket" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AliControlFlowStatementWithoutBraces" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AliDeprecation" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AliEqualsAvoidNull" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AliLongLiteralsEndingWithLowercaseL" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AliMissingOverrideAnnotation" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AliWrapperTypeEquality" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AlibabaAbstractClassShouldStartWithAbstractNaming" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidApacheBeanUtilsCopy" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidCommentBehindStatement" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidComplexCondition" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidConcurrentCompetitionRandom" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidManuallyCreateThread" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidMissUseOfMathRandom" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidNewDateGetTime" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidPatternCompileInMethod" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidReturnInFinally" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidStartWithDollarAndUnderLineNaming" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaAvoidUseTimer" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AlibabaBooleanPropertyShouldNotStartWithIs" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaClassCastExceptionWithSubListToArrayList" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaClassCastExceptionWithToArray" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaClassMustHaveAuthor" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaClassNamingShouldBeCamel" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaCollectionInitShouldAssignCapacity" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaCommentsMustBeJavadocFormat" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaConcurrentExceptionWithModifyOriginSubList" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaConstantFieldShouldBeUpperCase" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaCountDownShouldInFinally" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaDontModifyInForeachCircle" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AlibabaEnumConstantsMustHaveComment" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaExceptionClassShouldEndWithException" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaIbatisMethodQueryForList" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaLowerCamelCaseVariableNaming" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaMethodReturnWrapperType" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaPackageNaming" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaPojoMustOverrideToString" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaPojoMustUsePrimitiveField" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaPojoNoDefaultValue" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaRemoveCommentedCode" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaServiceOrDaoClassShouldEndWithImpl" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaStringConcat" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaSwitchStatement" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaTestClassShouldEndWithTestNaming" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaThreadLocalShouldRemove" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaThreadPoolCreation" enabled="false" level="BLOCKER" enabled_by_default="false" />
<inspection_tool class="AlibabaThreadShouldSetName" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaTransactionMustHaveRollback" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaUndefineMagicConstant" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="AlibabaUnsupportedExceptionWithModifyAsList" enabled="false" level="CRITICAL" enabled_by_default="false" />
<inspection_tool class="AlibabaUseQuietReferenceNotation" enabled="false" level="MAJOR" enabled_by_default="false" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
......@@ -32,5 +86,6 @@
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="date" />
</inspection_tool>
<inspection_tool class="MapOrSetKeyShouldOverrideHashCodeEquals" enabled="false" level="CRITICAL" enabled_by_default="false" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JUnitGeneratorProjectSettings">
<option name="selectedTemplateKey" value="JUnit 4" />
<option name="outputFilePattern" value="${SOURCEPATH}/JunitTest/${PACKAGE}/${FILENAME}" />
<option name="vmTemplates">
<map>
<entry key="JUnit 3" value="######################################################################################## &#10;## &#10;## Available variables: &#10;## $entryList.methodList - List of method composites &#10;## $entryList.privateMethodList - List of private method composites &#10;## $entryList.fieldList - ArrayList of class scope field names &#10;## $entryList.className - class name &#10;## $entryList.packageName - package name &#10;## $today - Todays date in MM/dd/yyyy format &#10;## &#10;## MethodComposite variables: &#10;## $method.name - Method Name &#10;## $method.signature - Full method signature in String form &#10;## $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods) &#10;## $method.paramNames - List of Strings representing the method's parameters' names &#10;## $method.paramClasses - List of Strings representing the method's parameters' classes &#10;## &#10;## You can configure the output class name using &quot;testClass&quot; variable below. &#10;## Here are some examples: &#10;## Test${entry.ClassName} - will produce TestSomeClass &#10;## ${entry.className}Test - will produce SomeClassTest &#10;## &#10;######################################################################################## &#10;## &#10;#macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end &#10;## Iterate through the list and generate testcase for every entry. &#10;#foreach ($entry in $entryList) &#10;#set( $testClass=&quot;${entry.className}Test&quot;) &#10;## &#10;package test.$entry.packageName; &#10;&#10;import junit.framework.Test; &#10;import junit.framework.TestSuite; &#10;import junit.framework.TestCase; &#10;&#10;/** &#10;* ${entry.className} Tester. &#10;* &#10;* @author &lt;Authors name&gt; &#10;* @since &lt;pre&gt;$today&lt;/pre&gt; &#10;* @version 1.0 &#10;*/ &#10;public class $testClass extends TestCase { &#10;public $testClass(String name) { &#10;super(name); &#10;} &#10;&#10;public void setUp() throws Exception { &#10;super.setUp(); &#10;} &#10;&#10;public void tearDown() throws Exception { &#10;super.tearDown(); &#10;} &#10;&#10;#foreach($method in $entry.methodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;} &#10;&#10;#end &#10;&#10;#foreach($method in $entry.privateMethodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;#foreach($string in $method.reflectionCode) &#10;$string &#10;#end &#10;} &#10;&#10;#end &#10;&#10;public static Test suite() { &#10;return new TestSuite(${testClass}.class); &#10;} &#10;} &#10;#end" />
<entry key="JUnit 4" value="######################################################################################## &#10;## &#10;## Available variables: &#10;## $entryList.methodList - List of method composites &#10;## $entryList.privateMethodList - List of private method composites &#10;## $entryList.fieldList - ArrayList of class scope field names &#10;## $entryList.className - class name &#10;## $entryList.packageName - package name &#10;## $today - Todays date in MM/dd/yyyy format &#10;## &#10;## MethodComposite variables: &#10;## $method.name - Method Name &#10;## $method.signature - Full method signature in String form &#10;## $method.reflectionCode - list of strings representing commented out reflection code to access method (Private Methods) &#10;## $method.paramNames - List of Strings representing the method's parameters' names &#10;## $method.paramClasses - List of Strings representing the method's parameters' classes &#10;## &#10;## You can configure the output class name using &quot;testClass&quot; variable below. &#10;## Here are some examples: &#10;## Test${entry.ClassName} - will produce TestSomeClass &#10;## ${entry.className}Test - will produce SomeClassTest &#10;## &#10;######################################################################################## &#10;## &#10;#macro (cap $strIn)$strIn.valueOf($strIn.charAt(0)).toUpperCase()$strIn.substring(1)#end &#10;## Iterate through the list and generate testcase for every entry. &#10;#foreach ($entry in $entryList) &#10;#set( $testClass=&quot;${entry.className}Test&quot;) &#10;## &#10;package JunitTest.$entry.packageName; &#10;&#10;import org.junit.Test; &#10;import org.junit.Before; &#10;import org.junit.After; &#10;&#10;/** &#10;* ${entry.className} Tester. &#10;* &#10;* @author Gaoxiang &#10;* @since &lt;pre&gt;$date&lt;/pre&gt; &#10;* @version 1.0 &#10;*/ &#10;public class $testClass { &#10;&#10;@Before&#10;public void before() throws Exception { &#10;} &#10;&#10;@After&#10;public void after() throws Exception { &#10;} &#10;&#10;#foreach($method in $entry.methodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;@Test&#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;} &#10;&#10;#end &#10;&#10;#foreach($method in $entry.privateMethodList) &#10;/** &#10;* &#10;* Method: $method.signature &#10;* &#10;*/ &#10;@Test&#10;public void test#cap(${method.name})() throws Exception { &#10;//TODO: Test goes here... &#10;#foreach($string in $method.reflectionCode) &#10;$string &#10;#end &#10;} &#10;&#10;#end &#10;} &#10;#end" />
</map>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinCommonCompilerArguments">
<option name="languageVersion" value="1.1" />
<option name="apiVersion" value="1.1" />
</component>
</project>
\ No newline at end of file
<component name="libraryTable">
<library name="commons-httpclient-3.1">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/commons-httpclient-3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SmartFoxProjectConfig">
<option name="projectInspectionClosed" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
......@@ -82,5 +82,6 @@
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.5" level="project" />
<orderEntry type="library" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" level="project" />
<orderEntry type="library" name="commons-httpclient-3.1" level="project" />
</component>
</module>
\ No newline at end of file
Manifest-Version: 1.0
Class-Path: ezmorph-1.0.6.jar jit-pkivstk-jdk15-1.0.jar jersey-server-
2.10.jar commons-logging-1.2.jar osgi-resource-locator-1.0.1.jar jers
ey-container-jetty-http-2.10.jar jedis-2.9.0.jar jetty-util-9.3.18.v2
0170406.jar jersey-client-2.10.jar commons-logging-1.1.1.jar jetty-se
curity-9.3.18.v20170406.jar httpcore-4.4.6.jar javax.ws.rs-api-2.0.ja
r jetty-servlet-9.3.18.v20170406.jar jetty-continuation-9.1.1.v201401
08.jar jersey-container-servlet-core-2.10.jar httpclient-4.5.3.jar js
on-lib-2.4-jdk15.jar commons-beanutils-1.8.0.jar javax.inject-2.3.0-b
05.jar commons-lang-2.5.jar javax.servlet-api-3.1.0.jar javassist-3.1
8.1-GA.jar jetty-io-9.3.18.v20170406.jar jitpkisctk1.0.jar commons-co
dec-1.9.jar validation-api-1.1.0.Final.jar jersey-guava-2.10.jar hk2-
utils-2.3.0-b05.jar commons-pool2-2.4.2.jar jetty-server-9.3.18.v2017
0406.jar jit-pkitool-2.3.0.25-beta2.jar aopalliance-repackaged-2.3.0-
b05.jar jersey-common-2.10.jar hk2-locator-2.3.0-b05.jar hk2-api-2.3.
0-b05.jar commons-collections-3.2.1.jar javax.annotation-api-1.2.jar
jetty-http-9.3.18.v20170406.jar commons-httpclient-3.1.jar
Main-Class: com.fri.http.framework.server.YXHttpRestServer
ServerURL=http\://172.16.17.1\:8000/signserver/service/xml
ServerURL=http://192.168.0.110:8000/signserver/service/xml
#ServerURL=http\://192.168.1.13\:8000/signserver/service/xml
#ServerURL=http://192.168.253.126:8000/signserver/service/xml
#ServerURL=http://172.16.40.123:8000/signserver/service/xml
......
......@@ -14,7 +14,7 @@ public class YXDefaultServerConfig {
//Http IP 与 port
public static String SERVER_HOST = "0.0.0.0";
public static int SERVER_PORT = 8283;
public static int SERVER_MONITOR_PORT = 9999;
public static int SERVER_MONITOR_PORT = 9998 ;
//Servlet 路径
......@@ -33,7 +33,7 @@ public class YXDefaultServerConfig {
//logging Spec
//日志记录
public static String LOGGING_OUTPUT_FOLDER = "/Users/killsmile/IDEA_JAVA/CTIDHTTPRestService/logs"; // 默认日志路径
public static String LOGGING_OUTPUT_FOLDER = "./log"; // 默认日志路径
public static int LOGGING_ENTRY_BUFFER = 100; // 日志内存缓冲区
public static String LOGGING_NAME_HTTP_SERVER = "HttpServerLog"; //日志名称
public static String LOGGING_NAME_REQUEST_SERVER = "RequestLog"; //日志名称
......
......@@ -5,7 +5,10 @@ import com.fri.http.framework.logging.YXLogging;
import com.fri.http.legalchapter.rzfw.auth.AuthApply;
import com.fri.http.legalchapter.rzfw.auth.AuthRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.logging.Logger;
......@@ -30,11 +33,10 @@ public class CTIDRestResources {
* 认证申请
* 接收带有 JSON Body 的POST请求,非Form模式
*/
public String authAppForward(String jsonStr) throws Exception {
logger.info(jsonStr);
//执行认证申请 获取响应结果
public String authAppForward(String jsonStr, @Context HttpServletRequest req, @Context HttpServletResponse resp) throws Exception {
resp.setCharacterEncoding("UTF-8");
String response=new AuthApply().authApplyExecute(jsonStr);
System.out.println("一包响应给客户端结果"+response);
return response;
}
......@@ -46,14 +48,10 @@ public class CTIDRestResources {
* 认证请求
* 接收带有 JSON Body 的POST请求,非Form模式
*/
public String authReqForward(String jsonStr) throws Exception {
logger.info(jsonStr);
// YXJSONResponse sta = new YXJSONResponse();
// JSONObject randomResponseObj = new CTIDServer().passRandomData(jsonStr);
// logger2.info(randomResponseObj.toString());
// return sta.outPutSuccess(randomResponseObj).toJSONString();
//认证请求结果
public String authReqForward(String jsonStr, @Context HttpServletRequest req, @Context HttpServletResponse resp) throws Exception {
resp.setCharacterEncoding("UTF-8");
String response= new AuthRequest().authRequestExecute(jsonStr);
System.out.println("二包响应给客户端结果"+response);
return response;
}
......
......@@ -2,9 +2,7 @@ package com.fri.http.legalchapter.rzfw.auth;
import com.fri.http.framework.config.YXDefaultServerConfig;
import com.fri.http.framework.logging.YXLogging;
import com.fri.http.legalchapter.rzfw.data.AuthApplyResponse;
import com.fri.http.legalchapter.rzfw.data.AuthenticationApplicationData;
import com.fri.http.legalchapter.rzfw.data.SocketPackage;
import com.fri.http.legalchapter.rzfw.data.*;
import com.fri.http.legalchapter.rzfw.net.SocketSender;
import com.fri.http.legalchapter.rzfw.utils.Constans;
import com.fri.http.legalchapter.rzfw.utils.FormatBytesUtil;
......@@ -21,83 +19,110 @@ import java.util.logging.Logger;
public class AuthApply {
private Logger logger = YXLogging.getLogger(YXDefaultServerConfig.LOGGING_NAME_REQUEST_SERVER);
/**
* customerId 客户号 8字节 共用
* terminalId 终端号 2字节 共用 1.0写死 2.0用应用名称 FormatBytesUtil.hexStringToBytes(preAuthBean.getAppName());
* timeStamp 4字节时间戳
* readCardControlsVersion 读卡控件版本 4字节
* pictureControlsVersion 人像控件版本 4字节
* certificateNumber 证书标识 or 业务站点
* auAppData 身份认证申请数据区
* version 协议版本 2字节 0x0001 共用
* commandType 命令类型 1字节 0x00(请求)0x01(应答) 共用
* command 命令 1字节 0x00(身份认证申请)0x01(身份认证) 共用但值不同
* commandContent 命令内容 1字节 保留 0x00 共用
* operation 操作 1字节 保留 0x00 共用
* auAppSPData 身份认证 一包 Socket数据报文
* applicationReturn 身份认证请求1.0 平台 响应结果
* checkSignResult 身份认证请求1.0 平台 响应验签是否正确
* date 返回时间戳
* businessSerialNumberByte 流水号
* randomBytesLength 随机数长度
* randomData 随机数数据
* errorDesc 错误描述
*/
private byte[] customerId;
private byte[] terminalId;
private byte[] timeStamp;
private byte[] readCardControlsVersion;
private byte[] pictureControlsVersion;
private byte[] certificateNumber;
private byte[] auAppData;
private byte[] version = new byte[]{0, 1};
private byte[] commandType = new byte[]{0};
private byte[] command = new byte[]{0};
private byte[] commandContent = new byte[]{0};
private byte[] operation = new byte[]{0};
private byte[] auAppSPData;
private byte[] applicationReturn;
private boolean checkSignResult=false;
private String date;
private byte[] businessSerialNumberByte = null;
private short randomBytesLength;
private String randomData;
private String errorDesc="未知错误";
private byte[] customerId_Length=new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };
private byte[] timeStamp_Length=new byte[] { 1, 2,3,4};
private byte[] readCardControlsVersion_Length=new byte[] { 1, 2, 3, 4 };
private byte[] pictureControlsVersion_Length=new byte[] { 1, 2, 3, 4 };
PreAuthResponse preAuthResponse= new PreAuthResponse();
public String authApplyExecute(String authapplyJson){
/*
JSONObject preAuthApply=JSONObject.fromObject(authapplyJson);
PreAuthBean preAuthBean= (PreAuthBean) JSONObject.toBean(preAuthApply, PreAuthBean.class);
/**
* 组装认证申请数据区 第一个包的数据区
*/
// 客户号 8字节 共用
byte[] customerId = Constans.customerId;
// 终端号 2字节 共用
byte[] terminalId = Constans.terminalId;
// 读卡控件版本 4字节
byte[] readCardControlsVersion = new byte[] { 1, 2, 3, 4 };
// 人像控件版本 4字节
byte[] pictureControlsVersion = new byte[] { 1, 2, 3, 4 };
//证书标识
byte[] certificateNumber=Constans.certificateNumber;
//业务站点
logger.info("证书序列号:" + Arrays.toString(certificateNumber));
// System.out.println("证书序列号:" + Arrays.toString(certificateNumber));
AuthenticationApplicationData auApp = new AuthenticationApplicationData(customerId, terminalId,
customerId= FormatBytesUtil.getBytesFromString(customerId_Length ,preAuthBean.getCustomerNumber());
//TODO 终端号 2字节 共用 1.0写死 2.0用应用名称 FormatBytesUtil.hexStringToBytes(preAuthBean.getAppName());
terminalId = Constans.terminalId;
timeStamp = FormatBytesUtil.getBytesFromString(timeStamp_Length, preAuthBean.getTimeStamp());
readCardControlsVersion = FormatBytesUtil.getBytesFromString(readCardControlsVersion_Length,preAuthBean.getCardReaderVersion());
pictureControlsVersion =FormatBytesUtil.getBytesFromString(pictureControlsVersion_Length,preAuthBean.getLiveDetectionControlVersion());
certificateNumber=Constans.certificateNumber;
PreAuthData auApp = new PreAuthData(customerId, terminalId,timeStamp,
readCardControlsVersion, pictureControlsVersion, certificateNumber);
byte[] auAppData = auApp.getAuthenticationApplicationData();
auAppData = auApp.getPreAuthData();
/*
/**
* 组装认证申请Socket数据包 第一次UDP数据包
*/
// 协议版本 2字节 0x0001 共用
byte[] version = { 0, 1 };
// 命令类型 1字节 0x00(请求)0x01(应答) 共用
byte[] commandType = { 0 };
// 命令 1字节 0x00(身份认证申请)0x01(身份认证) 共用但值不同
byte[] command = { 0 };
// 命令内容 1字节 保留 0x00 共用
byte[] commandContent = { 0 };
// 操作 1字节 保留 0x00 共用
byte[] operation = { 0 };
SocketPackage auAppSP = new SocketPackage(version, commandType, command, commandContent, operation, auAppData);
byte[] auAppSPData = auAppSP.getSocketPackage();
byte[] applicationReturn = SocketSender.sendSocketPackage(auAppSPData);
auAppSPData = auAppSP.getSocketPackage();
applicationReturn = SocketSender.sendSocketPackage(auAppSPData);
if(applicationReturn!=null){
checkSignResult=DataSignature.signCheck(applicationReturn);
System.out.println("验签结果"+checkSignResult);
if (!checkSignResult){
errorDesc="身份认证请求1.0 平台 响应验签出错";
}
}
AuthApplyResponse response= new AuthApplyResponse();
/*
* 组装认证数据区 第二个包的数据区
/**
* 组装认证申请返回包
*/
byte[] streamNumber = null;
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String date=df.format(new Date());
if (applicationReturn != null) {
streamNumber = Arrays.copyOfRange(applicationReturn, 24, 33);// 获取到业务流水号要组装进第二个数据包中
//业务流水号
response.setBusinessSerialNumber(FormatBytesUtil.bytesToHexString(streamNumber));
System.out.println("流水号:"+FormatBytesUtil.bytesToHexString(streamNumber));
short randomBytesLength = FormatBytesUtil.getShortFromBytes(Arrays.copyOfRange(applicationReturn, 33, 35)); // 获取随机数长度
String randomData = FormatBytesUtil
businessSerialNumberByte = Arrays.copyOfRange(applicationReturn, 24, 33);
preAuthResponse.setBusinessSerialNumber(FormatBytesUtil.bytesToHexString(businessSerialNumberByte));
randomBytesLength = FormatBytesUtil.getShortFromBytes(Arrays.copyOfRange(applicationReturn, 33, 35)); // 获取随机数长度
randomData = FormatBytesUtil
.bytesToHexString(Arrays.copyOfRange(applicationReturn, 35, 35 + randomBytesLength)); // 获取随机数数据
System.out.println("随机数长度:" + randomBytesLength);
System.out.println("随机数数据:" + randomData);
//随机数
response.setRandomNumber(randomData);
//申请结果
response.setSuccess(true);
preAuthResponse.setRandomNumber(randomData);
preAuthResponse.setSuccess(true);
errorDesc="";
}
if (applicationReturn == null) {
//申请结果
response.setSuccess(false);
//错误结果
response.setErrorDesc("业务流水号获取失败,请重新获取");
System.out.println("获取流水号失败,认证失败。");
preAuthResponse.setSuccess(false);
errorDesc="业务流水号获取失败,请重新获取";
}
//响应时间
response.setTimeStamp(date);
String responseStr=JSONObject.fromObject(response).toString();
preAuthResponse.setTimeStamp(preAuthBean.getTimeStamp());
preAuthResponse.setErrorDesc(errorDesc);
preAuthResponse.setCustomerNumber(preAuthBean.getCustomerNumber());
preAuthResponse.setAppName(preAuthBean.getAppName());
String responseStr=JSONObject.fromObject(preAuthResponse).toString();
return responseStr;
}
}
package com.fri.http.legalchapter.rzfw.data;
/**
* Created by gaoxiang on 2017/12/29.
*/
public class AuthApplyRetainDataBean {
private String name;
private String idNumber;
private String enableDate;
private String expireDate;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIdNumber() {
return idNumber;
}
public void setIdNumber(String idNumber) {
this.idNumber = idNumber;
}
public String getEnableDate() {
return enableDate;
}
public void setEnableDate(String enableDate) {
this.enableDate = enableDate;
}
public String getExpireDate() {
return expireDate;
}
public void setExpireDate(String expireDate) {
this.expireDate = expireDate;
}
}
......@@ -25,7 +25,15 @@ public class AuthRequestBean {
private String photoData;
private String authCode;
private String idcardAuthData;
private String authApplyRetainData;
private AuthApplyRetainDataBean authApplyRetainData=new AuthApplyRetainDataBean();
public AuthApplyRetainDataBean getAuthApplyRetainData() {
return authApplyRetainData;
}
public void setAuthApplyRetainData(AuthApplyRetainDataBean authApplyRetainData) {
this.authApplyRetainData = authApplyRetainData;
}
public String getCustomNumber() {
return customNumber;
......@@ -91,11 +99,4 @@ public class AuthRequestBean {
this.idcardAuthData = idcardAuthData;
}
public String getAuthApplyRetainData() {
return authApplyRetainData;
}
public void setAuthApplyRetainData(String authApplyRetainData) {
this.authApplyRetainData = authApplyRetainData;
}
}
......@@ -6,78 +6,84 @@ import java.util.Arrays;
public class AuthenticationData {
// 客户号 8字节
/**
* lengthOfTwo ID验证数据字段及认证吗数据字段总长 2字节
* lengthOfIdCheck ID验证数据长度 2字节
* lengthOfAuthCodeData 认证码数据长度 2字节
* lengthOfPicture 照片长度 4字节
* lengthOfReservasion 认证申请保留数据长度 2字节
*/
private byte[] lengthOfTwo;
private byte[] lengthOfIdCheck;
private byte[] lengthOfAuthCodeData;
private byte[] lengthOfPicture;
private byte[] lengthOfReservasion;
private byte[] customerId;
// 终端号 2字节
private byte[] terminalId;
// 时间戳 4字节
private byte[] timestamp;
// 业务流水号 9字节
private byte[] streamNumber;
// 认证模式 1字节
private byte[] identityModel;
// ID验证数据字段及认证吗数据字段总长 2字节
private byte[] lengthOfTwo;
// ID验证数据长度 2字节
private byte[] lengthOfIdCheck;
// ID验证数据 变长 可为空
private byte[] idCheck;
// 认证码数据长度 2字节
private byte[] lengthOfVerification;
// 认证码数据 变长 可为空
private byte[] verification;
// 照片长度 4字节
private byte[] lengthOfPicture;
// 照片数据 变长 可为空
private byte[] picture;
// 认证申请保留数据长度 2字节
private byte[] lengthOfReservasion;
// 认证申请保留数据 变长 可为空
private byte[] reservation;
// 证书序列号 32字节
private byte[] idCheckData;
private byte[] authCodeData;
private byte[] pictureData;
private byte[] reservationData;
private byte[] certificateNumber;
public AuthenticationData(byte[] customerId, byte[] terminalId, byte[] streamNumber, byte[] identityModel,
byte[] idCheck, byte[] verification, byte[] picture, byte[] reservation, byte[] certificateNumber) {
/**
*
* @param customerId 客户号 8字节
* @param terminalId 终端号 2字节
* @param timestamp 时间戳 4字节
* @param streamNumber 业务流水号 9字节
* @param identityModel 认证模式 1字节
* @param idCheckData ID验证数据 变长 可为空
* @param authCodeData 认证码数据 变长 可为空
* @param pictureData 照片数据 变长 可为空
* @param reservationData 认证申请保留数据 变长 可为空
* @param certificateNumber 证书序列号 32字节
*/
public AuthenticationData(byte[] customerId, byte[] terminalId, byte[] timestamp, byte[] streamNumber, byte[] identityModel,
byte[] idCheckData, byte[] authCodeData, byte[] pictureData, byte[] reservationData, byte[] certificateNumber) {
super();
this.customerId = customerId;
this.terminalId = terminalId;
this.timestamp = FormatBytesUtil.getTimestamp();
this.timestamp = timestamp;
this.streamNumber = streamNumber;
this.identityModel = identityModel;
int idCheckLengthTemp = 0;
int verificationLengthTemp = 0;
this.lengthOfIdCheck = new byte[] { 0, 0 };
if (idCheck != null) {
idCheckLengthTemp = idCheck.length;
this.lengthOfIdCheck = FormatBytesUtil.getByteOfShort((short) idCheck.length);
if (idCheckData != null) {
idCheckLengthTemp = idCheckData.length;
this.lengthOfIdCheck = FormatBytesUtil.getByteOfShort((short) idCheckData.length);
}
this.idCheck = idCheck;
this.lengthOfVerification = new byte[] { 0, 0 };
if (verification != null) {
verificationLengthTemp = verification.length;
this.lengthOfVerification = FormatBytesUtil.getByteOfShort((short) verification.length);
this.idCheckData = idCheckData;
this.lengthOfAuthCodeData = new byte[] { 0, 0 };
if (authCodeData != null) {
verificationLengthTemp = authCodeData.length;
this.lengthOfAuthCodeData = FormatBytesUtil.getByteOfShort((short) authCodeData.length);
}
this.verification = verification;
this.authCodeData = authCodeData;
this.lengthOfTwo = FormatBytesUtil.getByteOfShort((short) (idCheckLengthTemp + verificationLengthTemp + 4));
this.lengthOfPicture = new byte[] { 0, 0, 0, 0 };
if (picture != null) {
this.lengthOfPicture = FormatBytesUtil.getBytesOfInt(picture.length);
if (pictureData != null) {
this.lengthOfPicture = FormatBytesUtil.getBytesOfInt(pictureData.length);
}
this.picture = picture;
this.pictureData = pictureData;
this.lengthOfReservasion = new byte[] { 0, 0 };
if (reservation != null) {
this.lengthOfReservasion = FormatBytesUtil.getByteOfShort((short) reservation.length);
if (reservationData != null) {
this.lengthOfReservasion = FormatBytesUtil.getByteOfShort((short) reservationData.length);
}
this.reservation = reservation;
this.reservationData = reservationData;
this.certificateNumber = certificateNumber;
}
public byte[] getAuthenticationData() {
byte[] data = FormatBytesUtil.concatAll(customerId, terminalId, timestamp, streamNumber, identityModel,
lengthOfTwo, lengthOfIdCheck, idCheck, lengthOfVerification, verification, lengthOfPicture, picture,
lengthOfReservasion, reservation, certificateNumber);
System.out.println("身份认证数据区:" + Arrays.toString(data));
lengthOfTwo, lengthOfIdCheck, idCheckData, lengthOfAuthCodeData, authCodeData, lengthOfPicture, pictureData,
lengthOfReservasion, reservationData, certificateNumber);
return data;
}
}
package com.fri.http.legalchapter.rzfw.data;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import cn.com.jit.assp.css.client.util.Base64;
......@@ -18,7 +20,6 @@ public class DataSignature {
}
public static boolean signCheck(byte[] dataPackage) {
byte[] dataLengthByte = Arrays.copyOfRange(dataPackage, 6, 10);
// 数据区长度
int dataLength = FormatBytesUtil.getIntFromBytes(dataLengthByte);
......@@ -37,13 +38,10 @@ public class DataSignature {
String certID = new String(zhengshu).trim();
System.out.println("证书序列号:" + certID);
String strDigetsAlg = "sm3";
long a = ds.p1Verify(certID, strDigetsAlg, Base64.encode(signatureByte), data);
if (a == 0) {
return true;
}
System.out.println("错误号为:" + ds.getErrorCode());
System.out.println("错误描述:" + ds.getErrorMessage());
return false;
}
}
package com.fri.http.legalchapter.rzfw.data;
/**
* Created by gaoxiang on 2017/12/26.
*/
public class PreAuthBean {
private String customerNumber = "";
private String appName = "";
private String timeStamp = "";
private String cardReaderVersion = "";
private String liveDetectionControlVersion = "";
private String authCodeControlVersion = "" ;
private String authMode = "";
public String getCustomerNumber() {
return customerNumber;
}
public void setCustomerNumber(String customerNumber) {
this.customerNumber = customerNumber;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(String timeStamp) {
this.timeStamp = timeStamp;
}
public String getCardReaderVersion() {
return cardReaderVersion;
}
public void setCardReaderVersion(String cardReaderVersion) {
this.cardReaderVersion = cardReaderVersion;
}
public String getLiveDetectionControlVersion() {
return liveDetectionControlVersion;
}
public void setLiveDetectionControlVersion(String liveDetectionControlVersion) {
this.liveDetectionControlVersion = liveDetectionControlVersion;
}
public String getAuthCodeControlVersion() {
return authCodeControlVersion;
}
public void setAuthCodeControlVersion(String authCodeControlVersion) {
this.authCodeControlVersion = authCodeControlVersion;
}
public String getAuthMode() {
return authMode;
}
public void setAuthMode(String authMode) {
this.authMode = authMode;
}
}
......@@ -5,7 +5,7 @@ import com.fri.http.legalchapter.rzfw.utils.FormatBytesUtil;
import java.util.Arrays;
public class AuthenticationApplicationData {
public class PreAuthData {
// 客户号 8字节
private byte[] customerId;
// 终端号 2字节
......@@ -19,21 +19,20 @@ public class AuthenticationApplicationData {
// 证书序列号 32字节
private byte[] certificateNumber;
public AuthenticationApplicationData(byte[] customerId, byte[] terminalId, byte[] readCardControlsVersion,
byte[] pictureControlsVersion, byte[] certificateNumber) {
public PreAuthData(byte[] customerId, byte[] terminalId, byte[] timestamp, byte[] readCardControlsVersion,
byte[] pictureControlsVersion, byte[] certificateNumber) {
super();
this.customerId = customerId;
this.terminalId = terminalId;
this.timestamp = FormatBytesUtil.getTimestamp();
this.timestamp = timestamp;
this.readCardControlsVersion = readCardControlsVersion;
this.pictureControlsVersion = pictureControlsVersion;
this.certificateNumber = certificateNumber;
}
public byte[] getAuthenticationApplicationData() {
public byte[] getPreAuthData() {
byte[] data = FormatBytesUtil.concatAll(customerId, terminalId, timestamp, readCardControlsVersion,
pictureControlsVersion, certificateNumber);
System.out.println("身份认证申请数据区:" + Arrays.toString(data));
return data;
}
}
......@@ -3,7 +3,7 @@ package com.fri.http.legalchapter.rzfw.data;
/**
* Created by GavinLi 李晓阳 on 2017/12/24.
*/
public class AuthApplyResponse {
public class PreAuthResponse {
/**
* customerNumber : LegalPersonChapter001
......
package com.fri.http.legalchapter.rzfw.data;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import cn.com.jit.assp.dsign.DSign;
import com.fri.http.legalchapter.rzfw.exception.EncryptionException;
import com.fri.http.legalchapter.rzfw.utils.FormatBytesUtil;
public class ReservationData {
......@@ -35,17 +37,16 @@ String json="";
this.validEnd = validEnd;
}
public byte[] getReservasionBytes() {
public byte[] getReservasionBytes() throws EncryptionException{
// 各项信息长度固定
byte[] nameByte = new byte[45];
byte[] idNumberByte = new byte[18];
byte[] validFromByte = new byte[8];
byte[] validEndByte = new byte[8];
try {
// 姓名以UTF-8格式转换为byte[]
nameByte = FormatBytesUtil.copyByteToAnother(nameByte, name.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
......@@ -64,21 +65,18 @@ String json="";
}
/**
* 通过签名服务器对保留数据单独进行加密
* 通过签名服务器对数据单独进行加密
*
* @param bytes
* @return
*/
private byte[] getDesign(byte[] bytes) {
public static byte[] getDesign(byte[] bytes){
DSign dSign = new DSign();
String signReturn = null;
DSign.init("./config/cssconfig.properties");
// 正式线alias改成{ "rzfw01" }
String[] alias = { "rzfw01" };
signReturn = dSign.encryptEnvelop(alias, bytes);
if (signReturn != null) {
return signReturn.getBytes();
}
return null;
return signReturn.getBytes();
}
}
......@@ -6,25 +6,28 @@ import java.util.Arrays;
public class SocketPackage {
// 协议版本 2字节 0x0001
private byte[] version;
// 命令类型 1字节 0x00(请求)0x01(应答)
private byte[] commandType;
// 命令 1字节 0x00(身份认证申请)0x01(身份认证)
private byte[] command;
// 命令内容 1字节 保留 0x00
private byte[] commandContent;
// 操作 1字节 保留 0x00
private byte[] operation;
// 数据区长度 4字节
private byte[] dataLength;
// 数据区 变长
private byte[] data;
// 签名长度 1字节
private byte[] signatureLength;
// 签名 变长
private byte[] signature;
/**
*
* @param version 协议版本 2字节 0x0001
* @param commandType 命令类型 1字节 0x00(请求)0x01(应答)
* @param command 命令 1字节 0x00(身份认证申请)0x01(身份认证)
* @param commandContent 命令内容 1字节 保留 0x00
* @param operation 操作 1字节 保留 0x00
* @param data 数据区 变长
*/
public SocketPackage(byte[] version, byte[] commandType, byte[] command, byte[] commandContent, byte[] operation,
byte[] data) {
super();
......@@ -40,13 +43,11 @@ public class SocketPackage {
public byte[] getSocketPackage() {
byte[] clearText = FormatBytesUtil.concatAll(version, commandType, command, commandContent, operation,
dataLength, data);
System.out.println("身份认证请求Socket数据原文:" + Arrays.toString(clearText));
byte[] cipherText = DataSignature.signature(clearText);
System.out.println("身份认证请求Socket数据签名:" + Arrays.toString(cipherText));
this.signatureLength = new byte[] { (byte) cipherText.length };
this.signature = cipherText;
byte[] socketPackage = FormatBytesUtil.concatAll(clearText, signatureLength, signature);
System.out.println("身份认证请求Socket数据报文:" + Arrays.toString(socketPackage));
return socketPackage;
}
......
package com.fri.http.legalchapter.rzfw.exception;
/**
* Created by gao on 2017/9/1.
*/
public class BasicException extends Exception {
private String msg;
public BasicException(){}
public BasicException( String msg){
this.msg=msg;
}
@Override
public String getMessage() {
return "ERROR: -> " + this.msg;
}
}
package com.fri.http.legalchapter.rzfw.exception;
/**
* Created by gaoxiang on 2017/12/27.
*/
public class EncryptionException extends BasicException{
public EncryptionException(String msg){super(msg);}
}
package com.fri.http.legalchapter.rzfw.test;
import com.fri.http.legalchapter.rzfw.data.*;
import com.fri.http.legalchapter.rzfw.net.SocketSender;
import com.fri.http.legalchapter.rzfw.utils.Constans;
import com.fri.http.legalchapter.rzfw.utils.FormatBytesUtil;
import java.util.Arrays;
/**
* 身份认证测试Demo
*
* @author 夏晨棋
* @email xia794404765@gmail.com
* @qq 794404765
* @version 创建时间 2017年3月8日 下午3:25:38
*/
public class RunDemo {
public static void main(String[] args) {
/*
* 组装认证申请数据区 第一个包的数据区
*/
// 客户号 8字节 共用
byte[] customerId = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };
// 终端号 2字节 共用
byte[] terminalId = new byte[] { 1, 2 };
// 读卡控件版本 4字节
byte[] readCardControlsVersion = new byte[] { 1, 2, 3, 4 };
// 人像控件版本 4字节
byte[] pictureControlsVersion = new byte[] { 1, 2, 3, 4 };
// 证书序列号 32字节 "csywzd1" 共用
// byte[] certificateNumber = new byte[] { 99, 115, 121, 119, 122, 100, 49 };
byte[] certificateNumber = new byte[] {114, 122, 102, 119, 48, 49 };
certificateNumber = FormatBytesUtil.copyByteToAnother(new byte[32], certificateNumber);
System.out.println("证书序列号:" + Arrays.toString(certificateNumber));
AuthenticationApplicationData auApp = new AuthenticationApplicationData(customerId, terminalId,
readCardControlsVersion, pictureControlsVersion, certificateNumber);
byte[] auAppData = auApp.getAuthenticationApplicationData();
/*
* 组装认证申请Socket数据包 第一次UDP数据包
*/
// 协议版本 2字节 0x0001 共用
byte[] version = { 0, 1 };
// 命令类型 1字节 0x00(请求)0x01(应答) 共用
byte[] commandType = { 0 };
// 命令 1字节 0x00(身份认证申请)0x01(身份认证) 共用但值不同
byte[] command = { 0 };
// 命令内容 1字节 保留 0x00 共用
byte[] commandContent = { 0 };
// 操作 1字节 保留 0x00 共用
byte[] operation = { 0 };
SocketPackage auAppSP = new SocketPackage(version, commandType, command, commandContent, operation, auAppData);
byte[] auAppSPData = auAppSP.getSocketPackage();
byte[] applicationReturn = SocketSender.sendSocketPackage(auAppSPData);
/*
* 组装认证数据区 第二个包的数据区
*/
byte[] streamNumber = null;
if (applicationReturn != null) {
streamNumber = Arrays.copyOfRange(applicationReturn, 24, 33);// 获取到业务流水号要组装进第二个数据包中
System.out.println("流水号:" + Arrays.toString(streamNumber));
System.out.println(FormatBytesUtil.bytesToHexString(streamNumber));
short randomBytesLength = FormatBytesUtil.getShortFromBytes(Arrays.copyOfRange(applicationReturn, 33, 35)); // 获取随机数长度
String randomData = FormatBytesUtil
.bytesToHexString(Arrays.copyOfRange(applicationReturn, 35, 35 + randomBytesLength)); // 获取随机数数据
System.out.println("随机数长度:" + randomBytesLength);
System.out.println("随机数数据:" + randomData);
}
if (applicationReturn == null) {
System.out.println("获取流水号失败,认证失败。");
return;
}
byte[] picture = Constans.picture; // 生成人像数据
byte[] reservationFour = new ReservationData("毛家亮", "342224198901241273", "20071114", "20171114")
.getReservasionBytes(); // 生成四项保留数据
byte[] reservationTwo = new ReservationData("李晓阳", "410185199211044510", null, null).getReservasionBytes(); // 生成两项保留数据
/*
* 0X0F
*/
byte[] identityModel_0X0F = new byte[] { 0x0f };
AuthenticationData au_0X0F = new AuthenticationData(customerId, terminalId, streamNumber, identityModel_0X0F,
Constans.idCheck, Constans.verification, picture, null, certificateNumber);
byte[] auData_0X0F = au_0X0F.getAuthenticationData();
/*
* 0X4F
*/
byte[] identityModel_0X4F = new byte[] { 0x4f };
AuthenticationData au_0X4F = new AuthenticationData(customerId, terminalId, streamNumber, identityModel_0X4F,
Constans.idCheck, Constans.verification, picture, reservationTwo, certificateNumber);
@SuppressWarnings("unused")
byte[] auData_0X4F = au_0X4F.getAuthenticationData();
/*
* 0X1F
*/
byte[] identityModel_0X1F = new byte[] { 0x1f };
AuthenticationData au_0X1F = new AuthenticationData(customerId, terminalId, streamNumber, identityModel_0X1F,
Constans.idCheck, Constans.verification, picture, reservationFour, certificateNumber);
byte[] identityModel_0X62 = new byte[] { 0x62 };
AuthenticationData au_0X62 = new AuthenticationData(customerId, terminalId, streamNumber, identityModel_0X62,
null, null, picture, reservationFour, certificateNumber);
@SuppressWarnings("unused")
byte[] auData_0X62 = au_0X62.getAuthenticationData();
/**
* 0x40
*/
byte[] identityModel_0X40 = new byte[] { 0x40 };
AuthenticationData au_0X40 = new AuthenticationData(customerId, terminalId, streamNumber, identityModel_0X40,
null, null, null, reservationTwo, certificateNumber);
@SuppressWarnings("unused")
byte[] auData_0X40 = au_0X40.getAuthenticationData();
/**
* 0x42
*/
byte[] identityModel_0X42 = new byte[] { 0x42 };
AuthenticationData au_0X42 = new AuthenticationData(customerId, terminalId, streamNumber, identityModel_0X42,
null, null, picture, reservationTwo, certificateNumber);
@SuppressWarnings("unused")
byte[] auData_0X42 = au_0X42.getAuthenticationData();
/*
* 0X13
*/
byte[] identityModel_0X13 = new byte[] { 0x13 };
AuthenticationData au_0X13 = new AuthenticationData(customerId, terminalId, streamNumber, identityModel_0X13,
Constans.idCheck, null, picture, reservationFour, certificateNumber);
@SuppressWarnings("unused")
byte[] auData_0X13 = au_0X13.getAuthenticationData();
/*
* 组装认证Socket数据包 第二次UDP数据包
*/
command[0] = 1; // 命令 1字节 0x00(身份认证申请)0x01(身份认证) 修改值的内容为1
SocketPackage auSP = new SocketPackage(version, commandType, command, commandContent, operation, auData_0X40);
byte[] auSPData = auSP.getSocketPackage();
byte[] auReturn = SocketSender.sendSocketPackage(auSPData);
if (auReturn != null) {
System.out.println("响应结果:"+Arrays.toString(auReturn));
System.out.println("验签结果:" + DataSignature.signCheck(auReturn)); // 验签
String string = new String(Arrays.copyOfRange(auReturn, 33, 37));
System.out.print("认证结果:" + string);
return;
}
System.out.println("认证失败。");
}
}
......@@ -82,7 +82,11 @@ public class FormatBytesUtil {
* @return
*/
public static byte[] getBytesFromString(byte[] bytes, String string) {
for (int i = 0; i < string.length(); i++) {
int j=string.length();
if(bytes.length<string.length()){
j=bytes.length;
}
for (int i = 0; i < j; i++) {
bytes[i] = (byte) string.charAt(i);
}
return bytes;
......@@ -91,8 +95,8 @@ public class FormatBytesUtil {
/**
* 将两个byte数组合并为一个
*
* @param byte_1
* @param byte_2
* @param byte1
* @param byte2
* @return byte_3
*/
public static byte[] byteMerger(byte[] byte1, byte[] byte2) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment