Commit 3a2cad56 by 涂亚平

start...

0 parents
Showing with 2715 additions and 0 deletions
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/commons-beanutils-1.7.0.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.4.jar"/>
<classpathentry kind="lib" path="lib/commons-collections-3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.5.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/ezmorph-1.0.3.jar"/>
<classpathentry kind="lib" path="lib/google-collections-1.0.jar"/>
<classpathentry kind="lib" path="lib/gson-2.8.0.jar"/>
<classpathentry kind="lib" path="lib/guava-18.0.jar"/>
<classpathentry kind="lib" path="lib/guava-gwt-18.0.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.3.1.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.4.4.jar"/>
<classpathentry kind="lib" path="lib/jmagick-6.6.9-javadoc.jar"/>
<classpathentry kind="lib" path="lib/json-lib-2.4-jdk15.jar"/>
<classpathentry kind="lib" path="lib/MumbleJMeter-plugins-1.0-SNAPSHOT.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/接入必看.txt" charset="GBK" />
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="date" />
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/demo.iml" filepath="$PROJECT_DIR$/demo.iml" />
</modules>
</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
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="bc0853e3-6a4f-4252-a387-eceaa4f44ef6" name="Default" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DatabaseView">
<option name="SHOW_INTERMEDIATE" value="true" />
<option name="GROUP_SCHEMA" value="true" />
<option name="GROUP_CONTENTS" value="false" />
<option name="SORT_POSITIONED" value="false" />
<option name="SHOW_TABLE_DETAILS" value="true" />
<option name="SHOW_EMPTY_GROUPS" value="false" />
<option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
<expand />
<select />
</component>
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="mavenHome" value="E:/JavaSafeware/apache-maven-3.3.9" />
<option name="userSettingsFile" value="E:\JavaSafeware\apache-maven-3.3.9\conf\settings.xml" />
</MavenGeneralSettings>
</option>
</component>
<component name="ProjectId" id="2CQaQMraBjrxbQUyQKUNGyGNx1U" />
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
</expanded-state>
<selected-state>
<State>
<id>Android</id>
</State>
</selected-state>
</profile-state>
</entry>
</component>
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="project.structure.last.edited" value="SDKs" />
<property name="project.structure.proportion" value="0.15357459" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="settings.github" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\Administrator\Desktop\接入demo\demo(2)\demo\src\com\webank\utils" />
<recent name="C:\Users\Administrator\Desktop\接入demo\demo(2)\demo\src\com\webank\pass" />
</key>
</component>
<component name="RunManager" selected="Application.PassEasyface">
<configuration default="true" type="Applet" factoryName="Applet">
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<module />
</configuration>
<configuration name="BankCardOcrApp" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.webank.pass.BankCardOcrApp" />
<module name="demo" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.webank.pass.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="OcrResults" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.webank.h5result.OcrResults" />
<module name="demo" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.webank.h5result.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="PaasIdcardOcrApp" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.webank.pass.PaasIdcardOcrApp" />
<module name="demo" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.webank.pass.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="PassEasyCompare" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.webank.pass.PassEasyCompare" />
<module name="demo" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.webank.pass.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="PassEasyface" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="com.webank.pass.PassEasyface" />
<module name="demo" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.webank.pass.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<option name="TEST_OBJECT" value="class" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="TestNG">
<option name="TEST_OBJECT" value="CLASS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<properties />
<listeners />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file enabled="true" id="idea.log" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<list>
<item itemvalue="Application.OcrResults" />
<item itemvalue="Application.BankCardOcrApp" />
<item itemvalue="Application.PaasIdcardOcrApp" />
<item itemvalue="Application.PassEasyCompare" />
<item itemvalue="Application.PassEasyface" />
</list>
<recent_temporary>
<list>
<item itemvalue="Application.PassEasyface" />
<item itemvalue="Application.PassEasyCompare" />
<item itemvalue="Application.PaasIdcardOcrApp" />
<item itemvalue="Application.BankCardOcrApp" />
<item itemvalue="Application.OcrResults" />
</list>
</recent_temporary>
</component>
<component name="SshConsoleOptionsProvider">
<option name="myEncoding" value="UTF-8" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="bc0853e3-6a4f-4252-a387-eceaa4f44ef6" name="Default" comment="" />
<created>1529389282065</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1529389282065</updated>
<workItem from="1529389288551" duration="2413000" />
<workItem from="1567588143826" duration="1915000" />
<workItem from="1658737245582" duration="1087000" />
<workItem from="1658892481209" duration="55000" />
<workItem from="1658902986723" duration="1500000" />
<workItem from="1665302916979" duration="5000" />
<workItem from="1669021374222" duration="2000" />
<workItem from="1671519429041" duration="233000" />
<workItem from="1671523657354" duration="760000" />
<workItem from="1671604821140" duration="1046000" />
<workItem from="1677735337295" duration="181000" />
<workItem from="1709193359813" duration="4000" />
<workItem from="1718869394924" duration="4000" />
</task>
<servers />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="masterDetails">
<states>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>demo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding//src/com/webank/one/GetSIGNTicketTest.java=UTF-8
encoding//src/com/webank/pass/PassEasyCompare.java=UTF-8
encoding//src/com/webank/pass/PassEasyface.java=UTF-8
encoding//src/com/webank/utils/ValidateSignUtils.java=UTF-8
encoding//src/com/webank/utils/ValidateSignUtils2.java=UTF-8
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="jar://$MODULE_DIR$/lib/commons-beanutils-1.7.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-codec-1.4.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-collections-3.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-httpclient-3.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-lang-2.5.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-logging-1.1.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/ezmorph-1.0.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/google-collections-1.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/gson-2.8.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/guava-18.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/guava-gwt-18.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpclient-4.3.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/httpcore-4.4.4.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jmagick-6.6.9-javadoc.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/json-lib-2.4-jdk15.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/MumbleJMeter-plugins-1.0-SNAPSHOT.jar!/" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
</src_description>
</component>
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/bin" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />
<orderEntry type="module-library">
<library name="commons-beanutils-1.7.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-beanutils-1.7.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-codec-1.4.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-codec-1.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-collections-3.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-collections-3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-httpclient-3.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-httpclient-3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-lang-2.5.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-lang-2.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-logging-1.1.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-logging-1.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="ezmorph-1.0.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/ezmorph-1.0.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="google-collections-1.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/google-collections-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="gson-2.8.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/gson-2.8.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="guava-18.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/guava-18.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="guava-gwt-18.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/guava-gwt-18.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpclient-4.3.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpclient-4.3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="httpcore-4.4.4.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/httpcore-4.4.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jmagick-6.6.9-javadoc.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jmagick-6.6.9-javadoc.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="json-lib-2.4-jdk15.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/json-lib-2.4-jdk15.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="MumbleJMeter-plugins-1.0-SNAPSHOT.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/MumbleJMeter-plugins-1.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
package com.webank.h5face;
import java.util.ArrayList;
import java.util.Map;
import com.webank.utils.HttpClientUtil;
import com.webank.utils.JsonUtil;
import com.webank.utils.QianMingUitls;
import net.sf.json.JSONObject;
/**
*
* [合作方后台上送身份信息 获取faceId]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月7日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class GetH5FaceId {
final static String orderNo = "orderNo19959248596551";
final static String name = "张三";
final static String idNo = "429006199009157019";
final static String version = "1.0.0";
public static String getH5FaceIdStr(String userId,String apiticket,String webankAppId ) throws Exception{
//设置签名所需要的参数
ArrayList<String> list = new ArrayList<String>();
list.add(webankAppId);
list.add(orderNo);
list.add(name);
list.add(idNo);
list.add(userId);
list.add(version);
//获取签名
System.err.println("第二部执行获取H5FaceID请求的"+"sha1加密工具参数 "+list);
System.out.println();
String getqianming = QianMingUitls.getqianming(list, apiticket);
System.out.println();
System.out.println("获取执行H5FaceID请求的"+"SingTicket "+apiticket);
System.out.println();
System.out.println("获取执行H5FaceID请求的"+getqianming.length()+"位签名为 "+getqianming);
final String Url="https://miniprogram-kyc.tencentcloudapi.com/api/server/h5/geth5faceid";
JSONObject params = new JSONObject();
params.put("webankAppId", webankAppId);
params.put("orderNo", orderNo);
params.put("name", name);
params.put("idNo", idNo);
params.put("userId", userId);
params.put("version", version);
params.put("sign", getqianming);
/* params.put("sourcePhotoStr", sourcePhotoStr);
params.put("sourcePhotoType", sourcePhotoType);*/
HttpClientUtil httpClientUtil = new HttpClientUtil();
String xmlData = httpClientUtil.doPost(Url, params.toString(), "utf-8");
System.out.println("获取H5faceID请求返回值为 "+xmlData);
Map<String,Object> map = JsonUtil.fromJson(xmlData.toString(), Map.class);
Object object=map.get("result");
String json = JsonUtil.toJson(object);
Map fromJson = JsonUtil.fromJson(json, Map.class);
System.err.println("h5faceId为 "+fromJson.get("h5faceId"));
return (String) fromJson.get("h5faceId");
}
}
package com.webank.h5face;
import java.util.ArrayList;
import java.util.List;
import com.webank.one.GetSIGNTicketTest;
import com.webank.one.access_token;
import org.apache.http.Consts;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import com.google.common.collect.Lists;
import com.webank.one.GetNONCETicket;
import com.webank.utils.HttpClientUtil;
import com.webank.utils.InvertCodeGeneratorUitls;
import com.webank.utils.QianMingUitls;
/**
*
* [公众号启动H5刷脸02]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月6日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class Live02 {
final static String appid = "";
final static String secret = "";
final static String version = "1.0.0";
final static String orderNo = "orderNo19959248596551";
final static String userId = "userID19959248596551";
final static String url = "https://www.baidu.com";
final static String resultType = "2";
public static void main(String[] args) throws Exception, Exception{
//设置签名所需要的参数
List<String> codes = InvertCodeGeneratorUitls.genCodes(32, 2);
String code=codes.get(0);
String userId=codes.get(1);
String tokne= access_token.getToken(appid,secret);
String nonceTicket = GetNONCETicket.getNONCETicket(tokne,userId,appid);
ArrayList<String> list = new ArrayList<String>();
list.add(appid);
list.add(version);
list.add(code);
list.add(orderNo);
list.add(userId);
String getqianming = QianMingUitls.getqianming(list, nonceTicket);
System.err.println();
System.err.println("第三步执行H5Login请求的"+"sha1加密工具参数 "+list);
System.out.println();
System.out.println("获取执行H5Login请求的 "+getqianming.length()+"位签名为 "+getqianming);
System.out.println("32位字母加数字随机数 "+code);
System.out.println();
System.out.println("获取执行H5Login请求的"+"NonceTicket为 "+nonceTicket);
System.out.println();
List<NameValuePair> params = Lists.newArrayList();
params.add(new BasicNameValuePair("webankAppId", appid));
params.add(new BasicNameValuePair("version", version));
params.add(new BasicNameValuePair("nonce", code));
params.add(new BasicNameValuePair("orderNo", orderNo));
params.add(new BasicNameValuePair("url", url));
params.add(new BasicNameValuePair("resultType",resultType));
params.add(new BasicNameValuePair("userId", userId));
params.add(new BasicNameValuePair("sign", getqianming));
String str = "";
//转换为键值对
str = EntityUtils.toString(new UrlEncodedFormEntity(params, Consts.UTF_8));
System.out.println(str);
//创建Get请求
final String Url="https://miniprogram-kyc.tencentcloudapi.com/api/wx/livelogin"+"?"+str;
System.out.println(Url);
/* HttpClientUtil httpClientUtil = new HttpClientUtil();
String xmlData = httpClientUtil.sendGetRequest(Url, "utf8");
System.out.println(xmlData);*/
}
}
package com.webank.h5face;
import java.util.ArrayList;
import java.util.List;
import com.webank.one.GetSIGNTicketTest;
import com.webank.one.access_token;
import org.apache.http.Consts;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import com.google.common.collect.Lists;
import com.webank.one.GetNONCETicket;
import com.webank.utils.HttpClientUtil;
import com.webank.utils.InvertCodeGeneratorUitls;
import com.webank.utils.QianMingUitls;
/**
*
* [公众号启动H5刷脸02]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月6日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class WebLogin2 {
final static String appid = "";
final static String secret = "";
final static String version = "1.0.0";
final static String orderNo = "orderNo19959248596551";
final static String url = "https://www.baidu.com";
final static String resultType = "2";
public static void main(String[] args) throws Exception, Exception{
//设置签名所需要的参数
List<String> codes = InvertCodeGeneratorUitls.genCodes(32, 2);
String code=codes.get(0);
String userId=codes.get(1);
String tokne=access_token.getToken(appid,secret);
String signticket=GetSIGNTicketTest.getSignticket(appid,tokne);
String nonceTicket = GetNONCETicket.getNONCETicket(tokne,userId,appid);
String h5FaceIdStr = GetH5FaceId.getH5FaceIdStr(userId,signticket,appid);
ArrayList<String> list = new ArrayList<String>();
list.add(appid);
list.add(version);
list.add(code);
list.add(orderNo);
list.add(h5FaceIdStr);
list.add(userId);
String getqianming = QianMingUitls.getqianming(list, nonceTicket);
System.err.println();
System.err.println("第三步执行H5Login请求的"+"sha1加密工具参数 "+list);
System.out.println();
System.out.println("获取执行H5Login请求的 "+getqianming.length()+"位签名为 "+getqianming);
System.out.println("32位字母加数字随机数 "+code);
System.out.println();
System.out.println("获取执行H5Login请求的"+"NonceTicket为 "+nonceTicket);
System.out.println();
List<NameValuePair> params = Lists.newArrayList();
params.add(new BasicNameValuePair("webankAppId", appid));
params.add(new BasicNameValuePair("version", version));
params.add(new BasicNameValuePair("nonce", code));
params.add(new BasicNameValuePair("orderNo", orderNo));
params.add(new BasicNameValuePair("h5faceId", h5FaceIdStr));
params.add(new BasicNameValuePair("url", url));
params.add(new BasicNameValuePair("resultType",resultType));
params.add(new BasicNameValuePair("userId", userId));
params.add(new BasicNameValuePair("sign", getqianming));
String str = "";
//转换为键值对
str = EntityUtils.toString(new UrlEncodedFormEntity(params, Consts.UTF_8));
System.out.println(str);
//创建Get请求
final String Url="https://miniprogram-kyc.tencentcloudapi.com/api/web/login"+"?"+str;
System.out.println(Url);
/*HttpClientUtil httpClientUtil = new HttpClientUtil();
String xmlData = httpClientUtil.sendGetRequest(Url, "utf8");
System.out.println(xmlData);*/
}
}
package com.webank.h5ocr;
import java.util.ArrayList;
import java.util.List;
import com.webank.one.access_token;
import org.apache.http.Consts;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import com.google.common.collect.Lists;
import com.webank.one.GetNONCETicket;
import com.webank.utils.HttpClientUtil;
import com.webank.utils.InvertCodeGeneratorUitls;
import com.webank.utils.QianMingUitls;
/**
*
* [公众号启动H5刷脸02]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月6日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class H5OcrLogin02 {
final static String appid = "";
final static String secret = "";
final static String version = "1.0.0";
final static String url = "https://www.baidu.com";
final static String ocrFlag = "2";
public static void main(String[] args) throws Exception, Exception{
//设置签名所需要的参数
List<String> codes = InvertCodeGeneratorUitls.genCodes(32, 3);
String code=codes.get(0);
String userId=codes.get(1);
String orderNo = codes.get(2);
String tokne= access_token.getToken(appid,secret);
String nonceTicket = GetNONCETicket.getNONCETicket(tokne,userId,appid);
ArrayList<String> list = new ArrayList<String>();
list.add(appid);
list.add(version);
list.add(code);
list.add(orderNo);
list.add(userId);
String sign = QianMingUitls.getqianming(list, nonceTicket);
System.err.println();
System.err.println("第二步执行h5ocrlogin请求的"+"sha1加密工具参数 "+list);
System.out.println();
System.out.println("获取执行h5ocrlogin请求的 "+sign.length()+"位签名为 "+sign);
System.out.println("32位字母加数字随机数 "+code);
System.out.println();
System.out.println("获取执行h5ocrlogin请求的"+"NonceTicket为 "+nonceTicket);
System.out.println();
/*"https://sit-ida.webank.com/api/h5/ocrlogin?webankAppId="+webankAppId+"&version="+version+"&"
+ "nonce="+nonce+"&orderNo="+orderNo+"&url="+url+"&userId="+userId+"&sign="+sign+"";*/
List<NameValuePair> params = Lists.newArrayList();
params.add(new BasicNameValuePair("webankAppId", appid));
params.add(new BasicNameValuePair("version", version));
params.add(new BasicNameValuePair("nonce", code));
params.add(new BasicNameValuePair("orderNo", orderNo));
params.add(new BasicNameValuePair("url", url));
params.add(new BasicNameValuePair("userId", userId));
params.add(new BasicNameValuePair("sign", sign));
params.add(new BasicNameValuePair("ocrFlag", ocrFlag));
String str = "";
//转换为键值对
str = EntityUtils.toString(new UrlEncodedFormEntity(params, Consts.UTF_8));
System.out.println(str);
//创建Get请求
final String Url="https://miniprogram-kyc.tencentcloudapi.com/api/h5/ocrlogin"+"?"+str;
System.out.println(Url);
/*
HttpClientUtil httpClientUtil = new HttpClientUtil();
String xmlData = httpClientUtil.sendGetRequest(Url, "utf8");*/
}
}
package com.webank.h5result;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import com.webank.one.GetNONCETicket;
import com.webank.one.GetSIGNTicketTest;
import com.webank.one.access_token;
import com.webank.utils.InvertCodeGeneratorUitls;
import com.webank.utils.MyX509TrustManager;
import com.webank.utils.QianMingUitls;
import com.webank.utils.Sha1Uitls;
import com.webank.utils.getUtils;
/**
*
* [人脸识别 服务端查询结果]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月6日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class GetLiveResult {
final static String appid = "";
final static String secret = "";
final static String version = "1.0.0";
final static String orderNo = "1234567890123456789012345678900a";
public static void main(String[] args) throws Exception{
String tokne= access_token.getToken(appid,secret);
String signticket= GetSIGNTicketTest.getSignticket(appid,tokne);
//设置签名所需要的参数
List<String> codes = InvertCodeGeneratorUitls.genCodes(32, 1);
String nonce=codes.get(0);
ArrayList<String> list = new ArrayList<String>();
list.add(appid);
list.add(version);
list.add(nonce);
list.add(orderNo);
String sign = QianMingUitls.getqianming(list, signticket);
System.err.println();
System.err.println("第四步执行刷脸结果请求的"+"sha1加密工具参数 "+list);
System.out.println();
System.out.println("获取执行刷脸结果请求的 "+sign.length()+"位签名为 "+sign);
System.out.println("32位字母加数字随机数 "+nonce);
System.out.println();
System.out.println("获取执行刷脸结果请求的"+"sinTicket为 "+signticket);
System.out.println();
String Url="https://miniprogram-kyc.tencentcloudapi.com/api/server/getLiveResult?app_id="+appid+"&nonce="+nonce+"&order_no="+orderNo+"&version=1.0.0&sign="+sign+"&get_file=1";
//建立连接
StringBuffer stringBuffer = getUtils.get(Url);
System.out.println(stringBuffer);
}
}
package com.webank.h5result;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import com.webank.one.GetNONCETicket;
import com.webank.one.GetSIGNTicketTest;
import com.webank.one.access_token;
import com.webank.utils.InvertCodeGeneratorUitls;
import com.webank.utils.MyX509TrustManager;
import com.webank.utils.QianMingUitls;
import com.webank.utils.Sha1Uitls;
import com.webank.utils.getUtils;
/**
*
* [人脸识别 服务端查询结果]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月6日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class H5FaceResults {
final static String appid = "";
final static String secret = "";
final static String version = "1.0.0";
final static String orderNo = "1234567890123456789012345678900a";
public static void main(String[] args) throws Exception{
String tokne= access_token.getToken(appid,secret);
String signticket= GetSIGNTicketTest.getSignticket(appid,tokne);
//设置签名所需要的参数
List<String> codes = InvertCodeGeneratorUitls.genCodes(32, 1);
String nonce=codes.get(0);
ArrayList<String> list = new ArrayList<String>();
list.add(appid);
list.add(version);
list.add(nonce);
list.add(orderNo);
String sign = QianMingUitls.getqianming(list, signticket);
System.err.println();
System.err.println("第四步执行刷脸结果请求的"+"sha1加密工具参数 "+list);
System.out.println();
System.out.println("获取执行刷脸结果请求的 "+sign.length()+"位签名为 "+sign);
System.out.println("32位字母加数字随机数 "+nonce);
System.out.println();
System.out.println("获取执行刷脸结果请求的"+"sinTicket为 "+signticket);
System.out.println();
String Url="https://miniprogram-kyc.tencentcloudapi.com/api/server/sync?app_id="+appid+"&nonce="+nonce+"&order_no="+orderNo+"&version=1.0.0&sign="+sign+"&get_file=1";
//建立连接
StringBuffer stringBuffer = getUtils.get(Url);
}
}
package com.webank.h5result;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import com.webank.one.GetNONCETicket;
import com.webank.one.GetSIGNTicketTest;
import com.webank.one.access_token;
import com.webank.utils.InvertCodeGeneratorUitls;
import com.webank.utils.MyX509TrustManager;
import com.webank.utils.QianMingUitls;
import com.webank.utils.Sha1Uitls;
/**
*
* [人脸识别 服务端查询结果]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月6日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class OcrResults {
final static String appid = "";
final static String secret = "";
final static String version = "1.0.0";
final static String orderNo = "1234567890123456789012345678900a";
public static void main(String[] args) throws Exception{
String tokne= access_token.getToken(appid,secret);
String signticket= GetSIGNTicketTest.getSignticket(appid,tokne);
//设置签名所需要的参数
List<String> codes = InvertCodeGeneratorUitls.genCodes(32, 1);
String nonce=codes.get(0);
ArrayList<String> list = new ArrayList<String>();
list.add(appid);
list.add(version);
list.add(nonce);
list.add(orderNo);
String sign = QianMingUitls.getqianming(list, signticket);
System.err.println();
System.err.println("第四步执行刷脸结果请求的"+"sha1加密工具参数 "+list);
System.out.println();
System.out.println("获取执行刷脸结果请求的 "+sign.length()+"位签名为 "+sign);
System.out.println("32位字母加数字随机数 "+nonce);
System.out.println();
System.out.println("获取执行刷脸结果请求的"+"sinTicket为 "+signticket);
System.out.println();
String tokenUrl="https://miniprogram-kyc.tencentcloudapi.com/api/server/getOcrResult?app_id="+appid+"&nonce="+nonce+"&order_no="+orderNo+"&version=1.0.0&sign="+sign+"&get_file=1";
//建立连接
URL url = new URL(tokenUrl);
System.out.println("获取请求路径为 "+url);
HttpsURLConnection httpUrlConn = (HttpsURLConnection) url.openConnection();
// 创建SSLContext对象,并使用我们指定的信任管理器初始化
TrustManager[] tm = { new MyX509TrustManager() };
SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
sslContext.init(null, tm, new java.security.SecureRandom());
// 从上述SSLContext对象中得到SSLSocketFactory对象
SSLSocketFactory ssf = sslContext.getSocketFactory();
httpUrlConn.setSSLSocketFactory(ssf);
httpUrlConn.setDoOutput(true);
httpUrlConn.setDoInput(true);
// 设置请求方式(GET/POST)
httpUrlConn.setRequestMethod("GET");
// 取得输入流
InputStream inputStream = httpUrlConn.getInputStream();
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8");
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
//读取响应内容
StringBuffer buffer = new StringBuffer();
String str = null;
while ((str = bufferedReader.readLine()) != null) {
buffer.append(str);
}
bufferedReader.close();
inputStreamReader.close();
// 释放资源
inputStream.close();
httpUrlConn.disconnect();
//输出返回结果
System.out.println(buffer);
}
}
package com.webank.one;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.List;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import com.webank.utils.InvertCodeGeneratorUitls;
import com.webank.utils.JsonUtil;
import com.webank.utils.MyX509TrustManager;
import com.webank.utils.getUtils;
/**
*
* [获取nonceticket]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月7日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class GetNONCETicket {
public static String getNONCETicket(String access_token,String userId,String appid)throws Exception {
//修改appID,secret
String nonceTicketURL="https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/api_ticket?app_id="+appid+"&access_token="+access_token+"&type=NONCE&version=1.0.0&user_id="+userId+"";
StringBuffer stringBuffer = getUtils.get(nonceTicketURL);
System.out.println("第一步:获取nonceTicket请求返回值为 "+stringBuffer);
System.out.println();
Map<String,Object> map = JsonUtil.fromJson(stringBuffer.toString(), Map.class);
List<Object> arr= (List<Object>) map.get("tickets");
String json = JsonUtil.toJson(arr);
String substring = json.substring(1, json.length()-1);
Map fromJson = JsonUtil.fromJson(substring, Map.class);
System.out.println("获得nonceTiclet为 "+fromJson.get("value"));
System.out.println();
return (String) fromJson.get("value");
}
}
\ No newline at end of file
package com.webank.one;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.util.List;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import com.webank.utils.JsonUtil;
import com.webank.utils.MyX509TrustManager;
import com.webank.utils.getUtils;
/**
*
* [获取singleticket]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月7日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class GetSIGNTicketTest {
public static String getSignticket(String appid,String access_token ) throws Exception {
//修改appID,secret
String signticketUrl="https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/api_ticket?app_id="+appid+"&access_token="+access_token+"&type=SIGN&version=1.0.0";
StringBuffer stringBuffer = getUtils.get(signticketUrl);
Map<String,Object> map = JsonUtil.fromJson(stringBuffer.toString(), Map.class);
List<Object> arr= (List<Object>) map.get("tickets");
String json = JsonUtil.toJson(arr);
String substring = json.substring(1, json.length()-1);
Map fromJson = JsonUtil.fromJson(substring, Map.class);
return (String) fromJson.get("value");
}
}
package com.webank.one;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import com.google.gson.Gson;
import com.webank.utils.MyX509TrustManager;
import com.webank.utils.getUtils;
/**
*
* [获取token]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月7日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class access_token {
public static String getToken(String appid,String secret) throws Exception {
String tokenUrl="https://miniprogram-kyc.tencentcloudapi.com/api/oauth2/access_token?app_id="+appid+"&secret="+secret+"&grant_type=client_credential&version=1.0.0";
//建立连接
StringBuffer stringBuffer = getUtils.get(tokenUrl);
Gson gs = new Gson();
Map<String,String> map = gs.fromJson(stringBuffer.toString(), Map.class);
System.out.println(map.get("access_token"));
return map.get("access_token");
}
}
\ No newline at end of file
package com.webank.pass;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.webank.one.GetSIGNTicketTest;
import com.webank.one.access_token;
import com.webank.utils.*;
import net.sf.json.JSONObject;
/**
*
* [ 身份证 R OCR 识别 ]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月7日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class BankCardOcrApp {
final static String appid = "";
final static String secret = "";
final static String version = "1.0.0";
final static String orderNo = "1234567890123456789012345678900a";
public static void main(String[] args) throws Exception{
String tokne= access_token.getToken(appid,secret);
String signticket= GetSIGNTicketTest.getSignticket(appid,tokne);
//方式一 直接传图片路径
String imgbese= Img2Base64Util.getImgStr("d:\\zzz.jpg");
//方式二 传图片url
// String base64ByImgUrl = ImageUtils.image2Base64("");
//设置签名所需要的参数
List<String> codes = InvertCodeGeneratorUitls.genCodes(32, 1);
String nonce=codes.get(0);
ArrayList<String> list = new ArrayList<String>();
list.add(appid);
list.add(orderNo);
list.add(nonce);
list.add(version);
//获取签名
System.err.println("第二部执行获取paas请求的"+"sha1加密工具参数 "+list);
System.out.println();
String getqianming = QianMingUitls.getqianming(list, signticket);
System.out.println();
System.out.println("获取执行paas请求的"+"SingTicket "+signticket);
System.out.println();
System.out.println("获取执行paas请求的"+getqianming.length()+"位签名为 "+getqianming);
final String Url="https://miniprogram-kyc.tencentcloudapi.com/api/paas/bankcardocrapp";
JSONObject params = new JSONObject();
params.put("webankAppId", appid);
params.put("version", version);
params.put("nonce", nonce);
params.put("sign", getqianming);
params.put("orderNo", orderNo);
params.put("cardType", "0");
params.put("bankcardStr", imgbese);
HttpClientUtil httpClientUtil = new HttpClientUtil();
String xmlData = httpClientUtil.doPost(Url, params.toString(), "utf-8");
System.out.println(xmlData);
}
}
package com.webank.pass;
import com.webank.one.GetSIGNTicketTest;
import com.webank.one.access_token;
import com.webank.utils.HttpClientUtil;
import com.webank.utils.Img2Base64Util;
import com.webank.utils.InvertCodeGeneratorUitls;
import com.webank.utils.QianMingUitls;
import net.sf.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
/**
*
* [ 身份证 R OCR 识别 ]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月7日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class PaasIdcardOcrApp {
final static String appid = "";
final static String secret = "";
final static String version = "1.0.0";
final static String orderNo = "1234567890123456789012345678900a";
public static void main(String[] args) throws Exception{
String tokne= access_token.getToken(appid,secret);
String signticket= GetSIGNTicketTest.getSignticket(appid,tokne);
String idcardSt= Img2Base64Util.getImgStr("d:\\zzz.jpg");
//设置签名所需要的参数
List<String> codes = InvertCodeGeneratorUitls.genCodes(32, 1);
String nonce=codes.get(0);
ArrayList<String> list = new ArrayList<String>();
list.add(appid);
list.add(orderNo);
list.add(nonce);
list.add(version);
//获取签名
System.err.println("第二部执行获取paas请求的"+"sha1加密工具参数 "+list);
System.out.println();
String getqianming = QianMingUitls.getqianming(list, signticket);
System.out.println();
System.out.println("获取执行paas请求的"+"SingTicket "+signticket);
System.out.println();
System.out.println("获取执行paas请求的"+getqianming.length()+"位签名为 "+getqianming);
final String Url="https://miniprogram-kyc.tencentcloudapi.com/api/paas/idcardocrapp";
JSONObject params = new JSONObject();
params.put("webankAppId", appid);
params.put("version", version);
params.put("nonce", nonce);
params.put("sign", getqianming);
params.put("orderNo", orderNo);
params.put("cardType", "0");
params.put("idcardStr", idcardSt);
HttpClientUtil httpClientUtil = new HttpClientUtil();
String xmlData = httpClientUtil.doPost(Url, params.toString(), "utf-8");
System.out.println(xmlData);
}
}
package com.webank.pass;
import com.webank.one.GetSIGNTicketTest;
import com.webank.one.access_token;
import com.webank.utils.HttpClientUtil;
import com.webank.utils.Img2Base64Util;
import com.webank.utils.InvertCodeGeneratorUitls;
import com.webank.utils.QianMingUitls;
import net.sf.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
/**
*
* [人脸比对( 照片 S VS 照片]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月7日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class PassEasyCompare {
final static String appid = "";
final static String secret = "";
final static String version = "1.0.0";
final static String orderNo = "1234567890123456789012345678900a";
final static String name = "张三";
final static String idNo= "1234567890123456789012345678900a";
final static String userId= "1234567890123456789a";
public static void main(String[] args) throws Exception{
String tokne= access_token.getToken(appid,secret);
String signticket= GetSIGNTicketTest.getSignticket(appid,tokne);
String photoStr =Img2Base64Util.getImgStr("d:\\zzz.jpg");
String sourcePhotoStr =Img2Base64Util.getImgStr("d:\\zzz.jpg");
//设置签名所需要的参数
List<String> codes = InvertCodeGeneratorUitls.genCodes(32, 1);
String nonce=codes.get(0);
ArrayList<String> list = new ArrayList<String>();
list.add(appid);
list.add(orderNo);
list.add(nonce);
list.add(version);
//获取签名
System.err.println("第二部执行获取paas请求的"+"sha1加密工具参数 "+list);
System.out.println();
String getqianming = QianMingUitls.getqianming(list, signticket);
System.out.println();
System.out.println("获取执行paas请求的"+"SingTicket "+signticket);
System.out.println();
System.out.println("获取执行paas请求的"+getqianming.length()+"位签名为 "+getqianming);
final String Url="https://miniprogram-kyc.tencentcloudapi.com/api/paas/easycompare";
JSONObject params = new JSONObject();
params.put("webankAppId", appid);
params.put("orderNo", orderNo);
params.put("name", name);
params.put("idNo", idNo);
params.put("userId", userId);
params.put("version", version);
params.put("sign", getqianming);
params.put("nonce", nonce);
params.put("photoStr", photoStr);
params.put("sourcePhotoStr", sourcePhotoStr);
params.put("sourcePhotoType", "1");
HttpClientUtil httpClientUtil = new HttpClientUtil();
String xmlData = httpClientUtil.doPost(Url, params.toString(), "utf-8");
System.out.println(xmlData);
}
}
package com.webank.pass;
import com.webank.one.GetSIGNTicketTest;
import com.webank.one.access_token;
import com.webank.utils.HttpClientUtil;
import com.webank.utils.Img2Base64Util;
import com.webank.utils.InvertCodeGeneratorUitls;
import com.webank.utils.QianMingUitls;
import net.sf.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
/**
*
* [人脸比对(照片+ + 身份信息模式 )]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月7日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class PassEasyface {
final static String appid = "";
final static String secret = "";
final static String version = "1.0.0";
final static String orderNo = "1234567890123456789012345678900a";
final static String name = "张三";
final static String idNo= "1234567890123456789012345678900a";
final static String userId= "1234567890123456789a";
public static void main(String[] args) throws Exception{
String tokne= access_token.getToken(appid,secret);
String signticket= GetSIGNTicketTest.getSignticket(appid,tokne);
String photoStr =Img2Base64Util.getImgStr("d:\\zzz.jpg");
//设置签名所需要的参数
List<String> codes = InvertCodeGeneratorUitls.genCodes(32, 1);
String nonce=codes.get(0);
ArrayList<String> list = new ArrayList<String>();
list.add(appid);
list.add(orderNo);
list.add(nonce);
list.add(version);
//获取签名
System.err.println("第二部执行获取paas请求的"+"sha1加密工具参数 "+list);
System.out.println();
String getqianming = QianMingUitls.getqianming(list, signticket);
System.out.println();
System.out.println("获取执行paas请求的"+"SingTicket "+signticket);
System.out.println();
System.out.println("获取执行paas请求的"+getqianming.length()+"位签名为 "+getqianming);
final String Url="https://miniprogram-kyc.tencentcloudapi.com/api/paas/easyface";
JSONObject params = new JSONObject();
params.put("webankAppId", appid);
params.put("orderNo", orderNo);
params.put("name", name);
params.put("idNo", idNo);
params.put("version", version);
params.put("sign", getqianming);
params.put("nonce", nonce);
params.put("photoStr", photoStr);
HttpClientUtil httpClientUtil = new HttpClientUtil();
String xmlData = httpClientUtil.doPost(Url, params.toString(), "utf-8");
System.out.println(xmlData);
}
}
package com.webank.utils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.imageio.stream.FileImageInputStream;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
class Base64Util{
/**
* 字符串转图片
* @param base64Str
* @return
*/
public static byte[] decode(String base64Str){
byte[] b = null;
BASE64Decoder decoder = new BASE64Decoder();
try {
b = decoder.decodeBuffer(replaceEnter(base64Str));
} catch (IOException e) {
e.printStackTrace();
}
return b;
}
/**
* 图片转字符串
* @param image
* @return
*/
public static String encode(byte[] image){
BASE64Encoder decoder = new BASE64Encoder();
return replaceEnter(decoder.encode(image));
}
public static String encode(String uri){
BASE64Encoder encoder = new BASE64Encoder();
return replaceEnter(encoder.encode(uri.getBytes()));
}
/**
*
* @path 图片路径
* @return
*/
public static byte[] imageTobyte(String path){
byte[] data = null;
FileImageInputStream input = null;
try {
input = new FileImageInputStream(new File(path));
ByteArrayOutputStream output = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int numBytesRead = 0;
while((numBytesRead = input.read(buf)) != -1){
output.write(buf, 0, numBytesRead);
}
data = output.toByteArray();
output.close();
input.close();
} catch (Exception e) {
e.printStackTrace();
}
return data;
}
public static String replaceEnter(String str){
String reg ="[\n-\r]";
Pattern p = Pattern.compile(reg);
Matcher m = p.matcher(str);
return m.replaceAll("");
}
}
\ No newline at end of file
package com.webank.utils;
import java.io.IOException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
/**
* Created by IntelliJ IDEA.
* User: hyj
* Date: 2017/8/24
* Time: 10:24
* email: hyj18216353675@sina,com
*/
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.conn.ssl.X509HostnameVerifier;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
/*
* 利用HttpClient进行post请求的工具类
*/
public class HttpClientUtil {
public String doPost(String url,String xmlParam,String charset){
HttpClient httpClient = null;
HttpPost httpPost = null;
String result = null;
try{
httpClient = new SSLClientUtil();
httpPost = new HttpPost(url);
httpPost.addHeader("Content-Type", "application/json; charset=utf-8");
httpPost.setEntity(new StringEntity(xmlParam, HTTP.UTF_8));
HttpResponse response = httpClient.execute(httpPost);
if(response != null){
HttpEntity resEntity = response.getEntity();
if(resEntity != null){
result = EntityUtils.toString(resEntity,charset);
}
}
}catch(Exception ex){
ex.printStackTrace();
}
return result;
}
public static String sendGetRequest(String reqURL, String decodeCharset){
long responseLength = 0; //响应长度
String responseContent = null; //响应内容
HttpClient httpClient = new DefaultHttpClient(); //创建默认的httpClient实例
HttpGet httpGet = new HttpGet(reqURL); //创建org.apache.http.client.methods.HttpGet
try{
HttpResponse response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity(); //获取响应实体
// if(null != entity){
responseLength = entity.getContentLength();
responseContent = EntityUtils.toString(entity, decodeCharset==null ? "UTF-8" : decodeCharset);
// }
System.out.println("请求地址: " + httpGet.getURI());
System.out.println("响应状态: " + response.getStatusLine());
System.out.println("响应长度: " + responseLength);
System.out.println("响应内容: " + responseContent);
}catch(Exception e){
}
return responseContent;
}
public static final String sendHttpsRequestByPost(String url, Map<String, String> params) {
String responseContent = null;
HttpClient httpClient = new DefaultHttpClient();
//创建TrustManager
X509TrustManager xtm = new X509TrustManager() {
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
public X509Certificate[] getAcceptedIssuers() {
return null;
}
};
//这个好像是HOST验证
X509HostnameVerifier hostnameVerifier = new X509HostnameVerifier() {
public boolean verify(String arg0, SSLSession arg1) {
return true;
}
public void verify(String arg0, SSLSocket arg1) throws IOException {}
public void verify(String arg0, String[] arg1, String[] arg2) throws SSLException {}
public void verify(String arg0, X509Certificate arg1) throws SSLException {}
};
try {
//TLS1.0与SSL3.0基本上没有太大的差别,可粗略理解为TLS是SSL的继承者,但它们使用的是相同的SSLContext
SSLContext ctx = SSLContext.getInstance("TLS");
//使用TrustManager来初始化该上下文,TrustManager只是被SSL的Socket所使用
ctx.init(null, new TrustManager[] { xtm }, null);
//创建SSLSocketFactory
SSLSocketFactory socketFactory = new SSLSocketFactory(ctx);
socketFactory.setHostnameVerifier(hostnameVerifier);
//通过SchemeRegistry将SSLSocketFactory注册到我们的HttpClient上
httpClient.getConnectionManager().getSchemeRegistry().register(new Scheme("https", socketFactory, 443));
HttpPost httpPost = new HttpPost(url);
List<NameValuePair> formParams = new ArrayList<NameValuePair>(); // 构建POST请求的表单参数
for (Map.Entry<String, String> entry : params.entrySet()) {
formParams.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
}
httpPost.setEntity(new UrlEncodedFormEntity(formParams, "UTF-8"));
HttpResponse response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity(); // 获取响应实体
if (entity != null) {
responseContent = EntityUtils.toString(entity, "UTF-8");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
// 关闭连接,释放资源
httpClient.getConnectionManager().shutdown();
}
return responseContent;
}
}
\ No newline at end of file
package com.webank.utils;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class ImageUtils {
/*
* 通过图片的url获取图片的base64字符串
*
* @param imgUrl 图片url
*
* @return 返回图片base64的字符串
*/
public static String image2Base64(String imgUrl) {
URL url = null;
InputStream is = null;
ByteArrayOutputStream outStream = null;
HttpURLConnection httpUrl = null;
try {
url = new URL(imgUrl);
httpUrl = (HttpURLConnection) url.openConnection();
httpUrl.connect();
httpUrl.getInputStream();
is = httpUrl.getInputStream();
outStream = new ByteArrayOutputStream();
// 创建一个Buffer字符串
byte[] buffer = new byte[1024];
// 每次读取的字符串长度,如果为-1,代表全部读取完毕
int len = 0;
// 使用一个输入流从buffer里把数据读取出来
while ((len = is.read(buffer)) != -1) {
// 用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度
outStream.write(buffer, 0, len);
}
// 对字节数组Base64编码
return Base64Util.encode(outStream.toByteArray());
} catch (Exception e) {
e.printStackTrace();
}
finally {
if (is != null)
{
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (outStream != null)
{
try {
outStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (httpUrl != null)
{
httpUrl.disconnect();
}
}
return imgUrl;
}
}
\ No newline at end of file
package com.webank.utils;
import org.apache.commons.codec.binary.Base64;
import java.io.*;
/**
* 将图片转换为Base64<br>
* 将base64编码字符串解码成img图片
* @创建时间 2015-06-01 15:50
*
*/
public class Img2Base64Util {
public static void main(String[] args) throws Exception {
String base = Test4.base();
// FileWriter writer=new FileWriter("e:\\Foo.txt");//如果不存在就会被创建
// generateImage(base,"e:\\000.jpg");
// String imgFile = "e:\\b.png";//待处理的图片
// String imgbese=getImgStr(imgFile);
// writer.write(imgbese);//以字符串作为参数
// writer.close();
//
// System.out.println(imgbese.length());
// System.out.println(imgbese);
/*
String imgFilePath = "d:\\332.jpg";//新生成的图片
generateImage(imgbese,imgFilePath);*/
}
/**
* 将图片转换成Base64编码
* @param imgFile 待处理图片
* @return
*/
public static String getImgStr(String imgFile){
//将图片文件转化为字节数组字符串,并对其进行Base64编码处理
InputStream in = null;
byte[] data = null;
//读取图片字节数组
try
{
in = new FileInputStream(imgFile);
data = new byte[in.available()];
in.read(data);
in.close();
}
catch (IOException e)
{
e.printStackTrace();
}
return new String(Base64.encodeBase64(data));
}
/**
* 对字节数组字符串进行Base64解码并生成图片
* @param imgStr 图片数据
* @param imgFilePath 保存图片全路径地址
* @return
*/
public static boolean generateImage(String imgStr,String imgFilePath){
//
if (imgStr == null) //图像数据为空
{
return false;
}
try
{
//Base64解码
byte[] b = Base64.decodeBase64(imgStr);
for(int i=0;i<b.length;++i)
{
if(b[i]<0)
{//调整异常数据
b[i]+=256;
}
}
//生成jpeg图片
OutputStream out = new FileOutputStream(imgFilePath);
out.write(b);
out.flush();
out.close();
return true;
}
catch (Exception e)
{
return false;
}
}
}
\ No newline at end of file
package com.webank.utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
*
* [32位字母加数字工具类]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月8日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class InvertCodeGeneratorUitls{
/*public static void main(String[] args) {
// TODO Auto-generated method stub
List<String> results=genCodes(32,1);
for (int i = 0; i < results.size(); i++) {
System.out.println(results.get(i));
}
}*/
public static List<String> genCodes(int length,long num){
List<String> results=new ArrayList<String>();
for(int j=0;j<num;j++){
String val = "";
Random random = new Random();
for(int i = 0; i < length; i++)
{
String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num"; // 输出字母还是数字
if("char".equalsIgnoreCase(charOrNum)) // 字符串
{
int choice = random.nextInt(2) % 2 == 0 ? 65 : 97; //取得大写字母还是小写字母
val += (char) (choice + random.nextInt(26));
}
else if("num".equalsIgnoreCase(charOrNum)) // 数字
{
val += String.valueOf(random.nextInt(10));
}
}
val=val.toLowerCase();
if(results.contains(val)){
continue;
}else{
results.add(val);
}
}
return results;
}
}
\ No newline at end of file
package com.webank.utils;
import java.lang.reflect.Type;
import com.google.gson.Gson;
/**
* Java对象和JSON字符串相互转化工具类
* @author penghuaiyi
* @date 2013-08-10
*/
public final class JsonUtil {
public JsonUtil(){}
/**
* 对象转换成json字符串
* @param obj
* @return
*/
public static String toJson(Object obj) {
Gson gson = new Gson();
return gson.toJson(obj);
}
/**
* json字符串转成对象
* @param str
* @param type
* @return
*/
public static <T> T fromJson(String str, Type type) {
Gson gson = new Gson();
return gson.fromJson(str, type);
}
/**
* json字符串转成对象
* @param str
* @param type
* @return
*/
public static <T> T fromJson(String str, Class<T> type) {
Gson gson = new Gson();
return gson.fromJson(str, type);
}
}
\ No newline at end of file
package com.webank.utils;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.X509TrustManager;
/**
* Created by Administrator on 2017/11/3.
*/
public class MyX509TrustManager implements X509TrustManager {
// 检查客户端证书
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
// 检查服务器端证书
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
// 返回受信任的X509证书数组
public X509Certificate[] getAcceptedIssuers() {
return null;
}
}
package com.webank.utils;
import java.util.List;
public class QianMingUitls {
public static String getqianming(List<String> list,String apiticket) throws Exception{
String string = Sha1Uitls.sign(list, apiticket);
return string;
}
}
package com.webank.utils;
/**
* Created by IntelliJ IDEA.
* User: hyj
* Date: 2017/8/24
* Time: 10:21
* email: hyj18216353675@sina,com
*/
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.impl.client.DefaultHttpClient;
//用于进行Https请求的HttpClient
public class SSLClientUtil extends DefaultHttpClient{
public SSLClientUtil() throws Exception{
super();
SSLContext ctx = SSLContext.getInstance("TLS");
X509TrustManager tm = new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] chain,
String authType) throws CertificateException {
}
@Override
public void checkServerTrusted(X509Certificate[] chain,
String authType) throws CertificateException {
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
};
ctx.init(null, new TrustManager[]{tm}, null);
SSLSocketFactory ssf = new SSLSocketFactory(ctx,SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
ClientConnectionManager ccm = this.getConnectionManager();
SchemeRegistry sr = ccm.getSchemeRegistry();
sr.register(new Scheme("https", 443, ssf));
}
}
\ No newline at end of file
package com.webank.utils;
public class SetEvidence {
}
package com.webank.utils;
import java.util.Collections;
import java.util.List;
import com.google.common.base.Charsets;
import com.google.common.hash.Hashing;
/**
*
* [sha1加密排序工具类]
* [功能详细描述]
*
* @author fwq
* @version [v1.0, 2017年11月8日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class Sha1Uitls {
public static String sign(List<String> values, String ticket) {
if (values == null) {
throw new NullPointerException("values is null");
}
values.removeAll(Collections.singleton(null));// remove null
values.add(ticket);
java.util.Collections.sort(values);
StringBuilder sb = new StringBuilder();
for (String s : values) {
sb.append(s);
}
System.out.println("排序后的值是"+sb);
return Hashing.sha1().hashString(sb, Charsets.UTF_8).toString().toUpperCase();
}
}
package com.webank.utils;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class Test64Bit {
public static void main(String[] args) {
// 测试从Base64编码转换为图片文件
String getImageStr = GetImageStr("C:\\Users\\v_wbwqfu\\Desktop\\abc.jpg");
String strImg = getImageStr;
System.out.println(strImg);
GenerateImage(strImg, "C:\\a.jpg");
// 测试从图片文件转换为Base64编码
// System.out.println(GetImageStr("http://upload.wikimedia.org/wikipedia/commons/4/4a/Logo_2013_Google.png"));
}
public static String GetImageStr(String imgFilePath) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
byte[] data = null;
// 读取图片字节数组
try {
InputStream in = new FileInputStream(imgFilePath);
data = new byte[in.available()];
in.read(data);
in.close();
} catch (IOException e) {
e.printStackTrace();
}
// 对字节数组Base64编码
BASE64Encoder encoder = new BASE64Encoder();
return encoder.encode(data);// 返回Base64编码过的字节数组字符串
}
public static boolean GenerateImage(String imgStr, String imgFilePath) {// 对字节数组字符串进行Base64解码并生成图片
if (imgStr == null) // 图像数据为空
return false;
BASE64Decoder decoder = new BASE64Decoder();
try {
// Base64解码
byte[] bytes = decoder.decodeBuffer(imgStr);
for (int i = 0; i < bytes.length; ++i) {
if (bytes[i] < 0) {// 调整异常数据
bytes[i] += 256;
}
}
// 生成jpeg图片
OutputStream out = new FileOutputStream(imgFilePath);
out.write(bytes);
out.flush();
out.close();
return true;
} catch (Exception e) {
return false;
}
}
}
\ No newline at end of file
package com.webank.utils;
import java.net.MalformedURLException;
import com.google.common.base.Charsets;
import com.google.common.hash.Hashing;
/**
* 验证字典排序后的签名
* @author Administrator
*
*/
public class ValidateDictionaryUtils {
public static void main(String[] args) throws MalformedURLException {
String sb="1.0.0308af2a75c3e43ec9d0eeeae7955f34b43000000000005s6U3Iha29cQZobQDsffNyKgbJaznOk248YDGDZziUAa3cZkT9jGbZLfeENLoNhJTIDAnB04f5cb399a12af41fb9706c8bb48da9477testName";
System.out.println(Hashing.sha1().hashString(sb, Charsets.UTF_8).toString().toUpperCase());
}
}
package com.webank.utils;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
/**
* 验证签名的工具
* 只需传入参数即可
* @author Administrator
*
*/
public class ValidateSignUtils {
public static void main(String[] args) throws MalformedURLException {
/**
webankAppId= appId001 orderNo= orderNo19959248596551 name= testName idNo= 4300000000000
userId= userID19959248596551 version = 1.0.0
ticket= duSz9ptwyW1Xn7r6gYItxz3feMdJ8Na5x7JZuoxurE7RcI5TdwCE4KT2eEeNNDoe
)
*/
List<String> values=new ArrayList<>();
values.add("TIDASSwy");
values.add("orderNo19959248596551" );
String sign = Sha1Uitls.sign(values, "6G10O7v5U5TMQMqCY8YfS3eyCK981yTFSwxCZtxsPFopC8sxIRobWiM5OhTkYIzk");
System.out.println("参加签名的参数有:"+values);
System.out.println("生成的签名是"+sign);
}
}
package com.webank.utils;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
/**
* 楠岃瘉绛惧悕鐨勫伐鍏�
* 鍙渶浼犲叆鍙傛暟鍗冲彲
* @author Administrator
*
*/
public class ValidateSignUtils2 {
public static void main(String[] args) throws MalformedURLException {
/*
: ["IDAKux3h","911","52014832029547845621032584562012","1.0.0"]
*/
List<String> values=new ArrayList<>();
values.add("IDAKux3h" );
values.add("911");
values.add("1.0.0");
values.add("52014832029547845621032584562012");
String sign = Sha1Uitls.sign(values, "1iDsSvB5WvlxUG7ItRNcJJm0lX34ffR1o57UNQqfnzMYfvOMvYZFEvE07URt6Elr");
System.out.println(":"+values);
System.out.println(sign);
}
}
package com.webank.utils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
public class getUtils {
public static StringBuffer get(String url) throws Exception{
URL url2 = new URL(url);
System.out.println(url);
HttpsURLConnection httpUrlConn = (HttpsURLConnection) url2.openConnection();
// 创建SSLContext对象,并使用我们指定的信任管理器初始化
TrustManager[] tm = { new MyX509TrustManager() };
SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
sslContext.init(null, tm, new java.security.SecureRandom());
// 从上述SSLContext对象中得到SSLSocketFactory对象
SSLSocketFactory ssf = sslContext.getSocketFactory();
httpUrlConn.setSSLSocketFactory(ssf);
httpUrlConn.setDoOutput(true);
httpUrlConn.setDoInput(true);
// 设置请求方式(GET/POST)
httpUrlConn.setRequestMethod("GET");
// 取得输入流
InputStream inputStream = httpUrlConn.getInputStream();
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8");
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
//读取响应内容
StringBuffer buffer = new StringBuffer();
String str = null;
while ((str = bufferedReader.readLine()) != null) {
buffer.append(str);
}
bufferedReader.close();
inputStreamReader.close();
// 释放资源
inputStream.close();
httpUrlConn.disconnect();
//输出返回结果
System.out.println(buffer);
return buffer;
}
}
package com.webank.utils;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.Writer;
import javax.xml.bind.DatatypeConverter;
public class ggg {
public static String base64(String hhh){
String filePath = "D:\\imgfile.txt"; //保存Base64用的文件
String imgPath = hhh; //图片文件
String encoder = null; //图片文件
File imgFile = new File(imgPath);
BufferedImage bi;
File base64File = new File(filePath);
InputStream instream;
try {
base64File.createNewFile();
instream = new FileInputStream(imgFile);
byte[] bytes = new byte[instream.available()];//baos.toByteArray();
instream.read(bytes);
instream.close();
Writer outWriter = new FileWriter(base64File);
encoder = DatatypeConverter.printBase64Binary(bytes); //获得Base64编码字符串
return encoder;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return encoder;
}
}
该demo是一个简单接入demo ,相关接口类输入appid和secret, 运行main方法就可以运行,
该demo是一个简单接入demo ,相关接口类输入appid和secret, 运行main方法就可以运行,
demo里面token和signtiket每一次都重新获取了一次(注意:如果该appid是在线上环境,
慎重运行main方法,否则会导致线上的token和signticekt失效导致线上服务异常,由于tokne和signticket只能使用最新的,
demo里面可以直接使用线上获取的token和signticket),由于token和signticket具有有效期.
客户集成时,需要按照文档做定时20分钟刷新机制,每20分钟只刷新一次token和signticket.
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!