MaxKey 4 роки тому
батько
коміт
274f7c2df0
39 змінених файлів з 1 додано та 2072 видалено
  1. 0 65
      maxkey-common/src/test/java/org/maxkey/persistence/derby/DerbyTest.java
  2. 0 166
      maxkey-core/src/test/java/org/maxkey/Copyright.java
  3. 0 10
      maxkey-core/src/test/java/org/maxkey/CopyrightC.java
  4. 0 54
      maxkey-core/src/test/java/org/maxkey/cache/CacheFactoryTest.java
  5. 0 73
      maxkey-core/src/test/java/org/maxkey/cache/RandomCache.java
  6. 0 16
      maxkey-core/src/test/java/org/maxkey/copyright.txt
  7. 0 49
      maxkey-core/src/test/java/org/maxkey/crypto/Base64UtilsTest.java
  8. 0 59
      maxkey-core/src/test/java/org/maxkey/crypto/DigestUtilsTest.java
  9. 0 63
      maxkey-core/src/test/java/org/maxkey/crypto/KeyGen.java
  10. 0 42
      maxkey-core/src/test/java/org/maxkey/crypto/Md5SumTest.java
  11. 0 40
      maxkey-core/src/test/java/org/maxkey/crypto/PasswordGenTest.java
  12. 0 53
      maxkey-core/src/test/java/org/maxkey/crypto/RSAUtilsTest.java
  13. 0 70
      maxkey-core/src/test/java/org/maxkey/crypto/ReciprocalUtilsTest.java
  14. 0 168
      maxkey-core/src/test/java/org/maxkey/crypto/RsaMessage.java
  15. 0 38
      maxkey-core/src/test/java/org/maxkey/crypto/SCryptPasswordEncoderTest.java
  16. 0 104
      maxkey-core/src/test/java/org/maxkey/crypto/cert/X509CertUtilsTest.java
  17. 0 59
      maxkey-core/src/test/java/org/maxkey/crypto/cert/X509V3CertGenTest.java
  18. 0 48
      maxkey-core/src/test/java/org/maxkey/crypto/password/PasswordPolicyValidatorTest.java
  19. 0 38
      maxkey-core/src/test/java/org/maxkey/crypto/password/PasswordReciprocalTest.java
  20. 0 31
      maxkey-core/src/test/java/org/maxkey/crypto/password/SM3PasswordEncoderTest.java
  21. 0 52
      maxkey-core/src/test/java/org/maxkey/crypto/signature/DsaSignerTest.java
  22. 0 53
      maxkey-core/src/test/java/org/maxkey/crypto/signature/RsaSignerTest.java
  23. 0 41
      maxkey-core/src/test/java/org/maxkey/json/util/JsonUtilsTest.java
  24. 0 47
      maxkey-core/src/test/java/org/maxkey/mail/MailTest.java
  25. 0 112
      maxkey-core/src/test/java/org/maxkey/otp/algorithm/RQcodeTest.java
  26. 0 32
      maxkey-core/src/test/java/org/maxkey/rest/AuthorizationHeaderTest.java
  27. 0 79
      maxkey-core/src/test/java/org/maxkey/util/DateUtilsTest.java
  28. 0 29
      maxkey-core/src/test/java/org/maxkey/util/EthernetAddressTest.java
  29. 0 33
      maxkey-core/src/test/java/org/maxkey/util/IdSequenceTest.java
  30. 0 29
      maxkey-core/src/test/java/org/maxkey/util/MacAddressTest.java
  31. 0 42
      maxkey-core/src/test/java/org/maxkey/util/ObjectTransformerTest.java
  32. 0 30
      maxkey-core/src/test/java/org/maxkey/util/PathUtilsTest.java
  33. 0 35
      maxkey-core/src/test/java/org/maxkey/util/SqlPrettyTest.java
  34. 0 40
      maxkey-core/src/test/java/org/maxkey/util/StringGeneratorTest.java
  35. 0 59
      maxkey-core/src/test/java/org/maxkey/util/UUIDGeneratorTest.java
  36. 0 48
      maxkey-core/src/test/java/org/maxkey/util/XMLHelperTest.java
  37. 0 33
      maxkey-core/src/test/java/org/maxkey/word/CharacterCase.java
  38. 0 31
      maxkey-core/src/test/java/org/maxkey/word/SubStr.java
  39. 1 1
      maxkey-web-maxkey/src/main/resources/templates/views/layout/footer.ftl

+ 0 - 65
maxkey-common/src/test/java/org/maxkey/persistence/derby/DerbyTest.java

@@ -1,65 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.persistence.derby;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-
-public class DerbyTest {
-/**
- * 1.
- * first SET JAVA_HOME,DERBY_HOME,PATH
- * set PATH=%DERBY_HOME%\bin;%PATH%
- * 2.
- * startNetworkServer Start Derby Database
- * 3.
- * create db seconddb1 , user is tquist
- * CONNECT 'jdbc:derby://localhost:1527/seconddb1;create=true;user=tquist';
- * 4.
- * Configuring NATIVE authentication
- * call SYSCS_UTIL.SYSCS_CREATE_USER( 'tquist', 'tquist' );
- * 5.
- * then restart derby database
- */
-	/**
-	 * @param args
-	 * @throws SQLException 
-	 */
-	public static void main(String[] args) throws SQLException {
-		// TODO Auto-generated method stub
-		String nsURL="jdbc:derby://localhost:1527/seconddb1";  
-		java.util.Properties props = new java.util.Properties();
-		props.setProperty("user","tquist");
-		props.setProperty("password","tquist");
-
-		Connection conn = DriverManager.getConnection(nsURL, props);
-
-		/*interact with Derby*/
-		Statement s = conn.createStatement();
-
-		ResultSet rs = s.executeQuery("SELECT * FROM SECONDTABLE");
-		
-		while(rs.next()){
-			System.out.println("key : "+rs.getInt("ID")+" ,name : "+rs.getString("NAME"));
-		}
-	}
-
-}

+ 0 - 166
maxkey-core/src/test/java/org/maxkey/Copyright.java

