net.jradius.client.auth
Class EAPTLSAuthenticator

java.lang.Object
  extended by net.jradius.client.auth.RadiusAuthenticator
      extended by net.jradius.client.auth.EAPAuthenticator
          extended by net.jradius.client.auth.EAPTLSAuthenticator
Direct Known Subclasses:
EAPTTLSAuthenticator, PEAPAuthenticator

public class EAPTLSAuthenticator
extends net.jradius.client.auth.EAPAuthenticator

EAP-TLS Authentication (and TLS Tunnel support).

Author:
David Bird

Field Summary
protected  int eapFragmentedOffset
           
protected  byte[] eapFragmentedReply
           
static String NAME
           
protected static int TLS_APP_DATA
           
protected static int TLS_CLIENT_HELLO
           
protected static short TLS_HAS_LENGTH
           
protected static short TLS_MORE_FRAGMENTS
           
protected static int TLS_SERVER_HELLO
           
protected static short TLS_START
           
 
Fields inherited from class net.jradius.client.auth.EAPAuthenticator
EAP_AKA, EAP_CISCO_MSCHAPV2, EAP_FAILURE, EAP_GTC, EAP_HEADERLEN, EAP_IDENTITY, EAP_LEAP, EAP_MD5, EAP_MSCHAPV2, EAP_NAK, EAP_NOTIFICATION, EAP_OTP, EAP_PEAP, EAP_REQUEST, EAP_RESPONSE, EAP_SIM, EAP_SUCCESS, EAP_TLS, EAP_TLV, EAP_TTLS, peap, STATE_AUTHENTICATED, STATE_CHALLENGE, STATE_FAILURE, STATE_REJECTED, STATE_SUCCESS
 
Fields inherited from class net.jradius.client.auth.RadiusAuthenticator
classAttribute, client, password, stateAttribute, username
 
Constructor Summary
EAPTLSAuthenticator()
           
 
Method Summary
static org.bouncycastle.crypto.params.AsymmetricKeyParameter createKey(byte[] privateKeyInfoData)
          Create a private key parameter from a PKCS8 PrivateKeyInfo encoding.
static org.bouncycastle.crypto.params.AsymmetricKeyParameter createKey(InputStream inStr)
          Create a private key parameter from a PKCS8 PrivateKeyInfo encoding read from a stream.
static org.bouncycastle.crypto.params.AsymmetricKeyParameter createKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo keyInfo)
          Create a private key parameter from the passed in PKCS8 PrivateKeyInfo object.
 byte[] doEAPType(byte id, byte[] data)
           
protected  boolean doTunnelAuthentication(byte id, byte[] in)
           
protected  byte[] getAppBuffer()
           
 String getAuthName()
           
 String getCaFile()
           
 String getCaFileType()
           
 String getCaPassword()
           
 String getKeyFile()
           
 String getKeyFileType()
           
 String getKeyPassword()
           
 Boolean getTrustAll()
           
 void init()
          Initializs the SSL layer.
protected  boolean isCertificateRequired()
           
protected  byte[] nextFragment()
           
 void putAppBuffer(byte[] b)
           
 void putAppBuffer(byte[] b, int off, int len)
           
 void setCaFile(String caFile)
           
 void setCaFileType(String caFileType)
           
 void setCaPassword(String caPassword)
           
 void setKeyFile(String keyFile)
           
 void setKeyFileType(String keyFileType)
           
 void setKeyPassword(String keyPassword)
           
 void setServerMode()
           
 void setTrustAll(Boolean trustAll)
           
 void setupRequest(net.jradius.client.RadiusClient c, net.jradius.packet.RadiusPacket p)
           
protected  byte[] tlsResponse(byte flags, byte[] data)
           
 
Methods inherited from class net.jradius.client.auth.EAPAuthenticator
doEAP, doEAPType, eapFailure, eapRequest, eapResponse, eapSuccess, getEAPType, getState, isStartWithIdentity, negotiateEAPType, processChallenge, processRequest, setEAPType, setStartWithIdentity, setState, suedoEAPType, tlvSuccess
 
Methods inherited from class net.jradius.client.auth.RadiusAuthenticator
getClassAttribute, getClient, getPassword, getStateAttribute, getUsername, setClient, setPassword, setUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

TLS_START

protected static final short TLS_START
See Also:
Constant Field Values

