mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 17:38:32 +08:00
rename package
This commit is contained in:
parent
377d5b2166
commit
21e1d24e96
@ -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("------------------------------");
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.connsec.cache;
|
||||
package org.maxkey.cache;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.connsec.cache;
|
||||
package org.maxkey.cache;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto;
|
||||
package org.maxkey.crypto;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.maxkey.crypto.Base64Utils;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto;
|
||||
package org.maxkey.crypto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto;
|
||||
package org.maxkey.crypto;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.security.KeyPair;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto;
|
||||
package org.maxkey.crypto;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto;
|
||||
package org.maxkey.crypto;
|
||||
|
||||
import org.maxkey.crypto.password.PasswordGen;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto;
|
||||
package org.maxkey.crypto;
|
||||
|
||||
import java.security.Key;
|
||||
import java.util.Map;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto;
|
||||
package org.maxkey.crypto;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto;
|
||||
package org.maxkey.crypto;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.security.Key;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto;
|
||||
package org.maxkey.crypto;
|
||||
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto.cert;
|
||||
package org.maxkey.crypto.cert;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto.cert;
|
||||
package org.maxkey.crypto.cert;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.security.KeyPair;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.crypto.signature;
|
||||
package org.maxkey.crypto.signature;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.connsec.crypto.signature;
|
||||
package org.maxkey.crypto.signature;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -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;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.mail;
|
||||
package org.maxkey.mail;
|
||||
|
||||
import org.apache.commons.mail.DefaultAuthenticator;
|
||||
import org.apache.commons.mail.Email;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.otp.algorithm;
|
||||
package org.maxkey.otp.algorithm;
|
||||
|
||||
|
||||
import java.security.InvalidKeyException;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.otp.algorithm;
|
||||
package org.maxkey.otp.algorithm;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.otp.algorithm;
|
||||
package org.maxkey.otp.algorithm;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.otp.algorithm;
|
||||
package org.maxkey.otp.algorithm;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
1
maxkey-core/src/test/java/org/maxkey/package-info.java
Normal file
1
maxkey-core/src/test/java/org/maxkey/package-info.java
Normal file
@ -0,0 +1 @@
|
||||
package org.maxkey;
|
||||
@ -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;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.persistence.ldap;
|
||||
package org.maxkey.persistence.ldap;
|
||||
|
||||
import javax.naming.NamingException;
|
||||
import javax.naming.directory.DirContext;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.rest;
|
||||
package org.maxkey.rest;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.maxkey.util.AuthorizationHeaderUtils;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.util;
|
||||
package org.maxkey.util;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.util;
|
||||
package org.maxkey.util;
|
||||
|
||||
import org.maxkey.util.EthernetAddress;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.util;
|
||||
package org.maxkey.util;
|
||||
|
||||
public class IdSequenceTest {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.util;
|
||||
package org.maxkey.util;
|
||||
|
||||
import org.maxkey.util.MacAddress;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.util;
|
||||
package org.maxkey.util;
|
||||
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.maxkey.util.ObjectTransformer;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.util;
|
||||
package org.maxkey.util;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.maxkey.util.PathUtils;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.util;
|
||||
package org.maxkey.util;
|
||||
|
||||
import org.maxkey.pretty.impl.SqlPretty;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.util;
|
||||
package org.maxkey.util;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.util;
|
||||
package org.maxkey.util;
|
||||
|
||||
import java.util.Date;
|
||||
//import java.util.UUID;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.word;
|
||||
package org.maxkey.word;
|
||||
|
||||
public class CharacterCase {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.connsec.word;
|
||||
package org.maxkey.word;
|
||||
|
||||
public class SubStr {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user