Class RadiusUtils
java.lang.Object
ru.bitel.bgbilling.kernel.network.radius.RadiusUtils
public class RadiusUtils
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRadiusUtils.RadiusPacketAdapter -
Field Summary
Fields Modifier and Type Field Description static booleanlogEnable -
Constructor Summary
Constructors Constructor Description RadiusUtils() -
Method Summary
Modifier and Type Method Description static voidaddToLog(DefaultServerSetup setup, int mid, RadiusPacket packet, java.util.Date logMonthDate, int recordId)static booleancheckChapPassword(RadiusAttributeSet packet, byte[] authenticator, java.lang.String openPassword)static booleancheckDigestMD5Password(RadiusAttributeSet packet, java.lang.String openPassw)static booleancheckDigestPassword(RadiusAttributeSet packet, RadiusAttributeSet response, java.lang.String openPassw)static intcheckMessageAuthenticator(RadiusPacket packet, java.nio.ByteBuffer bb, byte[] secret)static booleancheckPassword(ru.bitel.bgbilling.kernel.network.radius.nas.Nas<?,?,?> nas, java.lang.String openPassw, RadiusAttributeSet packet, RadiusAttributeSet response, byte[] secret, byte[] authenticator)static voiddecryptPassword(RadiusPacket request, byte[] secret)static byte[]encodeChapPassword(java.lang.String userPassword, byte[] chapChallenge)static byte[]encodePapPassword(byte[] userPassword, byte[] secret, byte[] authenticator)static byte[]getHmacMD5(byte[] key, java.nio.ByteBuffer data)static intgetNasPort(RadiusPacket request)static intinsertToLog(DefaultServerSetup setup, int mid, RadiusPacket packet, java.util.Date logMonthDate)static byte[]next()16static byte[]next(int num)static voidsetChapPassword(RadiusPacket packet, java.lang.String userPassword)static voidsetPapPassword(RadiusPacket packet, byte[] secret, java.lang.String userPassword)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
logEnable
public static volatile boolean logEnable
-
-
Constructor Details
-
RadiusUtils
public RadiusUtils()
-
-
Method Details
-
checkMessageAuthenticator
public static int checkMessageAuthenticator(RadiusPacket packet, java.nio.ByteBuffer bb, byte[] secret) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException- Throws:
java.security.InvalidKeyExceptionjava.security.NoSuchAlgorithmException
-
getHmacMD5
public static byte[] getHmacMD5(byte[] key, java.nio.ByteBuffer data) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.InvalidKeyException
-
next
public static byte[] next()16 -
next
public static byte[] next(int num) -
encodeChapPassword
public static byte[] encodeChapPassword(java.lang.String userPassword, byte[] chapChallenge) throws java.security.NoSuchAlgorithmException, java.io.UnsupportedEncodingException- Throws:
java.security.NoSuchAlgorithmExceptionjava.io.UnsupportedEncodingException
-
encodePapPassword
public static byte[] encodePapPassword(byte[] userPassword, byte[] secret, byte[] authenticator) throws java.security.NoSuchAlgorithmException- Throws:
java.security.NoSuchAlgorithmException
-
setChapPassword
public static void setChapPassword(RadiusPacket packet, java.lang.String userPassword) throws java.security.NoSuchAlgorithmException, java.io.UnsupportedEncodingException- Throws:
java.security.NoSuchAlgorithmExceptionjava.io.UnsupportedEncodingException
-
setPapPassword
public static void setPapPassword(RadiusPacket packet, byte[] secret, java.lang.String userPassword) throws java.security.NoSuchAlgorithmException, java.io.UnsupportedEncodingException- Throws:
java.security.NoSuchAlgorithmExceptionjava.io.UnsupportedEncodingException
-
decryptPassword
-
checkChapPassword
public static boolean checkChapPassword(RadiusAttributeSet packet, byte[] authenticator, java.lang.String openPassword) -
checkDigestMD5Password
public static boolean checkDigestMD5Password(RadiusAttributeSet packet, java.lang.String openPassw) -
checkDigestPassword
public static boolean checkDigestPassword(RadiusAttributeSet packet, RadiusAttributeSet response, java.lang.String openPassw) -
checkPassword
public static boolean checkPassword(ru.bitel.bgbilling.kernel.network.radius.nas.Nas<?,?,?> nas, java.lang.String openPassw, RadiusAttributeSet packet, RadiusAttributeSet response, byte[] secret, byte[] authenticator) -
insertToLog
public static int insertToLog(DefaultServerSetup setup, int mid, RadiusPacket packet, java.util.Date logMonthDate) -
addToLog
public static void addToLog(DefaultServerSetup setup, int mid, RadiusPacket packet, java.util.Date logMonthDate, int recordId) -
getNasPort
-