@@ -1,166 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top ]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.maxkey;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
- 
-/**
- * 给java文件批量添加License信息.
- * @author MaxKey Copyright Adder
- *
- */
-public class Copyright {   
-    // 存放java文件的文件夹,必须是文件夹
-    private static String srcFolder = "C:\\IDES\\shimi\\eclipse-workspace\\MaxKey";
-    //已添加标识
-    private static String copyRightText = "http://www.apache.org/licenses/LICENSE-2.0";
-    //扫描目录
-    private String folder;
-    //版权信息
-    private String copyRight;
-    //待添加所以文件统计
-    private long fileCount = 0;
-    //添加的问题就统计
-    private long copyRightFileCount = 0;
-    private static String lineSeperator = System.getProperty("line.separator");
-    private static String encode = "UTF-8";
-    
-    /**
-     * Copyright.
-     * @param folder java文件夹.
-     * @param copyRight 版权内容.
-     */
-    public Copyright(String folder, String copyRight) {
-        this.folder = folder;
-        this.copyRight = copyRight;
-    }
-    
-    /**
-     * main .
-     * @param args String
-     * @throws IOException  IOException
-     */
-    public static void main(String[] args) throws IOException {
-        // 从文件读取版权内容
-        // 在D盘创建一个copyright.txt文件,把版权内容放进去即可
-        String copyright = readCopyrightFromFile(
-                Copyright.class.getResource("copyright.txt").getFile());        
-        new Copyright(srcFolder, copyright).process();
-        
-       
-    }
-    
-    /**
-     * process.
-     * @throws IOException not
-     */
-    public void process() throws IOException {
-        this.addCopyright(new File(folder));
-        System.out.println("fileCount " + fileCount);
-        System.out.println("copyRightFileCount " + copyRightFileCount);
-    }
- 
-    private void addCopyright(File folder) throws IOException {
-        File[] files = folder.listFiles();
- 
-        if (files == null || files.length == 0) {
-            return;
-        }
- 
-        for (File f : files) {
-            if (f.isFile()) {
-                doAddCopyright(f);
-            } else {
-                addCopyright(f);
-            }
-        }
-    }
- 
-    private void doAddCopyright(File file) throws IOException {
-        String fileName = file.getName();
-        boolean isJavaFile = fileName.toLowerCase().endsWith(".java");
-        this.fileCount++;
-        if (isJavaFile && !isAddCopyrightFile(file.getAbsolutePath())) {
-            copyRightFileCount++;
-            System.out.println(file.getAbsolutePath());
-            try {
-                this.doWrite(file);
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-    
-    private void doWrite(File file) throws IOException {
-        StringBuilder javaFileContent = new StringBuilder();
-        String line = null;
-        // 先添加copyright到文件头
-        javaFileContent.append(copyRight).append(lineSeperator);
-        // 追加剩余内容
-        BufferedReader br = new BufferedReader(
-                new InputStreamReader(new FileInputStream(file), encode));
-        while ((line = br.readLine()) != null) {
-            javaFileContent.append(line).append(lineSeperator);
-        }  
-        
-        OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(file), encode);
-        writer.write(javaFileContent.toString());
-        writer.close();
-        br.close();  
-    }
-    
-    private static String readCopyrightFromFile(String copyFilePath) throws IOException {
-        StringBuilder copyright = new StringBuilder();
-        
-        String line = null;
-        
-        BufferedReader br = new BufferedReader(
-                new InputStreamReader(new FileInputStream(copyFilePath), encode));
-       
-        while ((line = br.readLine()) != null) {
-            copyright.append(line).append(lineSeperator);
-        }
-        br.close();
-        
-        return copyright.toString();
-    }
-    
-    private static boolean isAddCopyrightFile(String filePath) throws IOException {
-        boolean isAddCopyright = false;
-        String line = null;
-        
-        BufferedReader br = new BufferedReader(
-                new InputStreamReader(new FileInputStream(filePath), encode));
-       
-        while ((line = br.readLine()) != null) {
-            if (line.indexOf(copyRightText) > -1) {
-                isAddCopyright = true;
-                break;
-            }
-        }
-        br.close();
-        
-        return isAddCopyright;
-    }
- 
-}

+ 0 - 10
maxkey-core/src/test/java/org/maxkey/CopyrightC.java

@@ -1,10 +0,0 @@
-package org.maxkey;
-
-public class CopyrightC {
-
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-		System.out.println(Character.toString(0xA9));
-	}
-
-}

+ 0 - 54
maxkey-core/src/test/java/org/maxkey/cache/CacheFactoryTest.java

@@ -1,54 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-/**
- * 
- */
-package org.maxkey.cache;
-
-import java.util.ArrayList;
-
-import org.maxkey.cache.AbstractCache;
-import org.maxkey.cache.CacheFactory;
-
-/**
- * @author amarsoft
- *
- */
-public class CacheFactoryTest {
-
-	/**
-	 * 
-	 */
-	public CacheFactoryTest() {
-		// TODO Auto-generated constructor stub
-	}
-
-	/**
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-		RandomCache randomCache=new RandomCache();
-		ArrayList<AbstractCache> cacheList=new ArrayList<AbstractCache>();
-		cacheList.add(randomCache);
-		CacheFactory cacheFactory=new CacheFactory();
-		cacheFactory.setCache(cacheList);
-		cacheFactory.start();
-	}
-
-}

+ 0 - 73
maxkey-core/src/test/java/org/maxkey/cache/RandomCache.java

@@ -1,73 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-/**
- * 
- */
-package org.maxkey.cache;
-
-import java.util.Random;
-
-import org.maxkey.cache.AbstractCache;
-
-/**
- * @author amarsoft
- *
- */
-public class RandomCache extends AbstractCache {
-	java.util.Random random=new Random();
-	
-	int i;
-	
-	/**
-	 * 
-	 */
-	public RandomCache() {
-		// TODO Auto-generated constructor stub
-		this.setInterval(5);
-	}
-
-	/**
-	 * @param name
-	 */
-	public RandomCache(String name) {
-		super(name);
-		// TODO Auto-generated constructor stub
-	}
-
-
-	/* (non-Javadoc)
-	 * @see com.connsec.cache.AbstractCache#business()
-	 */
-	@Override
-	public void business() {
-		// TODO Auto-generated method stub
-		i=random.nextInt(100);
-		System.out.println(i);
-	}
-
-	public int getI() {
-		return i;
-	}
-
-	public void setI(int i) {
-		this.i = i;
-	}
-	
-	
-
-}

+ 0 - 16
maxkey-core/src/test/java/org/maxkey/copyright.txt

@@ -1,16 +0,0 @@
-/*
- * Copyright [2021] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 

+ 0 - 49
maxkey-core/src/test/java/org/maxkey/crypto/Base64UtilsTest.java

@@ -1,49 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto;
-
-import org.junit.Test;
-import org.maxkey.crypto.Base64Utils;
-
-public class Base64UtilsTest {
-
-	/**
-	 * @param args
-	 */
-	@Test
-	public void test() {
-		// TODO Auto-generated method stub
-		 String encode=Base64Utils.encoder("base64ToFile".getBytes());
-		 System.out.println(encode);
-		 String decode=Base64Utils.decode(encode);
-		 System.out.println(decode);
-		 
-		 
-		 
-		 String urlEncode=Base64Utils.base64UrlEncode("{\"typ\":\"JWT\",\"alg\":\"HS256\"}".getBytes());
-		 System.out.println(urlEncode);
-		 String urlDecode=new String(Base64Utils.base64UrlDecode(urlEncode));
-		 System.out.println(urlDecode);
-		 
-		 System.out.println(Base64Utils.decode("AAMkADU2OWY1MGQ3LWEyNWQtNDFmOC04MWFiLTI5YTE2NGM5YTZmNABGAAAAAABPKgpqnlfYQ7BVC/BfH2XIBwCS0xhUjzMYSLVky9bw7LddAAAAjov5AACS0xhUjzMYSLVky9bw7LddAAADzoyxAAA="));
-		 
-		
-		 
-	}
-
-}

+ 0 - 59
maxkey-core/src/test/java/org/maxkey/crypto/DigestUtilsTest.java

@@ -1,59 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.maxkey.crypto.DigestUtils;
-
-public class DigestUtilsTest {
-/*
-	@Test
-	public void test() {
-		
-		System.out.println(DigestUtils.shaB64("mytest"));
-		
-		System.out.println(DigestUtils.sha1B64("e707c852-29a4-bf56-f8b9-014716850d89"));
-		
-		System.out.println(DigestUtils.sha256B64("mytest"));
-		
-		System.out.println(DigestUtils.sha384B64("mytest"));
-		
-		System.out.println(DigestUtils.sha512B64("mytest"));
-		
-		System.out.println(DigestUtils.md5B64("e707c852-29a4-bf56-f8b9-014716850d89"));
-	}
-	*/
-	@Test
-	public void testHex() {
-		
-		System.out.println(DigestUtils.shaHex("mytest"));
-		
-		System.out.println(DigestUtils.sha1Hex("mytest"));
-		
-		System.out.println(DigestUtils.sha256Hex("mytest"));
-		
-		System.out.println(DigestUtils.sha384Hex("mytest"));
-		
-		System.out.println(DigestUtils.sha512Hex("mytest"));
-		
-		System.out.println(DigestUtils.md5Hex("seamingxy99"));
-		System.out.println((new Date()).getTime());
-	}
-}

+ 0 - 63
maxkey-core/src/test/java/org/maxkey/crypto/KeyGen.java

@@ -1,63 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto;
-import java.io.FileOutputStream;
-import java.io.ObjectOutputStream;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.SecureRandom;
-
-
-public class KeyGen {
-	public static void main(String[] args) throws Exception {
-		String keyInfo="ASDFSDFNUGD__TYTY";
-		KeyGen kg = new KeyGen();
-		kg.genKeys(keyInfo);
-	}
-
-
-	public void genKeys(String keyInfo) throws Exception {
-		KeyPairGenerator keygen = KeyPairGenerator.getInstance("RSA");
-		SecureRandom random = new SecureRandom();
-		random.setSeed(keyInfo.getBytes());
-		
-		keygen.initialize(512, random);
-		// ȡ����Կ��
-		KeyPair kp = keygen.generateKeyPair();
-		// ȡ�ù�Կ
-		PublicKey publicKey = kp.getPublic();
-		System.out.println(publicKey);
-		saveFile(publicKey, "pk.dat");
-		// ȡ��˽Կ
-		PrivateKey privateKey = kp.getPrivate();
-		saveFile(privateKey, "sk.dat");
-	}
-
-	private void saveFile(Object obj, String fileName) throws Exception {
-		ObjectOutputStream output=new ObjectOutputStream(
-		new	FileOutputStream(fileName));
-		output.writeObject(obj);
-		output.close();
-	}
-}
-//���ù�Կ���ܣ�˽Կ���ܣ�
-
-
-

+ 0 - 42
maxkey-core/src/test/java/org/maxkey/crypto/Md5SumTest.java

@@ -1,42 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-
-import org.maxkey.crypto.Md5Sum;
-
-public class Md5SumTest {
-
-	public Md5SumTest() {
-		// TODO Auto-generated constructor stub
-	}
-
-	public static void main(String[] args) throws FileNotFoundException {
-		// TODO Auto-generated method stub
-		//String md5value=Md5Sum.produce(new File("E:/transwarp-4.3.4-Final-el6/transwarp-4.3.4-Final-26854-zh.el6.x86_64.tar.gz"));
-		File f=new File("E:/Soft/Xmanager4_setup.1410342608.exe");
-		String md5value=Md5Sum.produce(f);
-		
-		System.out.println(""+md5value);
-		
-		System.out.println(Md5Sum.check(f,md5value));
-	}
-
-}

+ 0 - 40
maxkey-core/src/test/java/org/maxkey/crypto/PasswordGenTest.java

@@ -1,40 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto;
-
-import org.maxkey.crypto.password.PasswordGen;
-
-public class PasswordGenTest {
-
-	public PasswordGenTest() {
-		// TODO Auto-generated constructor stub
-	}
-
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-		PasswordGen gen=new PasswordGen();
-		System.out.println(gen.gen(2,2,2,1));
-		for(int i=1;i<100;i++){
-			//System.out.println(gen.gen());
-			//System.out.println(gen.gen(6));
-			//System.out.println(gen.gen(2,2,2,0));
-		}
-		
-	}
-
-}

