rename package

This commit is contained in:
shimingxy 2020-02-15 17:10:58 +08:00
parent 377d5b2166
commit 21e1d24e96
37 changed files with 36 additions and 175 deletions

View File

@ -1,140 +0,0 @@
/**
*
*/
package com.connsec.radius;
import java.io.IOException;
import java.net.InetAddress;
import net.jradius.client.RadiusClient;
import net.jradius.client.auth.MSCHAPv2Authenticator;
import net.jradius.client.auth.RadiusAuthenticator;
import net.jradius.dictionary.Attr_AcctInputOctets;
import net.jradius.dictionary.Attr_AcctOutputOctets;
import net.jradius.dictionary.Attr_AcctSessionId;
import net.jradius.dictionary.Attr_AcctSessionTime;
import net.jradius.dictionary.Attr_AcctStatusType;
import net.jradius.dictionary.Attr_AcctTerminateCause;
import net.jradius.dictionary.Attr_NASPort;
import net.jradius.dictionary.Attr_NASPortType;
import net.jradius.dictionary.Attr_ReplyMessage;
import net.jradius.dictionary.Attr_UserName;
import net.jradius.dictionary.Attr_UserPassword;
import net.jradius.exception.RadiusException;
import net.jradius.exception.UnknownAttributeException;
import net.jradius.packet.AccessAccept;
import net.jradius.packet.AccessRequest;
import net.jradius.packet.AccountingRequest;
import net.jradius.packet.RadiusPacket;
import net.jradius.packet.attribute.AttributeFactory;
import net.jradius.packet.attribute.AttributeList;
import net.jradius.util.RadiusRandom;
/**
* @author Crystal.Sea
*
*/
public class RadiusTest {
/**
* @param args
* @throws IOException
* @throws RadiusException
* @throws UnknownAttributeException
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
AttributeFactory.loadAttributeDictionary("net.jradius.dictionary.AttributeDictionaryImpl");
try{
InetAddress inetAddress=InetAddress.getByName("127.0.0.1");
String sharedSecret="testing123";
RadiusClient radiusClient = new RadiusClient(
inetAddress, // InetAddress - Address of remote RADIUS Server
sharedSecret,
1812,
1813,
60); // String - Shared Secret for remote RADIUS Server
System.out.println("RADIUS response from {}: {}"+radiusClient.getRemoteInetAddress().getCanonicalHostName());
AttributeList attributeList = new AttributeList();
//attributeList.add(new Attr_NASPortType(Attr_NASPortType.Wireless80211));
attributeList.add(new Attr_NASPort(new Long(-1)));
attributeList.add(new Attr_UserName("lameuser"));
attributeList.add(new Attr_UserPassword("tttt"));
AccessRequest request = new AccessRequest(radiusClient, attributeList);
System.out.println("Sending:\n" + request.toString());
// RadiusAuthenticator auth =new MSCHAPv2Authenticator();
RadiusAuthenticator auth = RadiusClient.getAuthProtocol("eap2");
RadiusPacket reply = radiusClient.authenticate(request,auth ,3);
System.out.println("RADIUS response from {}: {}"+radiusClient.getRemoteInetAddress().getCanonicalHostName()+","+reply.getClass().getName());
if (reply == null) return; // Request Timed-out
System.out.println("getIdentifier:" + reply.getIdentifier());
System.out.println("getcode:" + reply.getCode());
System.out.println("getAttributeList:\n" + reply.getAttributes().getAttributeList());
System.out.println("Received:\n" + reply.toString());
boolean isAuthenticated = (reply instanceof AccessAccept);
System.out.println("isAuthenticated : \n" + isAuthenticated);
System.out.println("AccessReject : \n" + (reply instanceof net.jradius.packet.AccessReject));
System.out.println("PasswordReject : \n" + (reply instanceof net.jradius.packet.PasswordReject));
String replyMessage = (String) reply.getAttributeValue(Attr_ReplyMessage.TYPE);
if (replyMessage != null)
{
System.out.println("Reply Message: " + replyMessage);
}else{
System.out.println("Reply Message: " + "error . ");
}
/*
attributeList.add(new Attr_AcctSessionId(RadiusRandom.getRandomString(24)));
request = new AccountingRequest(radiusClient, attributeList);
request.addAttribute(new Attr_AcctStatusType(Attr_AcctStatusType.Start));
reply = radiusClient.accounting(request, 5);
request = new AccountingRequest(radiusClient, attributeList);
request.addAttribute(new Attr_AcctStatusType(Attr_AcctStatusType.Stop));
request.addAttribute(new Attr_AcctInputOctets(new Long(10)));
request.addAttribute(new Attr_AcctOutputOctets(new Long(10)));
request.addAttribute(new Attr_AcctSessionTime(new Long(60)));
request.addAttribute(new Attr_AcctTerminateCause(Attr_AcctTerminateCause.UserRequest));
reply = radiusClient.accounting(request, 5);*/
}catch(Exception e){
e.printStackTrace();
}
}
//<EFBFBD><EFBFBD>InetAddress <EFBFBD>е<EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public static void showInfo(InetAddress IP){
String name = IP.getHostName();
String address = IP.getHostAddress();
System.out.println(name);
System.out.println(address);
System.out.println("------------------------------");
}
}