TLS_MORE_FRAGMENTS

protected static final short TLS_MORE_FRAGMENTS
See Also:
Constant Field Values

TLS_HAS_LENGTH

protected static final short TLS_HAS_LENGTH
See Also:
Constant Field Values

TLS_CLIENT_HELLO

protected static final int TLS_CLIENT_HELLO
See Also:
Constant Field Values

TLS_SERVER_HELLO

protected static final int TLS_SERVER_HELLO
See Also:
Constant Field Values

TLS_APP_DATA

protected static final int TLS_APP_DATA
See Also:
Constant Field Values

eapFragmentedReply

protected byte[] eapFragmentedReply

eapFragmentedOffset

protected int eapFragmentedOffset
Constructor Detail

EAPTLSAuthenticator

public EAPTLSAuthenticator()
Method Detail

setupRequest

public void setupRequest(net.jradius.client.RadiusClient c,
                         net.jradius.packet.RadiusPacket p)
                  throws net.jradius.exception.RadiusException
Overrides:
setupRequest in class net.jradius.client.auth.RadiusAuthenticator
Throws:
net.jradius.exception.RadiusException

init

public void init()
          throws net.jradius.exception.RadiusException
Initializs the SSL layer.

Throws:
Exception
FileNotFoundException
net.jradius.exception.RadiusException

getAuthName

public String getAuthName()
Specified by:
getAuthName in class net.jradius.client.auth.RadiusAuthenticator
See Also:
RadiusAuthenticator.getAuthName()

setServerMode

public void setServerMode()

putAppBuffer

public void putAppBuffer(byte[] b)

putAppBuffer

public void putAppBuffer(byte[] b,
                         int off,
                         int len)

getAppBuffer

protected byte[] getAppBuffer()

doEAPType

public byte[] doEAPType(byte id,
                        byte[] data)
                 throws net.jradius.exception.RadiusException
Specified by:
doEAPType in class net.jradius.client.auth.EAPAuthenticator
Throws:
net.jradius.exception.RadiusException

nextFragment

protected byte[] nextFragment()

tlsResponse

protected byte[] tlsResponse(byte flags,
                             byte[] data)

doTunnelAuthentication

protected boolean doTunnelAuthentication(byte id,
                                         byte[] in)
                                  throws Throwable
Throws:
Throwable

getCaFile

public String getCaFile()

setCaFile

public void setCaFile(String caFile)

getCaFileType

public String getCaFileType()

setCaFileType

public void setCaFileType(String caFileType)

getKeyFile

public String getKeyFile()

setKeyFile

public void setKeyFile(String keyFile)

getKeyFileType

public String getKeyFileType()

setKeyFileType

public void setKeyFileType(String keyFileType)

getKeyPassword

public String getKeyPassword()

setKeyPassword

public void setKeyPassword(String keyPassword)

getCaPassword

public String getCaPassword()

setCaPassword

public void setCaPassword(String caPassword)

getTrustAll

public Boolean getTrustAll()

setTrustAll

public void setTrustAll(Boolean trustAll)

createKey

public static org.bouncycastle.crypto.params.AsymmetricKeyParameter createKey(byte[] privateKeyInfoData)
                                                                       throws IOException
Create a private key parameter from a PKCS8 PrivateKeyInfo encoding.

Parameters:
privateKeyInfoData - the PrivateKeyInfo encoding
Returns:
a suitable private key parameter
Throws:
IOException - on an error decoding the key

createKey

public static org.bouncycastle.crypto.params.AsymmetricKeyParameter createKey(InputStream inStr)
                                                                       throws IOException
Create a private key parameter from a PKCS8 PrivateKeyInfo encoding read from a stream.

Parameters:
inStr - the stream to read the PrivateKeyInfo encoding from
Returns:
a suitable private key parameter
Throws:
IOException - on an error decoding the key

createKey

public static org.bouncycastle.crypto.params.AsymmetricKeyParameter createKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo keyInfo)
                                                                       throws IOException
Create a private key parameter from the passed in PKCS8 PrivateKeyInfo object.

Parameters:
keyInfo - the PrivateKeyInfo object containing the key material
Returns:
a suitable private key parameter
Throws:
IOException - on an error decoding the key

isCertificateRequired

protected boolean isCertificateRequired()


Copyright © 2011 Coova Technologies, LLC, All Rights Reserved.