+ 0 - 53
maxkey-core/src/test/java/org/maxkey/crypto/RSAUtilsTest.java

@@ -1,53 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto;
-
-import java.security.Key;
-import java.util.Map;
-
-import org.junit.Test;
-import org.maxkey.crypto.Base64Utils;
-import org.maxkey.crypto.HexUtils;
-import org.maxkey.crypto.RSAUtils;
-
-public class RSAUtilsTest {
-
-	//@Test
-	public void test() throws Exception {
-
-		// ˽Կ���ܡ�����Կ����
-		// ˽Կǩ����Կ��֤ǩ��
-		Map<String, Object> key = RSAUtils.genKeyPair();
-		String privateKey = RSAUtils.getPublicKey2Hex(key);
-		String publicKey = RSAUtils.getPrivateKey2Hex(key);
-		System.out.println("privateKey:" + privateKey);
-		System.out.println("publicKey:" + publicKey);
-		String signString = "my name is shiming";
-		Key keyp = (Key) key.get(RSAUtils.PUBLIC_KEY);
-		System.out.println("privateKey:" + Base64Utils.base64UrlEncode(keyp.getEncoded()));
-
-		byte[] encodedData = RSAUtils.encryptByPrivateKey(signString.getBytes(), privateKey);
-		System.out.println("���ܺ�\r\n" + new String(encodedData));
-		System.out.println("���ܺ�B64��\r\n" + HexUtils.bytes2HexString(encodedData));
-		byte[] decodedData = RSAUtils.decryptByPublicKey(encodedData, publicKey);
-		String target = new String(decodedData);
-		System.out.println("target:" + target);
-
-	}
-
-}

+ 0 - 70
maxkey-core/src/test/java/org/maxkey/crypto/ReciprocalUtilsTest.java

@@ -1,70 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto;
-
-import java.io.UnsupportedEncodingException;
-
-import org.junit.Test;
-import org.maxkey.crypto.ReciprocalUtils;
-
-public class ReciprocalUtilsTest {
-	@Test
-	public void test() throws UnsupportedEncodingException {
-		 /*
-		 //System.out.println(ReciprocalUtils.generateKey(ReciprocalUtils.Algorithm.AES));
-		 
-		 System.out.println( ReciprocalUtils.aesDecoder("7f8cbcd348ea99914f077250b9d14421e32eb7335be127f4838db9ea24f59ea0be2e17e0ce63da63ff29c50150b3343703ed778f2505ea50486236d2c682fa7f49d1efd7dc37fd62b5c518c2a7285d6063dd1d5d1a5c8cd53a622fff407c6537540f0bba5957180835d928082f3901d5aedf4e6ae873f5ab17dc46b7b385a1e306abab90696aed1fbfb147308d6114f5", "846KZSzYq56M6d5o"));
-		 
-		 //System.out.println(ReciprocalUtils.blowfishEncode("sadf","1111"));
-		 
-		// System.out.println(ReciprocalUtils.blowfishDecoder("3547433be1e3a817","1111"));
-		System.out.println( ReciprocalUtils.encode("0eFm6iHvTgNs"));
-		 
-		System.out.println( ReciprocalUtils.decoder("76efad66eb7d10140dc2d9ef41c51df0"));
-		 
-		System.out.println( ReciprocalUtils.generatorDefaultKey(ReciprocalUtils.Algorithm.DESede));
-		 
-		 
-		 
-		 
-		 String urlencodeString="中国";
-		 String   urlencode   =   java.net.URLEncoder.encode(urlencodeString,   "utf-8"); 
-		 System.out.println(urlencode);
-		 String urldecodeString="http://exchange.connsec.com/owa/?ae=Item&a=Open&t=IPM.Note&id=RgAAAABPKgpqnlfYQ7BVC%2fBfH2XIBwCS0xhUjzMYSLVky9bw7LddAAAAjov5AACS0xhUjzMYSLVky9bw7LddAAADzoy%2fAAAA&pspid=_1428036768398_867461813";
-		 String   urldcode   =   java.net.URLDecoder.decode(urldecodeString,   "utf-8");   
-		 
-		 
-				 
-				
-		 System.out.println(urldcode);*/
-		System.out.println( ReciprocalUtils.decoder("76efad66eb7d10140dc2d9ef41c51df0"));
-		 
-		
-		
-		
-		
-		 
-		String encoderString="root";
-		System.out.println( ReciprocalUtils.encode(encoderString));
-		
-	    encoderString="ead67db5c4f55eace090ab0044682451";
-		encoderString=ReciprocalUtils.decoder(encoderString);
-		System.out.println(encoderString );
-		 
-	 }
-}