View File

@ -1,7 +1,7 @@
/**
*
*/
package com.connsec.cache;
package org.maxkey.cache;
import java.util.ArrayList;

View File

@ -1,7 +1,7 @@
/**
*
*/
package com.connsec.cache;
package org.maxkey.cache;
import java.util.Random;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto;
package org.maxkey.crypto;
import org.junit.Test;
import org.maxkey.crypto.Base64Utils;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto;
package org.maxkey.crypto;
import java.util.Date;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto;
package org.maxkey.crypto;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.security.KeyPair;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto;
package org.maxkey.crypto;
import java.io.File;
import java.io.FileNotFoundException;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto;
package org.maxkey.crypto;
import org.maxkey.crypto.password.PasswordGen;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto;
package org.maxkey.crypto;
import java.security.Key;
import java.util.Map;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto;
package org.maxkey.crypto;
import java.io.UnsupportedEncodingException;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto;
package org.maxkey.crypto;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.security.Key;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto;
package org.maxkey.crypto;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto.cert;
package org.maxkey.crypto.cert;
import java.io.FileInputStream;
import java.io.FileOutputStream;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto.cert;
package org.maxkey.crypto.cert;
import java.io.FileOutputStream;
import java.security.KeyPair;

View File

@ -1,4 +1,4 @@
package com.connsec.crypto.signature;
package org.maxkey.crypto.signature;
import java.util.Map;

View File

@ -1,7 +1,7 @@
/**
*
*/
package com.connsec.crypto.signature;
package org.maxkey.crypto.signature;
import java.util.Map;

View File

@ -1,4 +1,4 @@
package com.connsec.json.util;
package org.maxkey.json.util;
import org.maxkey.domain.Groups;
import org.maxkey.pretty.impl.JsonPretty;

View File

@ -1,4 +1,4 @@
package com.connsec.mail;
package org.maxkey.mail;
import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.Email;

View File

@ -1,4 +1,4 @@
package com.connsec.otp.algorithm;
package org.maxkey.otp.algorithm;
import java.security.InvalidKeyException;

View File

@ -1,4 +1,4 @@
package com.connsec.otp.algorithm;
package org.maxkey.otp.algorithm;
import java.io.File;

View File

@ -1,4 +1,4 @@
package com.connsec.otp.algorithm;
package org.maxkey.otp.algorithm;
import java.io.File;

View File

@ -1,4 +1,4 @@
package com.connsec.otp.algorithm;
package org.maxkey.otp.algorithm;
import java.text.DateFormat;
import java.text.ParseException;

View File

@ -0,0 +1 @@
package org.maxkey;

View File

@ -1,4 +1,4 @@
package com.connsec.persistence.derby;
package org.maxkey.persistence.derby;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;

View File

@ -1,4 +1,4 @@
package com.connsec.persistence.ldap;
package org.maxkey.persistence.ldap;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;

View File

@ -1,4 +1,4 @@
package com.connsec.rest;
package org.maxkey.rest;
import org.junit.Test;
import org.maxkey.util.AuthorizationHeaderUtils;

View File

@ -1,4 +1,4 @@
package com.connsec.util;
package org.maxkey.util;
import java.util.Date;

View File

@ -1,4 +1,4 @@
package com.connsec.util;
package org.maxkey.util;
import org.maxkey.util.EthernetAddress;

View File

@ -1,4 +1,4 @@
package com.connsec.util;
package org.maxkey.util;
public class IdSequenceTest {

View File

@ -1,4 +1,4 @@
package com.connsec.util;
package org.maxkey.util;
import org.maxkey.util.MacAddress;

View File

@ -1,4 +1,4 @@
package com.connsec.util;
package org.maxkey.util;
import org.maxkey.domain.UserInfo;
import org.maxkey.util.ObjectTransformer;

View File

@ -1,4 +1,4 @@
package com.connsec.util;
package org.maxkey.util;
import org.junit.Test;
import org.maxkey.util.PathUtils;

View File

@ -1,4 +1,4 @@
package com.connsec.util;
package org.maxkey.util;
import org.maxkey.pretty.impl.SqlPretty;

View File

@ -1,4 +1,4 @@
package com.connsec.util;
package org.maxkey.util;
import java.util.UUID;

View File

@ -1,4 +1,4 @@
package com.connsec.util;
package org.maxkey.util;
import java.util.Date;
//import java.util.UUID;

View File

@ -1,4 +1,4 @@
package com.connsec.word;
package org.maxkey.word;
public class CharacterCase {

View File

@ -1,4 +1,4 @@
package com.connsec.word;
package org.maxkey.word;
public class SubStr {