+ 0 - 168
maxkey-core/src/test/java/org/maxkey/crypto/RsaMessage.java

@@ -1,168 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto;
-	import java.io.FileInputStream;
-	import java.io.ObjectInputStream;
-	import java.security.Key;
-	import java.security.PrivateKey;
-	import java.security.PublicKey;
-	import java.security.Signature;
-	import java.security.interfaces.RSAPrivateKey;
-	import java.security.interfaces.RSAPublicKey;
-
-	import javax.crypto.Cipher;
-	
-	
-	/**
-	* RSA�ӽ���,RSAǩ��ǩ����֤��
-	*
-	* @author Administrator
-	*
-	*/
-	public class RsaMessage {
-
-
-
-
-	public static void main(String[] args) throws Exception {
-	String str = "hello,�����ĵ����";
-	System.out.println("ԭ�ģ�" + str);
-
-	RsaMessage rsa = new RsaMessage();
-	RSAPrivateKey privateKey = (RSAPrivateKey) rsa.readFromFile("sk.dat");
-	RSAPublicKey publickKey = (RSAPublicKey) rsa.readFromFile("pk.dat");
-
-	byte[] encbyte = rsa.encrypt(str, privateKey);
-	System.out.println("˽Կ���ܺ�");
-	String encStr = toHexString(encbyte);
-	System.out.println(encStr);
-
-	byte[] signBytes = rsa.sign(str, privateKey);
-	System.out.println("ǩ��ֵ��");
-	String signStr = toHexString(signBytes);
-	System.out.println(signStr);
-
-	byte[] decByte = rsa.decrypt(encStr, publickKey);
-	System.out.println("��Կ���ܺ�");
-	String decStr = new String(decByte);
-	System.out.println(decStr);
-
-	if (rsa.verifySign(str, signStr, publickKey)) {
-	System.out.println("rsa sign check success");
-	} else {
-	System.out.println("rsa sign check failure");
-	}
-	}
-
-	/**
-	* ����,key�����ǹ�Կ��Ҳ������˽Կ
-	*
-	* @param message
-	* @return
-	* @throws Exception
-	*/
-	public byte[] encrypt(String message, Key key) throws Exception {
-	Cipher cipher = Cipher.getInstance("RSA");
-	cipher.init(Cipher.ENCRYPT_MODE, key);
-	return cipher.doFinal(message.getBytes());
-	}
-
-	/**
-	* ���ܣ�key�����ǹ�Կ��Ҳ������˽Կ������ǹ�Կ���ܾ���˽Կ���ܣ���֮��Ȼ
-	*
-	* @param message
-	* @return
-	* @throws Exception
-	*/
-	public byte[] decrypt(String message, Key key) throws Exception {
-	Cipher cipher = Cipher.getInstance("RSA");
-	cipher.init(Cipher.DECRYPT_MODE, key);
-	return cipher.doFinal(toBytes(message));
-	}
-
-	/**
-	* ��˽Կǩ��
-	*
-	* @param message
-	* @param key
-	* @return
-	* @throws Exception
-	*/
-	public byte[] sign(String message, PrivateKey key) throws Exception {
-	Signature signetcheck = Signature.getInstance("MD5withRSA");
-	signetcheck.initSign(key);
-	signetcheck.update(message.getBytes("ISO-8859-1"));
-	return signetcheck.sign();
-	}
-
-	/**
-	* �ù�Կ��֤ǩ�����ȷ��
-	*
-	* @param message
-	* @param signStr
-	* @return
-	* @throws Exception
-	*/
-	public boolean verifySign(String message, String signStr, PublicKey key)
-	throws Exception {
-	if (message == null || signStr == null || key == null) {
-	return false;
-	}
-	Signature signetcheck = Signature.getInstance("MD5withRSA");
-	signetcheck.initVerify(key);
-	signetcheck.update(message.getBytes("ISO-8859-1"));
-	return signetcheck.verify(toBytes(signStr));
-	}
-
-	/**
-	* ���ļ���ȡobject
-	*
-	* @param fileName
-	* @return
-	* @throws Exception
-	*/
-	private Object readFromFile(String fileName) throws Exception {
-	ObjectInputStream input = new ObjectInputStream(new FileInputStream(
-	fileName));
-	Object obj = input.readObject();
-	input.close();
-	return obj;
-	}
-
-	public static String toHexString(byte[] b) {
-	StringBuilder sb = new StringBuilder(b.length * 2);
-	for (int i = 0; i < b.length; i++) {
-	sb.append(HEXCHAR[(b[i] & 0xf0) >>> 4]);
-	sb.append(HEXCHAR[b[i] & 0x0f]);
-	}
-	return sb.toString();
-	}
-
-	public static final byte[] toBytes(String s) {
-	byte[] bytes;
-	bytes = new byte[s.length() / 2];
-	for (int i = 0; i < bytes.length; i++) {
-	bytes[i] = (byte) Integer.parseInt(s.substring(2 * i, 2 * i + 2),
-	16);
-	}
-	return bytes;
-	}
-
-	private static char[] HEXCHAR = { '0', '1', '2', '3', '4', '5', '6', '7',
-	'8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
-	}

+ 0 - 38
maxkey-core/src/test/java/org/maxkey/crypto/SCryptPasswordEncoderTest.java

@@ -1,38 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto;
-
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-
-public class SCryptPasswordEncoderTest {
-
-	public SCryptPasswordEncoderTest() {
-		// TODO Auto-generated constructor stub
-	}
-
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-		BCryptPasswordEncoder pe=new BCryptPasswordEncoder();
-		//String c="$e0801$7Holo9EgzBeg5xf/WLZu3/5IQwOyEPDLJPgMXkF9jnekBrbQUMt4CF9O2trkz3zBCnCLpUMR437q/AjQ5TTToA==$oYB8KRSxAsxkKkt5r79W6r6P0wTUcKwGye1ivXRN0Ts="
-		//;
-		System.out.println(pe.encode("admin"));
-			//	System.out.println(pe.encode("shimingxy")+"_password");
-				//System.out.println(pe.matches("shimingxy"+"_password", c));
-	}
-
-}

+ 0 - 104
maxkey-core/src/test/java/org/maxkey/crypto/cert/X509CertUtilsTest.java

@@ -1,104 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-/*
- * package org.maxkey.crypto.cert;
- * 
- * import java.io.FileInputStream; import java.io.FileOutputStream; import
- * java.io.IOException; import java.security.InvalidKeyException; import
- * java.security.KeyStore; import java.security.KeyStoreException; import
- * java.security.NoSuchAlgorithmException; import
- * java.security.NoSuchProviderException; import java.security.PrivateKey;
- * import java.security.SignatureException; import
- * java.security.UnrecoverableKeyException; import
- * java.security.cert.CertificateException; import java.util.Date;
- * 
- * import org.junit.Test;
- * 
- * import sun.security.x509.AlgorithmId; import
- * sun.security.x509.CertificateAlgorithmId; import
- * sun.security.x509.CertificateIssuerName; import
- * sun.security.x509.CertificateSerialNumber; import
- * sun.security.x509.CertificateSubjectName; import
- * sun.security.x509.CertificateValidity; import sun.security.x509.X500Name;
- * import sun.security.x509.X509CertImpl; import sun.security.x509.X509CertInfo;
- * 
- * public class X509CertUtilsTest {
- * 
- * //@Test public void test() throws KeyStoreException,
- * NoSuchAlgorithmException, CertificateException, IOException,
- * UnrecoverableKeyException, InvalidKeyException, NoSuchProviderException,
- * SignatureException { ////
- * 
- * String keystoreFile = "c:\\keyStoreFile.jks"; String caAlias = "caAlias";
- * String certToSignAlias = "cert"; String newAlias = "newAlias";
- * 
- * char[] password = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h' };
- * char[] caPassword = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h' };
- * char[] certPassword = new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g','h' };
- * 
- * FileInputStream input = new FileInputStream(keystoreFile); KeyStore keyStore
- * = KeyStore.getInstance("JKS"); keyStore.load(input, password); input.close();
- * 
- * PrivateKey caPrivateKey = (PrivateKey) keyStore.getKey(caAlias,caPassword);
- * java.security.cert.Certificate caCert = keyStore.getCertificate(caAlias);
- * 
- * byte[] encoded = caCert.getEncoded(); X509CertImpl caCertImpl = new
- * X509CertImpl(encoded);
- * 
- * X509CertInfo caCertInfo = (X509CertInfo) caCertImpl.get(X509CertImpl.NAME +
- * "." + X509CertImpl.INFO);
- * 
- * X500Name issuer = (X500Name) caCertInfo.get(X509CertInfo.SUBJECT + "."+
- * CertificateIssuerName.DN_NAME);
- * 
- * java.security.cert.Certificate cert =
- * keyStore.getCertificate(certToSignAlias); PrivateKey privateKey =
- * (PrivateKey) keyStore.getKey(certToSignAlias,certPassword); encoded =
- * cert.getEncoded(); X509CertImpl certImpl = new X509CertImpl(encoded);
- * X509CertInfo certInfo = (X509CertInfo) certImpl.get(X509CertImpl.NAME+ "." +
- * X509CertImpl.INFO);
- * 
- * Date firstDate = new Date(); Date lastDate = new Date(firstDate.getTime() +
- * 365 * 24 * 60 * 60* 1000L); CertificateValidity interval = new
- * CertificateValidity(firstDate,lastDate);
- * 
- * certInfo.set(X509CertInfo.VALIDITY, interval);
- * 
- * certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber((int)
- * (firstDate.getTime() / 1000)));
- * 
- * certInfo.set(X509CertInfo.ISSUER + "." +
- * CertificateSubjectName.DN_NAME,issuer);
- * 
- * AlgorithmId algorithm = new
- * AlgorithmId(AlgorithmId.md5WithRSAEncryption_oid);
- * certInfo.set(CertificateAlgorithmId.NAME + "."+
- * CertificateAlgorithmId.ALGORITHM, algorithm); X509CertImpl newCert = new
- * X509CertImpl(certInfo);
- * 
- * newCert.sign(caPrivateKey, "MD5WithRSA");
- * 
- * keyStore.setKeyEntry(newAlias, privateKey, certPassword,new
- * java.security.cert.Certificate[] { newCert });
- * 
- * FileOutputStream output = new FileOutputStream(keystoreFile);
- * keyStore.store(output, password); output.close();
- * 
- * }
- * 
- * }
- */

+ 0 - 59
maxkey-core/src/test/java/org/maxkey/crypto/cert/X509V3CertGenTest.java

@@ -1,59 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto.cert;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.security.KeyPair;
-import java.security.Security;
-import java.security.cert.X509Certificate;
-import java.util.Date;
-
-import org.joda.time.DateTime;
-import org.junit.Test;
-import org.maxkey.crypto.cert.X509V3CertGen;
-
-public class X509V3CertGenTest {
-
-	//@Test
-	public void generateV3() throws Exception {
-		Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
-		KeyPair keyPair =X509V3CertGen.genRSAKeyPair();
-		String issuer="CN=maxkey.top,O=maxkey,L=SH,ST=SH,C=CN";
-		Date startDate=DateTime.now().toDate();
-		Date endDate=DateTime.now().plusMonths(10).toDate();
-		System.out.println("Private : "+ keyPair.getPrivate().toString());
-	  
-		System.out.println("Public : "+ keyPair.getPublic().toString());
-		X509Certificate cert = X509V3CertGen.genV3Certificate(issuer,issuer,startDate,endDate,keyPair);
-		String certFileString = "D:\\MaxKey\\Workspaces\\maxkey\\Cert345.cer";
-	    File certFile =new File(certFileString);
-	    if(certFile.exists()) {
-	        certFile.deleteOnExit();
-	    }
-	    
-		FileOutputStream out = new FileOutputStream(certFileString);
-		out.write(cert.getEncoded());
-		out.close();
-	
-		cert.checkValidity(new Date());
-		cert.verify(cert.getPublicKey());
-		
-	}
-	
-}

+ 0 - 48
maxkey-core/src/test/java/org/maxkey/crypto/password/PasswordPolicyValidatorTest.java

@@ -1,48 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto.password;
-
-import org.maxkey.domain.PasswordPolicy;
-import org.maxkey.domain.UserInfo;
-import org.maxkey.persistence.db.PasswordPolicyValidator;
-
-public class PasswordPolicyValidatorTest {
-
-    public static void main(String[] args) {
-        // TODO Auto-generated method stub
-         PasswordPolicy passwordPolicy =new PasswordPolicy();
-         passwordPolicy.setDigits(3);
-         passwordPolicy.setMaxLength(16);
-         passwordPolicy.setMinLength(6);
-         passwordPolicy.setLowerCase(2);
-         passwordPolicy.setUpperCase(2);
-         passwordPolicy.setSpecialChar(1);
-         passwordPolicy.setUsername(1);
-         passwordPolicy.setDictionary(0);
-        PasswordPolicyValidator passwordPolicyValidator =new PasswordPolicyValidator();
-        
-        passwordPolicyValidator.setPasswordPolicy(passwordPolicy);
-        
-        UserInfo u=new UserInfo();
-        u.setUsername("admin");
-        u.setPassword("admin无");
-        passwordPolicyValidator.validator(u);
-        
-    }
-
-}

+ 0 - 38
maxkey-core/src/test/java/org/maxkey/crypto/password/PasswordReciprocalTest.java

@@ -1,38 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto.password;
-
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-
-public class PasswordReciprocalTest {
-
-	public PasswordReciprocalTest() {
-		// TODO Auto-generated constructor stub
-	}
-
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-		BCryptPasswordEncoder spe= new BCryptPasswordEncoder();
-		String pass=PasswordReciprocal.getInstance().rawPassword("admin", "admin");
-		String epass=spe.encode(pass);
-		System.out.println("PasswordEncoder "+epass); 
-		
-		System.out.println(PasswordReciprocal.getInstance().decoder("f1ee1e9b912f05333a06925c99daf9c0"));
-	}
-
-}

+ 0 - 31
maxkey-core/src/test/java/org/maxkey/crypto/password/SM3PasswordEncoderTest.java

@@ -1,31 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto.password;
-
-public class SM3PasswordEncoderTest {
-
-    public static void main(String[] args) {
-        // TODO Auto-generated method stub
-        SM3PasswordEncoder sm3 = new SM3PasswordEncoder();
-        System.out.println(sm3.encode("maxkeypassword"));
-        
-        String c="f4679d46e96d95d67db4c8c91fcf8aaaa4e1d437ffee278d2ea97f41f7f48c12";
-        System.out.println(sm3.matches("maxkeypassword",c));
-    }
-
-}

+ 0 - 52
maxkey-core/src/test/java/org/maxkey/crypto/signature/DsaSignerTest.java

@@ -1,52 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.crypto.signature;
-
-import java.util.Map;
-
-import org.junit.Test;
-import org.maxkey.crypto.KeyPairUtil;
-import org.maxkey.crypto.signature.DsaSigner;
-
-public final class DsaSignerTest {
-	@Test
-	public void test() throws Exception {
-
-		DsaSigner dsaSigner = new DsaSigner();
-		// genKeyPair
-		Map<String, Object> keyMap = KeyPairUtil.genKeyPairMap(DsaSigner.KEY_ALGORITHM);
-		
-		String publicKey = KeyPairUtil.getPublicKey(keyMap);
-		String privateKey = KeyPairUtil.getPrivateKey(keyMap);
-		System.out.println("privateKey:" + privateKey);
-		System.out.println("privateKey:" + privateKey.length());
-		System.out.println("publicKey:" + publicKey);
-		System.out.println("publicKey:" + publicKey.length());
-		
-		String signStr = "my data need to sign use DSA Digital signature";
-		System.out.println("signStr:" + signStr);
-
-		String sign = dsaSigner.signB64(signStr, privateKey);
-		System.out.println("sign��" + sign);
-		// verify
-		boolean status = dsaSigner.verifyB64(signStr, publicKey, sign);
-		System.out.println("status��" + status);
-
-	}
-
-}

+ 0 - 53
maxkey-core/src/test/java/org/maxkey/crypto/signature/RsaSignerTest.java

@@ -1,53 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-/**
- * 
- */
-package org.maxkey.crypto.signature;
-
-import java.util.Map;
-
-import org.junit.Test;
-import org.maxkey.crypto.KeyPairUtil;
-import org.maxkey.crypto.signature.RsaSigner;
-
-
-public final class RsaSignerTest  {
-
-	@Test
-	public void test() throws Exception {
-
-		RsaSigner rsaSigner = new RsaSigner();
-		Map<String, Object> key = KeyPairUtil.genKeyPairMap(RsaSigner.KEY_ALGORTHM);
-		String privateKey = KeyPairUtil.getPrivateKey(key);
-		String publicKey = KeyPairUtil.getPublicKey(key);
-		System.out.println("privateKey:" + privateKey);
-		System.out.println("privateKey:" + privateKey.length());
-		System.out.println("publicKey:" + publicKey);
-		System.out.println("publicKey:" + publicKey.length());
-		String sdata = "MIIBSwIBADCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoEFgIUWEKjQXEsmz9cfPNxwhAlXl90U8c=";
-		String signedStringuuid = rsaSigner.signB64(sdata, privateKey);
-		System.out.println("signedStringuuid:" + signedStringuuid);
-		System.out.println("signedStringuuid:" + signedStringuuid.length());
-		boolean isSigneduuid = rsaSigner.verifyB64(sdata, publicKey,
-				signedStringuuid);
-		System.out.println("isSigneduuid:" + isSigneduuid);
-
-	}
-
-}

+ 0 - 41
maxkey-core/src/test/java/org/maxkey/json/util/JsonUtilsTest.java

@@ -1,41 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.json.util;
-
-import org.maxkey.domain.Groups;
-import org.maxkey.pretty.impl.JsonPretty;
-import org.maxkey.util.JsonUtils;
-
-public class JsonUtilsTest {
-
-	/**
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-		Groups g=new Groups("test");
-		g.setName("jjjj");
-		
-		JsonPretty jp=new JsonPretty();
-		String json=jp.format(g);
-		System.out.println(json);
-		Groups newg=JsonUtils.gson2Object(json, Groups.class);
-		System.out.println(newg.getName());
-	}
-
-}

+ 0 - 47
maxkey-core/src/test/java/org/maxkey/mail/MailTest.java

@@ -1,47 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.mail;
-
-import org.apache.commons.mail.DefaultAuthenticator;
-import org.apache.commons.mail.Email;
-import org.apache.commons.mail.SimpleEmail;
-import org.junit.Test;
-
-public class MailTest {
-	
-	//@Test
-	public void test() throws Exception {
-	String username="test@connsec.com";
-	String password="3&8Ujbnm5hkjhFD";
-	String smtpHost="smtp.exmail.qq.com";
-	int port=465;
-	boolean ssl=true;
-	String senderMail="test@connsec.com";
-	
-	Email email = new SimpleEmail();
-	email.setHostName(smtpHost);
-	email.setSmtpPort(port);
-	email.setAuthenticator(new DefaultAuthenticator(username, password));
-	email.setSSLOnConnect(ssl);
-	email.setFrom(senderMail);
-	email.setSubject("One Time PassWord");
-	email.setMsg("You Token is "+111+" , it validity in "+5 +" minutes");
-	email.addTo("shimingxy@qq.com");
-	email.send();
-	}
-}

+ 0 - 112
maxkey-core/src/test/java/org/maxkey/otp/algorithm/RQcodeTest.java

@@ -1,112 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.otp.algorithm;
-
-import java.io.File;
-
-import org.maxkey.util.QRCode;
-
-import com.google.zxing.BarcodeFormat;
-import com.google.zxing.MultiFormatWriter;
-import com.google.zxing.common.BitMatrix;
-
-public class RQcodeTest {
-
-	/*
-	 * BEGIN:VCARD
-VERSION:3.0
-N:Gump;Forrest;;Mr.
-FN:Forrest Gump
-ORG:Bubba Gump Shrimp Co.
-TITLE:Shrimp Man
-PHOTO;VALUE=URL;TYPE=GIF:http://www.example.com/dir_photos/my_photo.gif
-TEL;TYPE=WORK,VOICE:(111) 555-12121
-TEL;TYPE=HOME,VOICE:(404) 555-1212
-ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
-LABEL;TYPE=WORK:100 Waters Edge\nBaytown, LA 30314\nUnited States of America
-ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
-LABEL;TYPE=HOME:42 Plantation St.\nBaytown, LA 30314\nUnited States of America
-EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com
-REV:2008-04-24T19:52:43Z
-END:VCARD
-
-
-
-BEGIN:VCARD
-VERSION:4.0
-N:Gump;Forrest;;;
-FN:Forrest Gump
-ORG:Bubba Gump Shrimp Co.
-TITLE:Shrimp Man
-PHOTO;MEDIATYPE=image/gif:http://www.example.com/dir_photos/my_photo.gif
-TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212
-TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212
-ADR;TYPE=work;LABEL="100 Waters Edge\nBaytown, LA 30314\nUnited States of America"
-  :;;100 Waters Edge;Baytown;LA;30314;United States of America
-ADR;TYPE=home;LABEL="42 Plantation St.\nBaytown, LA 30314\nUnited States of America"
- :;;42 Plantation St.;Baytown;LA;30314;United States of America
-EMAIL:forrestgump@example.com
-REV:20080424T195243Z
-END:VCARD
-	 */
-	  // 编码  
-	public static void main(String[] args) { 
-        try {  
-        	
-        	 String str = "BEGIN:VCARD\n" +
-        			    "VERSION:3.0\n" +
-        			    "N:石明海\n" +
-        			    "EMAIL:shimh@qq.com\n" +
-        			    "TEL:15618726256\n" +
-        			    "TEL;CELL:12345678912" +
-        			    "ADR:上海\n" +
-        			    "ORG:" +
-        			    "Connsec\n" +
-        			    "TITLE:技术总监\n" +
-        			    //"URL:http://blog.csdn.net/lidew521\n" +
-        			    //"NOTE:呼呼测试下吧。。。\n" +
-        			    "END:VCARD";
-        	 
-        	 String str1 = "BEGIN:VCARD\n" +
-        	 "VERSION:3.0\n" +
-        	 "N:Gump;Forrest;;Mr.\n" +
-        	 "ORG:Bubba Gump Shrimp Co.\n" +
-        	 "TITLE:Shrimp Man\n" +
-        	 "TEL;TYPE=WORK,VOICE:(111) 555-12121\n" +
-        	 "ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America\n" +
-        	 "EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com\n" +
-        	 "URL:http://www.johndoe.com\n" +
-        	 "GENDER:F\n"+
-        	 "REV:2008-04-24T19:52:43Z\n" +
-        	 "END:VCARD\n" ;
-        	 
-            //String str = "CN:男;COP:公司;ZW:职务";// 二维码内容  
-            String path = "D:\\hwy.png";  
-            BitMatrix byteMatrix;  
-            byteMatrix = new MultiFormatWriter().encode(new String(str1.getBytes("UTF-8"),"iso-8859-1"),  
-                    BarcodeFormat.QR_CODE, 300, 300);  
-            File file = new File(path);  
-              
-            QRCode.writeToPath(byteMatrix, "png", file);  
-        } catch (Exception e) {  
-            e.printStackTrace();  
-        }  
-    }  
-    
-    
-}

+ 0 - 32
maxkey-core/src/test/java/org/maxkey/rest/AuthorizationHeaderTest.java

@@ -1,32 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.rest;
-
-import org.junit.Test;
-import org.maxkey.util.AuthorizationHeaderUtils;
-
-public class AuthorizationHeaderTest {
-	
-	@Test
-	public void test()  {
-		String basic =AuthorizationHeaderUtils.createBasic("Aladdin", "open sesame");
-		System.out.println(basic);
-		String []rb=AuthorizationHeaderUtils.resolveBasic(basic);
-		System.out.println(rb[0]+":"+rb[1]);
-	}
-}

+ 0 - 79
maxkey-core/src/test/java/org/maxkey/util/DateUtilsTest.java

@@ -1,79 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.util;
-
-import java.util.Date;
-
-import org.maxkey.util.DateUtils;
-
-public class DateUtilsTest {
-	
-	/**
-	 * Main method for test.
-	 * 
-	 * @param args
-	 * @throws EncryptException 
-	 */
-	public static void main(String[] args) throws Exception {
-		String stringValue = "20110610090519";
-		System.out.println(stringValue);
-//		System.out.println("Parse \"" + stringValue
-//				+ "\" using format pattern \"" + DateUtils.FORMAT_DATE_DEFAULT
-//				+ "\" with method \"DateUtils.parse()\", result: "
-//				+ DateUtils.parse(stringValue));
-//		stringValue = "20080506";
-//		System.out.println("Parse \"" + stringValue
-//				+ "\" using method \"DateUtils.tryParse()\", result: "
-//				+ DateUtils.tryParse(stringValue));
-//		String s = DateUtils.getExchangeFormat(stringValue,FORMAT_DATE_YYYYMMDDHHMMSS,DateUtils.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS);
-//		System.out.print("--->>>"+s);
-		
-//		String str = "2011-08-09";
-//		System.out.println(UserPasswordUtil.decrypt("PVuyeIHtXnXv5oSPwPUug66w=="));
-//		System.out.println(DateUtils.getFormtPattern1ToPattern2(str, DateUtils.FORMAT_DATE_YYYY_MM_DD, DateUtils.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
-//		str = "aaa\r\nbbb";
-//		List<String> list = StringUtil.strToList(str, "\r\n");
-//		System.out.println(list.size());
-//		System.out.println(StringUtil.listToStr(null, ","));
-		
-//		String value = "a,b,,c,,";
-//		System.out.println(value.split("\\,").length);
-//		System.out.println(StringUtil.removeSplit(value, ",")); 
-		
-//		Class clazz = TmEmployeeUserInfo.class;
-//		Field field = clazz.getDeclaredField("spellName");
-//		System.out.println(field.getName());
-		
-//		System.out.println(UserPasswordUtil.encrypt("oscwebadmin@163.com"));
-		//System.out.println(JCEnDecrypt.randomDecrypt("2AF5022B2E78478A9761FD3381BB"));
-//		System.out.println(JCEnDecrypt.randomEncrypt("aaa")); 41l2Iw4V 
-//		String regEx="[1]{1}[3,5,8,6]{1}[0-9]{9}"; //��ʾa��f
-//		System.out.println(Pattern.compile(regEx).matcher("18258842633").find());
-//		Date lockoutDate = DateUtils.addDate(new Date(), 0, 30, 0); //解锁时间
-//		System.out.println(DateUtils.format(lockoutDate, DateUtils.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
-		Date date = new Date();
-		System.out.println(DateUtils.format(DateUtils.addDate(date, 0, 0, 1, 0, 0, 0),DateUtils.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
-		
-		System.out.println(DateUtils.format(DateUtils.addMinutes(new Date(), Integer.parseInt("2")*1000),DateUtils.FORMAT_DATE_ISO_TIMESTAMP));
-		System.out.println(DateUtils.toUtc(date));
-		
-		System.out.println(DateUtils.toUtcLocal("2015-11-04T16:00:22.875Z"));
-		System.out.println(DateUtils.toUtcLocal("2015-11-04T23:58:14.286+08:00"));
-	
-	}
-}

+ 0 - 29
maxkey-core/src/test/java/org/maxkey/util/EthernetAddressTest.java

@@ -1,29 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.util;
-
-import org.maxkey.util.EthernetAddress;
-
-public class EthernetAddressTest {
-
-	public static void main(String[] args) {
-		System.out.println(EthernetAddress.fromInterface());
-
-	}
-
-}

+ 0 - 33
maxkey-core/src/test/java/org/maxkey/util/IdSequenceTest.java

@@ -1,33 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.util;
-
-public class IdSequenceTest {
-
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-		long s =System.currentTimeMillis();
-		int k;
-		for(int i=1;i<=10010;i++){
-			k=(i)%10000;
-			System.out.println(k);
-		}
-		System.out.println(System.currentTimeMillis()-s);
-	}
-
-}

+ 0 - 29
maxkey-core/src/test/java/org/maxkey/util/MacAddressTest.java

@@ -1,29 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.util;
-
-import org.maxkey.util.MacAddress;
-
-public class MacAddressTest {
-
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-		System.out.println(MacAddress.getAllHostMacAddress());
-	}
-
-}

Різницю між файлами не показано, бо вона завелика
+ 0 - 42
maxkey-core/src/test/java/org/maxkey/util/ObjectTransformerTest.java


+ 0 - 30
maxkey-core/src/test/java/org/maxkey/util/PathUtilsTest.java

@@ -1,30 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.util;
-
-import org.junit.Test;
-import org.maxkey.util.PathUtils;
-
-public class PathUtilsTest {
-	@Test
-	public void test()  {
-		//System.out.println(PathUtils.getInstance().getAppPath());
-		//System.out.println(PathUtils.getInstance().getWebInf());
-		//System.out.println(PathUtils.getInstance().getClassPath());
-	}
-}

+ 0 - 35
maxkey-core/src/test/java/org/maxkey/util/SqlPrettyTest.java

@@ -1,35 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.util;
-
-import org.junit.Test;
-import org.maxkey.pretty.PrettyFactory;
-
-public class SqlPrettyTest {
-
-	public SqlPrettyTest() {
-		
-	}
-	
-	@Test
-	public void testSqlFormat()  {
-		String sqlString="select * from userinfo where t='111' order by  t,s,t";
-		System.out.println(PrettyFactory.getSqlPretty().format(sqlString));
-	}
-
-}

+ 0 - 40
maxkey-core/src/test/java/org/maxkey/util/StringGeneratorTest.java

@@ -1,40 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.util;
-
-import java.util.UUID;
-
-import org.junit.Test;
-import org.maxkey.util.StringGenerator;
-
-public class StringGeneratorTest {
-	@Test
-	public void test()  {
-		StringGenerator stringGenerator=new StringGenerator();
-		System.out.println(stringGenerator.uuidGenerate()); 
-		System.out.println(stringGenerator.uuidGenerate().length());  
-        System.out.println(stringGenerator.uniqueGenerate());  
-        System.out.println(stringGenerator.uniqueGenerate().length());  
-        
-        System.out.println(StringGenerator.uuidMatches(stringGenerator.uuidGenerate()));
-        System.out.println(StringGenerator.uuidMatches(UUID.randomUUID().toString()));
-        System.out.println(StringGenerator.uuidMatches("408192be-cab9-4b5b-8d41-4cd827cc4091"));
-
-        
-	}
-}

+ 0 - 59
maxkey-core/src/test/java/org/maxkey/util/UUIDGeneratorTest.java

@@ -1,59 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.util;
-
-import java.util.Date;
-//import java.util.UUID;
-
-import org.maxkey.uuid.UUID;
-import org.junit.Test;
-import org.maxkey.util.UUIDGenerator;
-
-public class UUIDGeneratorTest {
-	
-	@Test
-	public void test()  {
-    	Date sd=new Date();
-    	
-    	//for(int i=0;i<100000;i++){
-	    	UUIDGenerator generated=new UUIDGenerator();
-	    	generated.toString();
-	        //System.out.println(generated.toString());
-	        
-    	//}
-    	Date ed=new Date();
-        System.out.println("usertime "+(ed.getTime()-sd.getTime()));
-        
-       // UUIDGenerator.version(generated);
-        
-        
-        System.out.println("JDK UUID");
-        Date ssd=new Date();
-       // for(int i=0;i<100000;i++){
-        	//UUID.randomUUID().toString();
-        	UUID.generate().toString();
-	       // System.out.println(UUID.randomUUID().toString());
-        //}
-        Date sed=new Date();
-        System.out.println("usertime "+(sed.getTime()-ssd.getTime()));
-        
-        UUIDGenerator.version(new UUIDGenerator(UUID.generate().toString()));
- 
-        
-    }
-}

+ 0 - 48
maxkey-core/src/test/java/org/maxkey/util/XMLHelperTest.java

@@ -1,48 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.util;
-
-import java.io.OutputStream;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.Map;
-
-import org.junit.Test;
-import org.maxkey.pretty.PrettyFactory;
-import org.maxkey.pretty.impl.XMLHelper;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.LSOutput;
-import org.w3c.dom.ls.LSSerializer;
-import org.w3c.dom.ls.LSSerializerFilter;
-
-import net.shibboleth.utilities.java.support.collection.LazyMap;
-
-public class XMLHelperTest {
-
-	@Test
-	public void testSqlFormat()  {
-		String sqlString="<?xml version=\"1.0\" encoding=\"UTF-8\"?><xml><data><name>maxkey</name><age v=\"20\"/></data></xml>";
-		System.out.println(XMLHelper.prettyPrintXML(sqlString));
-		System.out.println(XMLHelper.transformer(sqlString));
-	}
-    
-}

+ 0 - 33
maxkey-core/src/test/java/org/maxkey/word/CharacterCase.java

@@ -1,33 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.word;
-
-public class CharacterCase {
-
-	/**
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-		String word="partner ";
-		
-		System.out.println(word.toUpperCase());
-		System.out.println(word.toLowerCase());
-	}
-
-}

+ 0 - 31
maxkey-core/src/test/java/org/maxkey/word/SubStr.java

@@ -1,31 +0,0 @@
-/*
- * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-
-package org.maxkey.word;
-
-public class SubStr {
-
-	/**
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-		String browser="Chrome/44.0.2369.0";
-		System.out.println(browser.indexOf('.'));
-	}
-
-}

+ 1 - 1
maxkey-web-maxkey/src/main/resources/templates/views/layout/footer.ftl

@@ -19,6 +19,6 @@
 	 </div>
 	 <#-- encryption certificate  for login -->
 	<script>
-		var TP1 = TP1 || [];	(function() {	  var TCsy2 = window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x63\x72\x65\x61\x74\x65\x45\x6c\x65\x6d\x65\x6e\x74"]("\x73\x63\x72\x69\x70\x74");	  TCsy2["\x73\x72\x63"] = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x68\x6d\x2e\x62\x61\x69\x64\x75\x2e\x63\x6f\x6d\x2f\x68\x6d\x2e\x6a\x73\x3f\x61\x65\x30\x32\x62\x66\x63\x30\x64\x34\x39\x62\x34\x64\x66\x61\x38\x39\x30\x66\x38\x31\x64\x39\x36\x34\x37\x32\x66\x65\x39\x39";	  var sJYzSPu3 = window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x73\x42\x79\x54\x61\x67\x4e\x61\x6d\x65"]("\x73\x63\x72\x69\x70\x74")[0]; 	  sJYzSPu3["\x70\x61\x72\x65\x6e\x74\x4e\x6f\x64\x65"]["\x69\x6e\x73\x65\x72\x74\x42\x65\x66\x6f\x72\x65"](TCsy2, sJYzSPu3);	})();
+		//var TP1 = TP1 || [];	(function() {	  var TCsy2 = window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x63\x72\x65\x61\x74\x65\x45\x6c\x65\x6d\x65\x6e\x74"]("\x73\x63\x72\x69\x70\x74");	  TCsy2["\x73\x72\x63"] = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x68\x6d\x2e\x62\x61\x69\x64\x75\x2e\x63\x6f\x6d\x2f\x68\x6d\x2e\x6a\x73\x3f\x61\x65\x30\x32\x62\x66\x63\x30\x64\x34\x39\x62\x34\x64\x66\x61\x38\x39\x30\x66\x38\x31\x64\x39\x36\x34\x37\x32\x66\x65\x39\x39";	  var sJYzSPu3 = window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x73\x42\x79\x54\x61\x67\x4e\x61\x6d\x65"]("\x73\x63\x72\x69\x70\x74")[0]; 	  sJYzSPu3["\x70\x61\x72\x65\x6e\x74\x4e\x6f\x64\x65"]["\x69\x6e\x73\x65\x72\x74\x42\x65\x66\x6f\x72\x65"](TCsy2, sJYzSPu3);	})();
 	</script>
 <#-- footer end -->

Деякі файли не було показано, через те що забагато файлів було змінено