directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r264844 [4/6] - in /directory/shared/kerberos/trunk/common: ./ src/java/org/apache/kerberos/chain/ src/java/org/apache/kerberos/chain/impl/ src/java/org/apache/kerberos/crypto/ src/java/org/apache/kerberos/crypto/checksum/ src/java/org/apac...
Date Tue, 30 Aug 2005 20:04:01 GMT
Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/AuthenticatorModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/AuthenticatorModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/AuthenticatorModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/AuthenticatorModifier.java Tue Aug 30 13:02:20 2005
@@ -16,55 +16,77 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.messages.value.AuthorizationData;
+import org.apache.kerberos.messages.value.Checksum;
+import org.apache.kerberos.messages.value.EncryptionKey;
+import org.apache.kerberos.messages.value.KerberosPrincipalModifier;
+import org.apache.kerberos.messages.value.KerberosTime;
+import org.apache.kerberos.messages.value.PrincipalName;
 
-public class AuthenticatorModifier {
-	
-	private int                       _versionNumber;
-	private KerberosPrincipalModifier _clientModifier = new KerberosPrincipalModifier();
-	private Checksum                  _checksum;
-	private int                       _clientMicroSecond;
-	private KerberosTime              _clientTime;
-	private EncryptionKey             _subSessionKey;
-	private int                       _sequenceNumber;
-	private AuthorizationData         _authorizationData;
-	
-	public Authenticator getAuthenticator() {
-		
-		KerberosPrincipal clientPrincipal = _clientModifier.getKerberosPrincipal();
-		
-		return new Authenticator(_versionNumber, clientPrincipal, _checksum, _clientMicroSecond,
-			_clientTime, _subSessionKey, _sequenceNumber, _authorizationData);
-	}
-	
-	public void setVersionNumber(int versionNumber) {
-		_versionNumber = versionNumber;
-	}
-	public void setClientName(PrincipalName name) {
-		_clientModifier.setPrincipalName(name);
-	}
-	public void setClientRealm(String realm) {
-		_clientModifier.setRealm(realm);
-	}
-	public void setAuthorizationData(AuthorizationData data) {
-		_authorizationData = data;
-	}
-	public void setChecksum(Checksum checksum) {
-		_checksum = checksum;
-	}
-	public void setClientMicroSecond(int microSecond) {
-		_clientMicroSecond = microSecond;
-	}
-	public void setClientTime(KerberosTime time) {
-		_clientTime = time;
-	}
-	public void setSequenceNumber(int number) {
-		_sequenceNumber = number;
-	}
-	public void setSubSessionKey(EncryptionKey sessionKey) {
-		_subSessionKey = sessionKey;
-	}
-}
+public class AuthenticatorModifier
+{
+	private int                       versionNumber;
+	private KerberosPrincipalModifier clientModifier = new KerberosPrincipalModifier();
+	private Checksum                  checksum;
+	private int                       clientMicroSecond;
+	private KerberosTime              clientTime;
+	private EncryptionKey             subSessionKey;
+	private int                       sequenceNumber;
+	private AuthorizationData         authorizationData;
+
+	public Authenticator getAuthenticator()
+    {
+
+        KerberosPrincipal clientPrincipal = clientModifier.getKerberosPrincipal();
+
+        return new Authenticator( versionNumber, clientPrincipal, checksum, clientMicroSecond,
+                clientTime, subSessionKey, sequenceNumber, authorizationData );
+    }
+
+    public void setVersionNumber( int versionNumber )
+    {
+        this.versionNumber = versionNumber;
+    }
+
+    public void setClientName( PrincipalName name )
+    {
+        clientModifier.setPrincipalName( name );
+    }
+
+    public void setClientRealm( String realm )
+    {
+        clientModifier.setRealm( realm );
+    }
 
+    public void setAuthorizationData( AuthorizationData data )
+    {
+        authorizationData = data;
+    }
+
+    public void setChecksum( Checksum checksum )
+    {
+        this.checksum = checksum;
+    }
+
+    public void setClientMicroSecond( int microSecond )
+    {
+        clientMicroSecond = microSecond;
+    }
+
+    public void setClientTime( KerberosTime time )
+    {
+        clientTime = time;
+    }
+
+    public void setSequenceNumber( int number )
+    {
+        sequenceNumber = number;
+    }
+
+    public void setSubSessionKey( EncryptionKey sessionKey )
+    {
+        subSessionKey = sessionKey;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPart.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPart.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPart.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPart.java Tue Aug 30 13:02:20 2005
@@ -16,41 +16,49 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.*;
-import org.apache.kerberos.messages.value.*;
+import org.apache.kerberos.messages.KerberosMessage;
+import org.apache.kerberos.messages.MessageType;
+import org.apache.kerberos.messages.value.EncryptionKey;
+import org.apache.kerberos.messages.value.KerberosTime;
 
 /**
  * Encrypted part of the application response
  */
-public class EncApRepPart extends KerberosMessage {
+public class EncApRepPart extends KerberosMessage
+{
+    private KerberosTime  clientTime;
+    private int           cusec;
+    private EncryptionKey subSessionKey; //optional
+    private Integer       sequenceNumber; //optional
 
-	private KerberosTime  _clientTime;
-	private int           _cusec;
-	private EncryptionKey _subSessionKey;  //optional
-	private Integer       _sequenceNumber; //optional
-
-	public EncApRepPart(KerberosTime clientTime, int cusec, EncryptionKey subSessionKey,
-			Integer sequenceNumber) {
-		
-		super(MessageType.ENC_AP_REP_PART);
-		
-		_clientTime     = clientTime;
-		_cusec          = cusec;
-		_subSessionKey  = subSessionKey;
-		_sequenceNumber = sequenceNumber;
-	}
-	
-	public KerberosTime getClientTime() {
-		return _clientTime;
-	}
-	public int getClientMicroSecond() {
-		return _cusec;
-	}
-	public Integer getSequenceNumber() {
-		return _sequenceNumber;
-	}
-	public EncryptionKey getSubSessionKey() {
-		return _subSessionKey;
-	}
-}
+    public EncApRepPart( KerberosTime clientTime, int cusec, EncryptionKey subSessionKey,
+            Integer sequenceNumber )
+    {
+        super( MessageType.ENC_AP_REP_PART );
+
+        this.clientTime     = clientTime;
+        this.cusec          = cusec;
+        this.subSessionKey  = subSessionKey;
+        this.sequenceNumber = sequenceNumber;
+    }
+
+    public KerberosTime getClientTime()
+    {
+        return clientTime;
+    }
 
+    public int getClientMicroSecond()
+    {
+        return cusec;
+    }
+
+    public Integer getSequenceNumber()
+    {
+        return sequenceNumber;
+    }
+
+    public EncryptionKey getSubSessionKey()
+    {
+        return subSessionKey;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPartModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPartModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPartModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPartModifier.java Tue Aug 30 13:02:20 2005
@@ -16,31 +16,38 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import org.apache.kerberos.messages.value.EncryptionKey;
+import org.apache.kerberos.messages.value.KerberosTime;
 
-public class EncApRepPartModifier {
+public class EncApRepPartModifier
+{
+    private KerberosTime  clientTime;
+    private int           cusec;
+    private EncryptionKey subSessionKey; //optional
+    private Integer       sequenceNumber; //optional
 
-	private KerberosTime  _clientTime;
-	private int           _cusec;
-	private EncryptionKey _subSessionKey;  //optional
-	private Integer       _sequenceNumber; //optional
-
-	public EncApRepPart getEncApRepPart() {
-		
-		return new EncApRepPart(_clientTime, _cusec, _subSessionKey, _sequenceNumber);
-	}
-	
-	public void setClientTime(KerberosTime clientTime) {
-		_clientTime = clientTime;
-	}
-	public void setClientMicroSecond(int cusec) {
-		_cusec = cusec;
-	}
-	public void setSubSessionKey(EncryptionKey subSessionKey) {
-		_subSessionKey = subSessionKey;
-	}
-	public void setSequenceNumber(Integer sequenceNumber) {
-		_sequenceNumber = sequenceNumber;
-	}
-}
+    public EncApRepPart getEncApRepPart()
+    {
+        return new EncApRepPart( clientTime, cusec, subSessionKey, sequenceNumber );
+    }
+
+    public void setClientTime( KerberosTime clientTime )
+    {
+        this.clientTime = clientTime;
+    }
+
+    public void setClientMicroSecond( int cusec )
+    {
+        this.cusec = cusec;
+    }
 
+    public void setSubSessionKey( EncryptionKey subSessionKey )
+    {
+        this.subSessionKey = subSessionKey;
+    }
+
+    public void setSequenceNumber( Integer sequenceNumber )
+    {
+        this.sequenceNumber = sequenceNumber;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncAsRepPart.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncAsRepPart.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncAsRepPart.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncAsRepPart.java Tue Aug 30 13:02:20 2005
@@ -16,26 +16,28 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.messages.value.EncryptionKey;
+import org.apache.kerberos.messages.value.HostAddresses;
+import org.apache.kerberos.messages.value.KerberosTime;
+import org.apache.kerberos.messages.value.LastRequest;
+import org.apache.kerberos.messages.value.TicketFlags;
 
 /**
  * Encrypted part of the authentication service response
  */
-public class EncAsRepPart extends EncKdcRepPart {
-
-	/**
-	 * Class constructor
-	 */
-	public EncAsRepPart(EncryptionKey key, LastRequest lastReq, int nonce,
-			KerberosTime keyExpiration, TicketFlags flags, KerberosTime authTime,
-			KerberosTime startTime, KerberosTime endTime, KerberosTime renewTill,
-			KerberosPrincipal serverPrincipal, HostAddresses caddr) {
-		
-		super(key, lastReq, nonce, keyExpiration, flags, authTime,
-				startTime, endTime, renewTill, serverPrincipal, caddr,
-				MessageComponentType.KRB_ENC_AS_REP_PART);
-	}
+public class EncAsRepPart extends EncKdcRepPart
+{
+    /**
+     * Class constructor
+     */
+    public EncAsRepPart( EncryptionKey key, LastRequest lastReq, int nonce,
+            KerberosTime keyExpiration, TicketFlags flags, KerberosTime authTime,
+            KerberosTime startTime, KerberosTime endTime, KerberosTime renewTill,
+            KerberosPrincipal serverPrincipal, HostAddresses caddr )
+    {
+        super( key, lastReq, nonce, keyExpiration, flags, authTime, startTime, endTime, renewTill,
+                serverPrincipal, caddr, MessageComponentType.KRB_ENC_AS_REP_PART );
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKdcRepPart.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKdcRepPart.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKdcRepPart.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKdcRepPart.java Tue Aug 30 13:02:20 2005
@@ -16,128 +16,179 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.messages.value.EncryptionKey;
+import org.apache.kerberos.messages.value.HostAddresses;
+import org.apache.kerberos.messages.value.KerberosTime;
+import org.apache.kerberos.messages.value.LastRequest;
+import org.apache.kerberos.messages.value.TicketFlags;
 
 /**
  * Base class for encrypted parts of KDC responses
  */
-public class EncKdcRepPart {
-
-	private EncryptionKey        _key;
-	private LastRequest          _lastRequest;
-	private int                  _nonce;
-	private KerberosTime         _keyExpiration;   //optional
-	private TicketFlags          _flags = new TicketFlags();
-	private KerberosTime         _authTime;
-	private KerberosTime         _startTime;       //optional
-	private KerberosTime         _endTime;
-	private KerberosTime         _renewTill;       //optional
-	private KerberosPrincipal    _serverPrincipal;
-	private HostAddresses        _clientAddresses; //optional
-	private MessageComponentType _componentType;
+public class EncKdcRepPart
+{
+	private EncryptionKey        key;
+	private LastRequest          lastRequest;
+	private int                  nonce;
+	private KerberosTime         keyExpiration;   //optional
+	private TicketFlags          flags = new TicketFlags();
+	private KerberosTime         authTime;
+	private KerberosTime         startTime;       //optional
+	private KerberosTime         endTime;
+	private KerberosTime         renewTill;       //optional
+	private KerberosPrincipal    serverPrincipal;
+	private HostAddresses        clientAddresses; //optional
+	private MessageComponentType componentType;
 
 	/**
-	 * Class constructors
-	 */
-	public EncKdcRepPart() {
-		// built up by setter during reply generation
-	}
-	
-	public EncKdcRepPart(EncryptionKey key, LastRequest lastReq, int nonce,
-			KerberosTime keyExpiration, TicketFlags flags, KerberosTime authtime,
-			KerberosTime starttime, KerberosTime endtime, KerberosTime renewTill,
-			KerberosPrincipal serverPrincipal, HostAddresses caddr, MessageComponentType componentType) {
-		
-		_key             = key;
-		_lastRequest     = lastReq;
-		_nonce           = nonce;
-		_keyExpiration   = keyExpiration;
-		_flags           = flags;
-		_authTime        = authtime;
-		_startTime       = starttime;
-		_endTime         = endtime;
-		_renewTill       = renewTill;
-		_serverPrincipal = serverPrincipal;
-		_clientAddresses = caddr;
-		_componentType   = componentType;
-	}
-	
-	// getters
-	public KerberosTime getAuthTime() {
-		return _authTime;
-	}
-	public HostAddresses getClientAddresses() {
-		return _clientAddresses;
-	}
-	public KerberosTime getEndTime() {
-		return _endTime;
-	}
-	public TicketFlags getFlags() {
-		return _flags;
-	}
-	public EncryptionKey getKey() {
-		return _key;
-	}
-	public KerberosTime getKeyExpiration() {
-		return _keyExpiration;
-	}
-	public LastRequest getLastRequest() {
-		return _lastRequest;
-	}
-	public int getNonce() {
-		return _nonce;
-	}
-	public KerberosTime getRenewTill() {
-		return _renewTill;
-	}
-	public KerberosPrincipal getServerPrincipal() {
-		return _serverPrincipal;
-	}
-	public String getServerRealm() {
-		return _serverPrincipal.getRealm();
-	}
-	public KerberosTime getStartTime() {
-		return _startTime;
-	}
-	public MessageComponentType getComponentType() {
-		return _componentType;
-	}
-	
-	// setters
-	public void setAuthTime(KerberosTime time) {
-		_authTime = time;
-	}
-	public void setClientAddresses(HostAddresses addresses) {
-		_clientAddresses = addresses;
-	}
-	public void setEndTime(KerberosTime time) {
-		_endTime = time;
-	}
-	public void setFlags(TicketFlags flags) {
-		_flags = flags;
-	}
-	public void setKey(EncryptionKey key) {
-		_key = key;
-	}
-	public void setKeyExpiration(KerberosTime expiration) {
-		_keyExpiration = expiration;
-	}
-	public void setLastRequest(LastRequest request) {
-		_lastRequest = request;
-	}
-	public void setNonce(int nonce) {
-		_nonce = nonce;
-	}
-	public void setRenewTill(KerberosTime till) {
-		_renewTill = till;
-	}
-	public void setServerPrincipal(KerberosPrincipal principal) {
-		_serverPrincipal = principal;
-	}
-	public void setStartTime(KerberosTime time) {
-		_startTime = time;
+     * Class constructors
+     */
+    public EncKdcRepPart()
+    {
+        // built up by setter during reply generation
+    }
+
+    public EncKdcRepPart( EncryptionKey key, LastRequest lastReq, int nonce,
+            KerberosTime keyExpiration, TicketFlags flags, KerberosTime authtime,
+            KerberosTime starttime, KerberosTime endtime, KerberosTime renewTill,
+            KerberosPrincipal serverPrincipal, HostAddresses caddr,
+            MessageComponentType componentType )
+    {
+		this.key             = key;
+		this.lastRequest     = lastReq;
+		this.nonce           = nonce;
+		this.keyExpiration   = keyExpiration;
+		this.flags           = flags;
+		this.authTime        = authtime;
+		this.startTime       = starttime;
+		this.endTime         = endtime;
+		this.renewTill       = renewTill;
+		this.serverPrincipal = serverPrincipal;
+		this.clientAddresses = caddr;
+		this.componentType   = componentType;
 	}
-}
 
+    // getters
+    public KerberosTime getAuthTime()
+    {
+        return authTime;
+    }
+
+    public HostAddresses getClientAddresses()
+    {
+        return clientAddresses;
+    }
+
+    public KerberosTime getEndTime()
+    {
+        return endTime;
+    }
+
+    public TicketFlags getFlags()
+    {
+        return flags;
+    }
+
+    public EncryptionKey getKey()
+    {
+        return key;
+    }
+
+    public KerberosTime getKeyExpiration()
+    {
+        return keyExpiration;
+    }
+
+    public LastRequest getLastRequest()
+    {
+        return lastRequest;
+    }
+
+    public int getNonce()
+    {
+        return nonce;
+    }
+
+    public KerberosTime getRenewTill()
+    {
+        return renewTill;
+    }
+
+    public KerberosPrincipal getServerPrincipal()
+    {
+        return serverPrincipal;
+    }
+
+    public String getServerRealm()
+    {
+        return serverPrincipal.getRealm();
+    }
+
+    public KerberosTime getStartTime()
+    {
+        return startTime;
+    }
+
+    public MessageComponentType getComponentType()
+    {
+        return componentType;
+    }
+
+    // setters
+    public void setAuthTime( KerberosTime time )
+    {
+        authTime = time;
+    }
+
+    public void setClientAddresses( HostAddresses addresses )
+    {
+        clientAddresses = addresses;
+    }
+
+    public void setEndTime( KerberosTime time )
+    {
+        endTime = time;
+    }
+
+    public void setFlags( TicketFlags flags )
+    {
+        this.flags = flags;
+    }
+
+    public void setKey( EncryptionKey key )
+    {
+        this.key = key;
+    }
+
+    public void setKeyExpiration( KerberosTime expiration )
+    {
+        keyExpiration = expiration;
+    }
+
+    public void setLastRequest( LastRequest request )
+    {
+        lastRequest = request;
+    }
+
+    public void setNonce( int nonce )
+    {
+        this.nonce = nonce;
+    }
+
+    public void setRenewTill( KerberosTime till )
+    {
+        renewTill = till;
+    }
+
+    public void setServerPrincipal( KerberosPrincipal principal )
+    {
+        serverPrincipal = principal;
+    }
+
+    public void setStartTime( KerberosTime time )
+    {
+        startTime = time;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbCredPart.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbCredPart.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbCredPart.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbCredPart.java Tue Aug 30 13:02:20 2005
@@ -16,33 +16,34 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import org.apache.kerberos.messages.value.HostAddress;
+import org.apache.kerberos.messages.value.HostAddresses;
+import org.apache.kerberos.messages.value.KerberosTime;
+import org.apache.kerberos.messages.value.KrbCredInfo;
 
 /**
  * Encrypted part of credential message types
  */
-public class EncKrbCredPart {
-
-	public KrbCredInfo[] _ticketInfo;
-	public Integer       _nonce;     //optional
-	public KerberosTime  _timeStamp; //optional
-	public Integer       _usec;      //optional
-	public HostAddress   _sAddress;  //optional
-	public HostAddresses _rAddress;  //optional
+public class EncKrbCredPart
+{
+	public KrbCredInfo[] ticketInfo;
+	public Integer       nonce;     //optional
+	public KerberosTime  timeStamp; //optional
+	public Integer       usec;      //optional
+	public HostAddress   sAddress;  //optional
+	public HostAddresses rAddress;  //optional
 
 	/**
-	 * Class constructor
-	 */
-	public EncKrbCredPart(KrbCredInfo[] ticketInfo, KerberosTime timeStamp,
-			Integer usec, Integer nonce, HostAddress sAddress,
-			HostAddresses rAddress) {
-		
-		_ticketInfo = ticketInfo;
-		_nonce      = nonce;
-		_timeStamp  = timeStamp;
-		_usec       = usec;
-		_sAddress   = sAddress;
-		_rAddress   = rAddress;
-	}
+     * Class constructor
+     */
+    public EncKrbCredPart( KrbCredInfo[] ticketInfo, KerberosTime timeStamp, Integer usec,
+            Integer nonce, HostAddress sAddress, HostAddresses rAddress )
+    {
+        this.ticketInfo = ticketInfo;
+        this.nonce      = nonce;
+        this.timeStamp  = timeStamp;
+        this.usec       = usec;
+        this.sAddress   = sAddress;
+        this.rAddress   = rAddress;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPart.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPart.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPart.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPart.java Tue Aug 30 13:02:20 2005
@@ -16,51 +16,63 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.*;
-import org.apache.kerberos.messages.value.*;
+import org.apache.kerberos.messages.KerberosMessage;
+import org.apache.kerberos.messages.MessageType;
+import org.apache.kerberos.messages.value.HostAddress;
+import org.apache.kerberos.messages.value.KerberosTime;
 
 /**
  * Encrypted part of private messages
  */
-public class EncKrbPrivPart extends KerberosMessage {
+public class EncKrbPrivPart extends KerberosMessage
+{
+	private byte[]       userData;
+	private KerberosTime timestamp;        //optional
+	private Integer      usec;             //optional
+	private Integer      sequenceNumber;   //optional
+	private HostAddress  senderAddress;    //optional
+	private HostAddress  recipientAddress; //optional
 
-	private byte[]       _userData;
-	private KerberosTime _timestamp;        //optional
-	private Integer      _usec;             //optional
-	private Integer      _sequenceNumber;   //optional
-	private HostAddress  _senderAddress;    //optional
-	private HostAddress  _recipientAddress; //optional
-
-	public EncKrbPrivPart(byte[] userData, KerberosTime timestamp, Integer usec,
-			Integer sequenceNumber, HostAddress senderAddress, HostAddress recipientAddress) {
-		
-		super(MessageType.ENC_PRIV_PART);
+	public EncKrbPrivPart( byte[] userData, KerberosTime timestamp, Integer usec,
+            Integer sequenceNumber, HostAddress senderAddress, HostAddress recipientAddress )
+    {
+        super( MessageType.ENC_PRIV_PART );
 		
-		_userData         = userData;
-		_timestamp        = timestamp;
-		_usec             = usec;
-		_sequenceNumber   = sequenceNumber;
-		_senderAddress    = senderAddress;
-		_recipientAddress = recipientAddress;
+		this.userData         = userData;
+		this.timestamp        = timestamp;
+		this.usec             = usec;
+		this.sequenceNumber   = sequenceNumber;
+		this.senderAddress    = senderAddress;
+		this.recipientAddress = recipientAddress;
 	}
 
-	public HostAddress getRecipientAddress() {
-		return _recipientAddress;
-	}
-	public HostAddress getSenderAddress() {
-		return _senderAddress;
-	}
-	public Integer getSequenceNumber() {
-		return _sequenceNumber;
-	}
-	public KerberosTime getTimestamp() {
-		return _timestamp;
-	}
-	public Integer getMicroSecond() {
-		return _usec;
-	}
-	public byte[] getUserData() {
-		return _userData;
-	}
-}
+    public HostAddress getRecipientAddress()
+    {
+        return recipientAddress;
+    }
+
+    public HostAddress getSenderAddress()
+    {
+        return senderAddress;
+    }
+
+    public Integer getSequenceNumber()
+    {
+        return sequenceNumber;
+    }
 
+    public KerberosTime getTimestamp()
+    {
+        return timestamp;
+    }
+
+    public Integer getMicroSecond()
+    {
+        return usec;
+    }
+
+    public byte[] getUserData()
+    {
+        return userData;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPartModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPartModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPartModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPartModifier.java Tue Aug 30 13:02:20 2005
@@ -16,40 +16,51 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import org.apache.kerberos.messages.value.HostAddress;
+import org.apache.kerberos.messages.value.KerberosTime;
 
-public class EncKrbPrivPartModifier {
+public class EncKrbPrivPartModifier
+{
+	private byte[]       userData;
+	private KerberosTime timestamp;        //optional
+	private Integer      usec;             //optional
+	private Integer      sequenceNumber;   //optional
+	private HostAddress  senderAddress;    //optional
+	private HostAddress  recipientAddress; //optional
 
-	private byte[]       _userData;
-	private KerberosTime _timestamp;        //optional
-	private Integer      _usec;             //optional
-	private Integer      _sequenceNumber;   //optional
-	private HostAddress  _senderAddress;    //optional
-	private HostAddress  _recipientAddress; //optional
-
-	public EncKrbPrivPart getEncKrbPrivPart() {
-		
-		return new EncKrbPrivPart(_userData, _timestamp, _usec, _sequenceNumber,
-				_senderAddress, _recipientAddress);
-	}
-
-	public void setRecipientAddress(HostAddress address) {
-		_recipientAddress = address;
-	}
-	public void setSenderAddress(HostAddress address) {
-		_senderAddress = address;
-	}
-	public void setSequenceNumber(Integer number) {
-		_sequenceNumber = number;
-	}
-	public void setTimestamp(KerberosTime timestamp) {
-		_timestamp = timestamp;
-	}
-	public void setMicroSecond(Integer usec) {
-		_usec = usec;
-	}
-	public void setUserData(byte[] data) {
-		_userData = data;
-	}
-}
+	public EncKrbPrivPart getEncKrbPrivPart()
+    {
+        return new EncKrbPrivPart( userData, timestamp, usec, sequenceNumber, senderAddress,
+                recipientAddress );
+    }
+
+    public void setRecipientAddress( HostAddress address )
+    {
+        recipientAddress = address;
+    }
+
+    public void setSenderAddress( HostAddress address )
+    {
+        senderAddress = address;
+    }
+
+    public void setSequenceNumber( Integer number )
+    {
+        sequenceNumber = number;
+    }
 
+    public void setTimestamp( KerberosTime timestamp )
+    {
+        this.timestamp = timestamp;
+    }
+
+    public void setMicroSecond( Integer usec )
+    {
+        this.usec = usec;
+    }
+
+    public void setUserData( byte[] data )
+    {
+        userData = data;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTgsRepPart.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTgsRepPart.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTgsRepPart.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTgsRepPart.java Tue Aug 30 13:02:20 2005
@@ -16,26 +16,29 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.messages.value.EncryptionKey;
+import org.apache.kerberos.messages.value.HostAddresses;
+import org.apache.kerberos.messages.value.KerberosTime;
+import org.apache.kerberos.messages.value.LastRequest;
+import org.apache.kerberos.messages.value.TicketFlags;
 
 /**
  * Encrypted part of TGS responses
  */
-public class EncTgsRepPart extends EncKdcRepPart {
+public class EncTgsRepPart extends EncKdcRepPart
+{
+    /**
+     * Class constructor
+     */
+    public EncTgsRepPart( EncryptionKey key, LastRequest lastReq, int nonce,
+            KerberosTime keyExpiration, TicketFlags flags, KerberosTime authtime,
+            KerberosTime starttime, KerberosTime endtime, KerberosTime renewTill,
+            KerberosPrincipal serverPrincipal, HostAddresses caddr )
+    {
 
-	/**
-	 * Class constructor
-	 */
-	public EncTgsRepPart(EncryptionKey key, LastRequest lastReq, int nonce,
-			KerberosTime keyExpiration, TicketFlags flags, KerberosTime authtime,
-			KerberosTime starttime, KerberosTime endtime, KerberosTime renewTill,
-			KerberosPrincipal serverPrincipal, HostAddresses caddr) {
-		
-		super(key, lastReq, nonce, keyExpiration, flags, authtime,
-				starttime, endtime, renewTill, serverPrincipal, caddr,
-				MessageComponentType.KRB_ENC_TGS_REP_PART);
-	}
+        super( key, lastReq, nonce, keyExpiration, flags, authtime, starttime, endtime, renewTill,
+                serverPrincipal, caddr, MessageComponentType.KRB_ENC_TGS_REP_PART );
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTicketPart.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTicketPart.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTicketPart.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTicketPart.java Tue Aug 30 13:02:20 2005
@@ -16,75 +16,100 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.messages.value.AuthorizationData;
+import org.apache.kerberos.messages.value.EncryptionKey;
+import org.apache.kerberos.messages.value.HostAddresses;
+import org.apache.kerberos.messages.value.KerberosTime;
+import org.apache.kerberos.messages.value.TicketFlags;
+import org.apache.kerberos.messages.value.TransitedEncoding;
 
 /**
  * Encrypted part of Tickets
  */
-public class EncTicketPart {
-
-	private TicketFlags       _flags;
-	private EncryptionKey     _sessionKey;
-	private KerberosPrincipal _clientPrincipal;
-	private TransitedEncoding _transitedEncoding;
-	private KerberosTime      _authtime;
-	private KerberosTime      _startTime;         //optional
-	private KerberosTime      _endTime;
-	private KerberosTime      _renewTill;         //optional
-	private HostAddresses     _clientAddresses;   //optional
-	private AuthorizationData _authorizationData; //optional
+public class EncTicketPart
+{
+	private TicketFlags       flags;
+	private EncryptionKey     sessionKey;
+	private KerberosPrincipal clientPrincipal;
+	private TransitedEncoding transitedEncoding;
+	private KerberosTime      authtime;
+	private KerberosTime      startTime;         //optional
+	private KerberosTime      endTime;
+	private KerberosTime      renewTill;         //optional
+	private HostAddresses     clientAddresses;   //optional
+	private AuthorizationData authorizationData; //optional
 
 	public EncTicketPart(TicketFlags flags, EncryptionKey key, KerberosPrincipal clientPrincipal,
 			TransitedEncoding transited, KerberosTime authtime, KerberosTime starttime,
 			KerberosTime endtime, KerberosTime renewTill, HostAddresses caddr,
 			AuthorizationData authorizationData) {
 		
-		_flags             = flags;
-		_sessionKey        = key;
-		_clientPrincipal   = clientPrincipal;
-		_transitedEncoding = transited;
-		_authtime          = authtime;
-		_startTime         = starttime;
-		_endTime           = endtime;
-		_renewTill         = renewTill;
-		_clientAddresses   = caddr;
-		_authorizationData = authorizationData;
-	}
-
-	public AuthorizationData getAuthorizationData() {
-		return _authorizationData;
-	}
-	public KerberosTime getAuthTime() {
-		return _authtime;
-	}
-	public HostAddresses getClientAddresses() {
-		return _clientAddresses;
-	}
-	public KerberosPrincipal getClientPrincipal() {
-		return _clientPrincipal;
-	}
-	public String getClientRealm() {
-		return _clientPrincipal.getRealm();
-	}
-	public KerberosTime getEndTime() {
-		return _endTime;
-	}
-	public TicketFlags getFlags() {
-		return _flags;
-	}
-	public EncryptionKey getSessionKey() {
-		return _sessionKey;
-	}
-	public KerberosTime getRenewTill() {
-		return _renewTill;
-	}
-	public KerberosTime getStartTime() {
-		return _startTime;
-	}
-	public TransitedEncoding getTransitedEncoding() {
-		return _transitedEncoding;
-	}
+        this.flags             = flags;
+        this.sessionKey        = key;
+        this.clientPrincipal   = clientPrincipal;
+        this.transitedEncoding = transited;
+        this.authtime          = authtime;
+        this.startTime         = starttime;
+        this.endTime           = endtime;
+        this.renewTill         = renewTill;
+        this.clientAddresses   = caddr;
+        this.authorizationData = authorizationData;
+	}
+
+    public AuthorizationData getAuthorizationData()
+    {
+        return authorizationData;
+    }
+
+    public KerberosTime getAuthTime()
+    {
+        return authtime;
+    }
+
+    public HostAddresses getClientAddresses()
+    {
+        return clientAddresses;
+    }
+
+    public KerberosPrincipal getClientPrincipal()
+    {
+        return clientPrincipal;
+    }
+
+    public String getClientRealm()
+    {
+        return clientPrincipal.getRealm();
+    }
+
+    public KerberosTime getEndTime()
+    {
+        return endTime;
+    }
+
+    public TicketFlags getFlags()
+    {
+        return flags;
+    }
+
+    public EncryptionKey getSessionKey()
+    {
+        return sessionKey;
+    }
+
+    public KerberosTime getRenewTill()
+    {
+        return renewTill;
+    }
+
+    public KerberosTime getStartTime()
+    {
+        return startTime;
+    }
+
+    public TransitedEncoding getTransitedEncoding()
+    {
+        return transitedEncoding;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTicketPartModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTicketPartModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTicketPartModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncTicketPartModifier.java Tue Aug 30 13:02:20 2005
@@ -16,78 +16,112 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.messages.value.AuthorizationData;
+import org.apache.kerberos.messages.value.EncryptionKey;
+import org.apache.kerberos.messages.value.HostAddresses;
+import org.apache.kerberos.messages.value.KerberosPrincipalModifier;
+import org.apache.kerberos.messages.value.KerberosTime;
+import org.apache.kerberos.messages.value.PrincipalName;
+import org.apache.kerberos.messages.value.TicketFlags;
+import org.apache.kerberos.messages.value.TransitedEncoding;
 
 /**
  * Encrypted part of Tickets
  */
-public class EncTicketPartModifier {
+public class EncTicketPartModifier
+{
+	private TicketFlags               flags = new TicketFlags();
+	private EncryptionKey             sessionKey;
+	private KerberosPrincipalModifier modifier = new KerberosPrincipalModifier();
+	private KerberosPrincipal         clientPrincipal;
+	private TransitedEncoding         transitedEncoding;
+	private KerberosTime              authTime;
+	private KerberosTime              startTime;         //optional
+	private KerberosTime              endTime;
+	private KerberosTime              renewTill;         //optional
+	private HostAddresses             clientAddresses;   //optional
+	private AuthorizationData         authorizationData; //optional
 
-	private TicketFlags               _flags = new TicketFlags();
-	private EncryptionKey             _sessionKey;
-	private KerberosPrincipalModifier _modifier = new KerberosPrincipalModifier();
-	private KerberosPrincipal         _clientPrincipal;
-	private TransitedEncoding         _transitedEncoding;
-	private KerberosTime              _authTime;
-	private KerberosTime              _startTime;         //optional
-	private KerberosTime              _endTime;
-	private KerberosTime              _renewTill;         //optional
-	private HostAddresses             _clientAddresses;   //optional
-	private AuthorizationData         _authorizationData; //optional
-
-	public EncTicketPart getEncTicketPart() {
-		
-		if (_clientPrincipal == null) {
-			_clientPrincipal = _modifier.getKerberosPrincipal();
-		}
-		
-		return new EncTicketPart(_flags, _sessionKey, _clientPrincipal, _transitedEncoding,
-			_authTime, _startTime, _endTime, _renewTill, _clientAddresses, _authorizationData);
-	}
-	
-	public void setClientName(PrincipalName name) {
-		_modifier.setPrincipalName(name);
-	}
-	public void setClientRealm(String realm) {
-		_modifier.setRealm(realm);
-	}
-	public void setClientPrincipal(KerberosPrincipal principal) {
-		_clientPrincipal = principal;
-	}
-	public void setAuthorizationData(AuthorizationData data) {
-		_authorizationData = data;
-	}
-	public void setAuthTime(KerberosTime authtime) {
-		_authTime = authtime;
-	}
-	public void setClientAddresses(HostAddresses addresses) {
-		_clientAddresses = addresses;
-	}
-	public void setEndTime(KerberosTime time) {
-		_endTime = time;
-	}
-	public void setFlags(TicketFlags flags) {
-		_flags = flags;
-	}
-	public void setFlag(int flag) {
-		_flags.set(flag);
-	}
-	public void clearFlag(int flag) {
-		_flags.clear(flag);
-	}
-	public void setRenewTill(KerberosTime till) {
-		_renewTill = till;
-	}
-	public void setSessionKey(EncryptionKey key) {
-		_sessionKey = key;
-	}
-	public void setStartTime(KerberosTime time) {
-		_startTime = time;
-	}
-	public void setTransitedEncoding(TransitedEncoding encoding) {
-		_transitedEncoding = encoding;
-	}
-}
+	public EncTicketPart getEncTicketPart()
+    {
+        if ( clientPrincipal == null )
+        {
+            clientPrincipal = modifier.getKerberosPrincipal();
+        }
+
+        return new EncTicketPart( flags, sessionKey, clientPrincipal, transitedEncoding, authTime,
+                startTime, endTime, renewTill, clientAddresses, authorizationData );
+    }
+
+    public void setClientName( PrincipalName name )
+    {
+        modifier.setPrincipalName( name );
+    }
+
+    public void setClientRealm( String realm )
+    {
+        modifier.setRealm( realm );
+    }
+
+    public void setClientPrincipal( KerberosPrincipal principal )
+    {
+        clientPrincipal = principal;
+    }
+
+    public void setAuthorizationData( AuthorizationData data )
+    {
+        authorizationData = data;
+    }
+
+    public void setAuthTime( KerberosTime authtime )
+    {
+        authTime = authtime;
+    }
+
+    public void setClientAddresses( HostAddresses addresses )
+    {
+        clientAddresses = addresses;
+    }
 
+    public void setEndTime( KerberosTime time )
+    {
+        endTime = time;
+    }
+
+    public void setFlags( TicketFlags flags )
+    {
+        this.flags = flags;
+    }
+
+    public void setFlag( int flag )
+    {
+        flags.set( flag );
+    }
+
+    public void clearFlag( int flag )
+    {
+        flags.clear( flag );
+    }
+
+    public void setRenewTill( KerberosTime till )
+    {
+        renewTill = till;
+    }
+
+    public void setSessionKey( EncryptionKey key )
+    {
+        sessionKey = key;
+    }
+
+    public void setStartTime( KerberosTime time )
+    {
+        startTime = time;
+    }
+
+    public void setTransitedEncoding( TransitedEncoding encoding )
+    {
+        transitedEncoding = encoding;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/MessageComponentType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/MessageComponentType.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/MessageComponentType.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/MessageComponentType.java Tue Aug 30 13:02:20 2005
@@ -16,12 +16,15 @@
  */
 package org.apache.kerberos.messages.components;
 
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 
 /**
  * Type-safe enumerator for message component types
  */
-public class MessageComponentType implements Comparable {
+public class MessageComponentType implements Comparable
+{
 	/**
 	 * Enumeration elements are constructed once upon class loading.
 	 * Order of appearance here determines the order of compareTo.
@@ -36,45 +39,52 @@
 	public static final MessageComponentType KRB_ENC_KRB_PRIV_PART = new MessageComponentType(28, "encrypted application message part");
 	public static final MessageComponentType KRB_ENC_KRB_CRED_PART = new MessageComponentType(29, "encrypted credentials forward part");
 
-	public String toString() {
-		return _fName + " (" + _fOrdinal + ")";
-	}
-
-	public int compareTo(Object that) {
-		return _fOrdinal - ((MessageComponentType) that)._fOrdinal;
-	}
-
-	public static MessageComponentType getTypeByOrdinal(int type) {
-		for (int i = 0; i < fValues.length; i++)
-			if (fValues[i]._fOrdinal == type)
-				return fValues[i];
-		return NULL;
-	}
-	
-	public int getOrdinal() {
-		return _fOrdinal;
-	}
-
-	/// PRIVATE /////
-	private final String _fName;
-	private final int    _fOrdinal;
-
-	/**
-	 * Private constructor prevents construction outside of this class.
-	 */
-	private MessageComponentType(int ordinal, String name) {
-		_fOrdinal = ordinal;
-		_fName    = name;
-	}
-
-	/**
-	 * These two lines are all that's necessary to export a List of VALUES.
-	 */
-	private static final MessageComponentType[] fValues = {NULL, KRB_TKT, KRB_AUTHENTICATOR,
-			KRB_ENC_TKT_PART, KRB_ENC_AS_REP_PART, KRB_ENC_TGS_REP_PART, KRB_ENC_AP_REP_PART,
-			KRB_ENC_KRB_PRIV_PART, KRB_ENC_KRB_CRED_PART};
-	// VALUES needs to be located here, otherwise illegal forward reference
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(fValues));
-
+    /**
+     * These two lines are all that's necessary to export a List of VALUES.
+     */
+    private static final MessageComponentType[] values = { NULL, KRB_TKT, KRB_AUTHENTICATOR,
+            KRB_ENC_TKT_PART, KRB_ENC_AS_REP_PART, KRB_ENC_TGS_REP_PART, KRB_ENC_AP_REP_PART,
+            KRB_ENC_KRB_PRIV_PART, KRB_ENC_KRB_CRED_PART };
+
+    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+
+    private final String name;
+    private final int ordinal;
+
+    /**
+     * Private constructor prevents construction outside of this class.
+     */
+    private MessageComponentType( int ordinal, String name )
+    {
+        this.ordinal = ordinal;
+        this.name  = name;
+    }
+
+    public static MessageComponentType getTypeByOrdinal( int type )
+    {
+        for ( int ii = 0; ii < values.length; ii++ )
+        {
+            if ( values[ ii ].ordinal == type )
+            {
+                return values[ ii ];
+            }
+        }
+
+        return NULL;
+    }
+
+    public int getOrdinal()
+    {
+        return ordinal;
+    }
+
+    public String toString()
+    {
+        return name + " (" + ordinal + ")";
+    }
+
+    public int compareTo( Object that )
+    {
+        return ordinal - ( (MessageComponentType) that ).ordinal;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/Ticket.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/Ticket.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/Ticket.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/Ticket.java Tue Aug 30 13:02:20 2005
@@ -16,92 +16,130 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.messages.value.AuthorizationData;
+import org.apache.kerberos.messages.value.EncryptedData;
+import org.apache.kerberos.messages.value.EncryptionKey;
+import org.apache.kerberos.messages.value.HostAddresses;
+import org.apache.kerberos.messages.value.KerberosTime;
+import org.apache.kerberos.messages.value.TicketFlags;
+import org.apache.kerberos.messages.value.TransitedEncoding;
 
 /**
  * Ticket message component as handed out by the ticket granting service
  */
-public class Ticket {
-	
-	public static final int TICKET_VNO = 5;
-
-	private int               _ticketVersionNumber;
-	private KerberosPrincipal _serverPrincipal;
-	private EncryptedData     _encPart;
-	
-	private EncTicketPart _encTicketPart;
-	
-	public Ticket(KerberosPrincipal serverPrincipal, EncryptedData encPart) {
-		this(TICKET_VNO, serverPrincipal, encPart);
-	}
-	
-	public Ticket(int versionNumber, KerberosPrincipal serverPrincipal, EncryptedData encPart) {
-		_ticketVersionNumber = versionNumber;
-		_serverPrincipal     = serverPrincipal;
-		_encPart             = encPart;
-	}
-	
-	public void setEncTicketPart(EncTicketPart decryptedPart) {
-		_encTicketPart = decryptedPart;
-	}
-	
-	// getters
-	public int getTicketVersionNumber() {
-		return _ticketVersionNumber;
-	}
-	public KerberosPrincipal getServerPrincipal() {
-		return _serverPrincipal;
-	}
-	public String getRealm() {
-		return _serverPrincipal.getRealm();
-	}
-	public EncryptedData getEncPart() {
-		return _encPart;
-	}
-	public EncTicketPart getEncTicketPart() {
-		return _encTicketPart;
-	}
-	
-	// EncTicketPart delegate getters
-	public AuthorizationData getAuthorizationData() {
-		return _encTicketPart.getAuthorizationData();
-	}
-	public KerberosTime getAuthTime() {
-		return _encTicketPart.getAuthTime();
-	}
-	public HostAddresses getClientAddresses() {
-		return _encTicketPart.getClientAddresses();
-	}
-	public KerberosPrincipal getClientPrincipal() {
-		return _encTicketPart.getClientPrincipal();
-	}
-	public String getClientRealm() {
-		return _encTicketPart.getClientPrincipal().getRealm();
-	}
-	public KerberosTime getEndTime() {
-		return _encTicketPart.getEndTime();
-	}
-	public TicketFlags getFlags() {
-		return _encTicketPart.getFlags();
-	}
-	public KerberosTime getRenewTill() {
-		return _encTicketPart.getRenewTill();
-	}
-	public EncryptionKey getSessionKey() {
-		return _encTicketPart.getSessionKey();
-	}
-	public KerberosTime getStartTime() {
-		return _encTicketPart.getStartTime();
-	}
-	public TransitedEncoding getTransitedEncoding() {
-		return _encTicketPart.getTransitedEncoding();
-	}
-	
-	// EncTicketPart TicketFlag delegates
-	public boolean getFlag(int flag) {
-		return _encTicketPart.getFlags().get(flag);
-	}
-}
+public class Ticket
+{
+    public static final int TICKET_VNO = 5;
+
+    private int               versionNumber;
+    private KerberosPrincipal serverPrincipal;
+    private EncryptedData     encPart;
+    private EncTicketPart     encTicketPart;
+
+    public Ticket( KerberosPrincipal serverPrincipal, EncryptedData encPart )
+    {
+        this( TICKET_VNO, serverPrincipal, encPart );
+    }
+
+    public Ticket( int versionNumber, KerberosPrincipal serverPrincipal, EncryptedData encPart )
+    {
+        this.versionNumber   = versionNumber;
+        this.serverPrincipal = serverPrincipal;
+        this.encPart         = encPart;
+    }
+
+    public void setEncTicketPart( EncTicketPart decryptedPart )
+    {
+        encTicketPart = decryptedPart;
+    }
+
+    // getters
+    public int getVersionNumber()
+    {
+        return versionNumber;
+    }
+
+    public KerberosPrincipal getServerPrincipal()
+    {
+        return serverPrincipal;
+    }
+
+    public String getRealm()
+    {
+        return serverPrincipal.getRealm();
+    }
+
+    public EncryptedData getEncPart()
+    {
+        return encPart;
+    }
+
+    public EncTicketPart getEncTicketPart()
+    {
+        return encTicketPart;
+    }
+
+    // EncTicketPart delegate getters
+    public AuthorizationData getAuthorizationData()
+    {
+        return encTicketPart.getAuthorizationData();
+    }
 
+    public KerberosTime getAuthTime()
+    {
+        return encTicketPart.getAuthTime();
+    }
+
+    public HostAddresses getClientAddresses()
+    {
+        return encTicketPart.getClientAddresses();
+    }
+
+    public KerberosPrincipal getClientPrincipal()
+    {
+        return encTicketPart.getClientPrincipal();
+    }
+
+    public String getClientRealm()
+    {
+        return encTicketPart.getClientPrincipal().getRealm();
+    }
+
+    public KerberosTime getEndTime()
+    {
+        return encTicketPart.getEndTime();
+    }
+
+    public TicketFlags getFlags()
+    {
+        return encTicketPart.getFlags();
+    }
+
+    public KerberosTime getRenewTill()
+    {
+        return encTicketPart.getRenewTill();
+    }
+
+    public EncryptionKey getSessionKey()
+    {
+        return encTicketPart.getSessionKey();
+    }
+
+    public KerberosTime getStartTime()
+    {
+        return encTicketPart.getStartTime();
+    }
+
+    public TransitedEncoding getTransitedEncoding()
+    {
+        return encTicketPart.getTransitedEncoding();
+    }
+
+    // EncTicketPart TicketFlag delegates
+    public boolean getFlag( int flag )
+    {
+        return encTicketPart.getFlags().get( flag );
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/TicketModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/TicketModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/TicketModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/TicketModifier.java Tue Aug 30 13:02:20 2005
@@ -16,33 +16,41 @@
  */
 package org.apache.kerberos.messages.components;
 
-import org.apache.kerberos.messages.value.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.messages.value.EncryptedData;
+import org.apache.kerberos.messages.value.KerberosPrincipalModifier;
+import org.apache.kerberos.messages.value.PrincipalName;
 
-public class TicketModifier {
+public class TicketModifier
+{
+	private int                       ticketVersionNumber;
+	private KerberosPrincipalModifier serverModifier = new KerberosPrincipalModifier();
+	private EncryptedData             encPart;
 	
-	private int                       _ticketVersionNumber;
-	private KerberosPrincipalModifier _serverModifier = new KerberosPrincipalModifier();
-	private EncryptedData             _encPart;
-	
-	public Ticket getTicket() {
-		
-		KerberosPrincipal serverPrincipal = _serverModifier.getKerberosPrincipal();
-		return new Ticket(_ticketVersionNumber, serverPrincipal, _encPart);
-	}
-	
-	public void setTicketVersionNumber(int versionNumber) {
-		_ticketVersionNumber = versionNumber;
-	}
-	public void setEncPart(EncryptedData part) {
-		_encPart = part;
-	}
-	public void setServerName(PrincipalName name) {
-		_serverModifier.setPrincipalName(name);
-	}
-	public void setServerRealm(String realm) {
-		_serverModifier.setRealm(realm);
-	}
-}
+	public Ticket getTicket()
+    {
+        KerberosPrincipal serverPrincipal = serverModifier.getKerberosPrincipal();
+        return new Ticket( ticketVersionNumber, serverPrincipal, encPart );
+    }
+
+    public void setTicketVersionNumber( int versionNumber )
+    {
+        ticketVersionNumber = versionNumber;
+    }
 
+    public void setEncPart( EncryptedData part )
+    {
+        encPart = part;
+    }
+
+    public void setServerName( PrincipalName name )
+    {
+        serverModifier.setPrincipalName( name );
+    }
+
+    public void setServerRealm( String realm )
+    {
+        serverModifier.setRealm( realm );
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/ApOptions.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/ApOptions.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/ApOptions.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/ApOptions.java Tue Aug 30 13:02:20 2005
@@ -16,41 +16,54 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class ApOptions extends Options {
+public class ApOptions extends Options
+{
     // AP Request option - reserved
 	public static final int RESERVED        = 0;
     // AP Request option - use session key
 	public static final int USE_SESSION_KEY = 1;
     // AP Request option - mutual authentication required
 	public static final int MUTUAL_REQUIRED = 2;
-	
+
     // AP Request option - maximum value
 	public static final int MAX_VALUE       = 32;
 	
     /**
      * Class constructors
      */
-	public ApOptions() {
-		super(MAX_VALUE);
-	}
-	
-	public ApOptions(byte[] options) {
-		super(MAX_VALUE);
-		setBytes(options);
-	}
-	
-	/**
-	 * Converts the object to a printable string
-	 */
-	public String toString() {
-		StringBuffer result = new StringBuffer();
-		if (get(MUTUAL_REQUIRED))
-			result.append("MUTUAL_REQUIRED ");
-		if (get(RESERVED))
-			result.append("RESERVED ");
-		if (get(USE_SESSION_KEY))
-			result.append("USE_SESSION_KEY ");
-		return result.toString().trim();
-	}
-}
+    public ApOptions()
+    {
+        super( MAX_VALUE );
+    }
 
+    public ApOptions( byte[] options )
+    {
+        super( MAX_VALUE );
+        setBytes( options );
+    }
+
+    /**
+     * Converts the object to a printable string
+     */
+    public String toString()
+    {
+        StringBuffer result = new StringBuffer();
+
+        if ( get( MUTUAL_REQUIRED ) )
+        {
+            result.append( "MUTUAL_REQUIRED " );
+        }
+        
+        if ( get( RESERVED ) )
+        {
+            result.append( "RESERVED " );
+        }
+        
+        if ( get( USE_SESSION_KEY ) )
+        {
+            result.append( "USE_SESSION_KEY " );
+        }
+        
+        return result.toString().trim();
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationData.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationData.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationData.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationData.java Tue Aug 30 13:02:20 2005
@@ -16,29 +16,34 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
-public class AuthorizationData {
-	
-	private List _entries = new ArrayList();
+public class AuthorizationData
+{
+    private List entries = new ArrayList();
 
-	/**
-	 * Class constructor
-	 */
-	public AuthorizationData() {
-		// used by ASN.1 decoder
-	}
-	
-	public void add(AuthorizationData data) {
-		_entries.addAll(data._entries);
-	}
-	
-	public void add(AuthorizationDataEntry entry) {
-		_entries.add(entry);
-	}
-	
-	public Iterator iterator() {
-		return _entries.iterator();
-	}
-}
+    /**
+     * Class constructor
+     */
+    public AuthorizationData()
+    {
+        // used by ASN.1 decoder
+    }
+
+    public void add( AuthorizationData data )
+    {
+        entries.addAll( data.entries );
+    }
 
+    public void add( AuthorizationDataEntry entry )
+    {
+        entries.add( entry );
+    }
+
+    public Iterator iterator()
+    {
+        return entries.iterator();
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationDataEntry.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationDataEntry.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationDataEntry.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationDataEntry.java Tue Aug 30 13:02:20 2005
@@ -16,24 +16,27 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class AuthorizationDataEntry {
+public class AuthorizationDataEntry
+{
+    private AuthorizationType authorizationDataType;
+    private byte[]            authorizationData;
 
-	private AuthorizationType _authorizationDataType;
-	private byte[]            _authorizationData;
+    /**
+     * Class constructor
+     */
+    public AuthorizationDataEntry( AuthorizationType adType, byte[] adData )
+    {
+        authorizationDataType = adType;
+        authorizationData     = adData;
+    }
 
-	/**
-	 * Class constructor
-	 */
-	public AuthorizationDataEntry(AuthorizationType adType, byte[] adData) {
-		_authorizationDataType = adType;
-		_authorizationData     = adData;
-	}
+    public byte[] getAuthorizationData()
+    {
+        return authorizationData;
+    }
 
-	public byte[] getAuthorizationData() {
-		return _authorizationData;
-	}
-	public AuthorizationType getAuthorizationDataType() {
-		return _authorizationDataType;
-	}
+    public AuthorizationType getAuthorizationDataType()
+    {
+        return authorizationDataType;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationType.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationType.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/AuthorizationType.java Tue Aug 30 13:02:20 2005
@@ -16,10 +16,12 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.util.*;
-
-public final class AuthorizationType implements Comparable {
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 
+public final class AuthorizationType implements Comparable
+{
 	/**
 	 * Enumeration elements are constructed once upon class loading.
 	 * Order of appearance here determines the order of compareTo.
@@ -35,44 +37,50 @@
 	public static final AuthorizationType OSF_DCE             = new AuthorizationType(64, "OSF DCE");
 	public static final AuthorizationType SESAME              = new AuthorizationType(65, "sesame");
 	
-	public String toString() {
-		return _fName + " (" + _fOrdinal + ")";
-	}
-
-	public int compareTo(Object that) {
-		return _fOrdinal - ((AuthorizationType) that)._fOrdinal;
-	}
-
-	public static AuthorizationType getTypeByOrdinal(int type) {
-		for (int i = 0; i < fValues.length; i++)
-			if (fValues[i]._fOrdinal == type)
-				return fValues[i];
-		return NULL;
-	}
-	
-	public int getOrdinal() {
-		return _fOrdinal;
-	}
-
-	/// PRIVATE /////
-	private final String _fName;
-	private final int    _fOrdinal;
-
-	/**
-	 * Private constructor prevents construction outside of this class.
-	 */
-	private AuthorizationType(int ordinal, String name) {
-		_fOrdinal = ordinal;
-		_fName    = name;
-	}
-
-	/**
-	 * These two lines are all that's necessary to export a List of VALUES.
-	 */
-	private static final AuthorizationType[] fValues = {NULL, IF_RELEVANT, INTENDED_FOR_SERVER,
-			INTENDED_FOR_APPLICATION_CLASS, KDC_ISSUED, OR, MANDATORY_TICKET_EXTENSIONS,
-			IN_TICKET_EXTENSIONS, OSF_DCE, SESAME};
-	// VALUES needs to be located here, otherwise illegal forward reference
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(fValues));
+	public String toString()
+    {
+        return name + " (" + ordinal + ")";
+    }
+
+    public int compareTo( Object that )
+    {
+        return ordinal - ( (AuthorizationType) that ).ordinal;
+    }
+
+    public static AuthorizationType getTypeByOrdinal( int type )
+    {
+        for ( int ii = 0; ii < values.length; ii++ )
+        {
+            if ( values[ ii ].ordinal == type ) return values[ ii ];
+        }
+        
+        return NULL;
+    }
+
+    public int getOrdinal()
+    {
+        return ordinal;
+    }
+
+    /// PRIVATE /////
+    private final String name;
+    private final int ordinal;
+
+    /**
+     * Private constructor prevents construction outside of this class.
+     */
+    private AuthorizationType( int ordinal, String name )
+    {
+        this.ordinal = ordinal;
+        this.name = name;
+    }
+
+    /**
+     * These two lines are all that's necessary to export a List of VALUES.
+     */
+    private static final AuthorizationType[] values = { NULL, IF_RELEVANT, INTENDED_FOR_SERVER,
+            INTENDED_FOR_APPLICATION_CLASS, KDC_ISSUED, OR, MANDATORY_TICKET_EXTENSIONS,
+            IN_TICKET_EXTENSIONS, OSF_DCE, SESAME };
+    // VALUES needs to be located here, otherwise illegal forward reference
+    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/Checksum.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/Checksum.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/Checksum.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/Checksum.java Tue Aug 30 13:02:20 2005
@@ -14,53 +14,48 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.messages.value;
 
 import java.util.Arrays;
 
 import org.apache.kerberos.crypto.checksum.ChecksumType;
 
-
 public class Checksum
 {
-	private ChecksumType checksumType;
-	private byte[]       checksum;
-	
-	
-	public Checksum( ChecksumType checksumType, byte[] checksum )
-	{
-		this.checksumType = checksumType;
-		this.checksum     = checksum;
-	}
-	
-	
-	public boolean equals( Object o )
-	{
-		if ( this == o )
-		{
-			return true;
-		}
-		
-		if ( !( o instanceof Checksum ) )
-		{
-			return false;
-		}
-		
-		Checksum that = (Checksum) o;
-		
-		return ( this.checksumType == that.checksumType )
-				&& ( Arrays.equals( this.checksum, that.checksum ) );
-	}
-	
-	public byte[] getChecksumValue()
-	{
-		return checksum;
-	}
-	
-	public ChecksumType getChecksumType()
-	{
-		return checksumType;
-	}
-}
+    private ChecksumType checksumType;
+    private byte[] checksum;
 
+    public Checksum( ChecksumType checksumType, byte[] checksum )
+    {
+        this.checksumType = checksumType;
+        this.checksum = checksum;
+    }
+
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+
+        if ( !( o instanceof Checksum ) )
+        {
+            return false;
+        }
+
+        Checksum that = (Checksum) o;
+
+        return ( this.checksumType == that.checksumType )
+                && ( Arrays.equals( this.checksum, that.checksum ) );
+    }
+
+    public byte[] getChecksumValue()
+    {
+        return checksum;
+    }
+
+    public ChecksumType getChecksumType()
+    {
+        return checksumType;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedData.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedData.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedData.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedData.java Tue Aug 30 13:02:20 2005
@@ -24,26 +24,25 @@
 	private int            keyVersion;     //optional
 	private byte[]         cipherText;
 
-	public EncryptedData(EncryptionType type, int version, byte[] cipherText)
+	public EncryptedData( EncryptionType type, int version, byte[] cipherText )
     {
-		encryptionType  = type;
-		keyVersion      = version;
-		this.cipherText = cipherText;
-	}
+        encryptionType  = type;
+        keyVersion      = version;
+        this.cipherText = cipherText;
+    }
 
-	public EncryptionType getEncryptionType()
+    public EncryptionType getEncryptionType()
     {
-		return encryptionType;
-	}
+        return encryptionType;
+    }
 
-	public int getKeyVersion()
+    public int getKeyVersion()
     {
-		return keyVersion;
-	}
+        return keyVersion;
+    }
 
-	public byte[] getCipherText()
+    public byte[] getCipherText()
     {
-		return cipherText;
-	}
+        return cipherText;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedDataModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedDataModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedDataModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedDataModifier.java Tue Aug 30 13:02:20 2005
@@ -26,22 +26,21 @@
 	
 	public EncryptedData getEncryptedData()
     {
-        return new EncryptedData(encryptionType, keyVersion, cipherText);
-	}
+        return new EncryptedData( encryptionType, keyVersion, cipherText );
+    }
 
-	public void setCipherText(byte[] cipherText)
+    public void setCipherText( byte[] cipherText )
     {
-		this.cipherText = cipherText;
-	}
+        this.cipherText = cipherText;
+    }
 
-	public void setEncryptionType(EncryptionType type)
+    public void setEncryptionType( EncryptionType type )
     {
-		encryptionType = type;
-	}
+        encryptionType = type;
+    }
 
-	public void setKeyVersion(int version)
+    public void setKeyVersion( int version )
     {
-		keyVersion = version;
-	}
+        keyVersion = version;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedTimeStamp.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedTimeStamp.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedTimeStamp.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedTimeStamp.java Tue Aug 30 13:02:20 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.messages.value;
 
 /**
@@ -35,10 +34,9 @@
 	{
 		return timeStamp;
 	}
-	
+
 	public int getMicroSeconds()
 	{
 		return microSeconds;
 	}
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedTimeStampModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedTimeStampModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedTimeStampModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptedTimeStampModifier.java Tue Aug 30 13:02:20 2005
@@ -14,10 +14,8 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.messages.value;
 
-
 public class EncryptedTimeStampModifier
 {
 	private KerberosTime timeStamp;
@@ -26,16 +24,15 @@
 	public EncryptedTimeStamp getEncryptedTimestamp()
     {
         return new EncryptedTimeStamp( timeStamp, microSecond );
-	}
-	
-	public void setKerberosTime( KerberosTime timeStamp )
+    }
+
+    public void setKerberosTime( KerberosTime timeStamp )
     {
-		this.timeStamp = timeStamp;
-	}
-	
-	public void setMicroSecond( int microSecond )
+        this.timeStamp = timeStamp;
+    }
+
+    public void setMicroSecond( int microSecond )
     {
-		this.microSecond = microSecond;
-	}
+        this.microSecond = microSecond;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptionKey.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptionKey.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptionKey.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptionKey.java Tue Aug 30 13:02:20 2005
@@ -16,65 +16,82 @@
  */
 package org.apache.kerberos.messages.value;
 
-import org.apache.kerberos.crypto.encryption.*;
+import java.util.Arrays;
 
-import java.util.*;
+import org.apache.kerberos.crypto.encryption.EncryptionType;
 
-public class EncryptionKey {
-	
-	private EncryptionType _keyType;
-	private byte[]         _keyValue;
-	private int            _keyVersion;
-	
-	public EncryptionKey(EncryptionType keyType, byte[] keyValue) {
-		_keyType    = keyType;
-		_keyValue   = keyValue;
-	}
-	
-	public EncryptionKey(EncryptionType keyType, byte[] keyValue, int keyVersion) {
-		_keyType    = keyType;
-		_keyValue   = keyValue;
-		/**
-		 * keyVersion is sent over the wire as part of EncryptedData but makes more sense
-		 * in the domain model to have here as part of the key itself.  Therefore, the
-		 * keyVersion should only be constructor-injected when EncryptionKey's are
-		 * retrieved from persisted storage.
-		 * 
-		 * TODO - keyVersion may move into persisted user configuration
-		 */
-		_keyVersion = keyVersion;
-	}
-	
-	public boolean equals(Object o) {
-		if (this == o)
-			return true;
-		if (!(o instanceof EncryptionKey))
-			return false;
-
-		EncryptionKey that = (EncryptionKey) o;
-		return (this._keyType == that._keyType)
-				&& (Arrays.equals(this._keyValue, that._keyValue));
-	}
-	
-	public synchronized void destroy() {
-		if (_keyValue != null)
-			for (int i = 0; i < _keyValue.length; i++)
-				_keyValue[i] = 0;
-	}
-	
-	public String toString() {
-		return _keyType.toString() + " (" + _keyType.getOrdinal() + ")";
-	}
-
-	public EncryptionType getKeyType() {
-		return _keyType;
-	}
-	public byte[] getKeyValue() {
-		return _keyValue;
-	}
-	
-	public int getKeyVersion() {
-		return _keyVersion;
-	}
-}
+public class EncryptionKey
+{
+	private EncryptionType keyType;
+	private byte[]         keyValue;
+	private int            keyVersion;
+	
+	public EncryptionKey( EncryptionType keyType, byte[] keyValue )
+    {
+        this.keyType = keyType;
+        this.keyValue = keyValue;
+    }
 
+    public EncryptionKey( EncryptionType keyType, byte[] keyValue, int keyVersion )
+    {
+        this.keyType = keyType;
+        this.keyValue = keyValue;
+        /**
+         * keyVersion is sent over the wire as part of EncryptedData but makes more sense
+         * in the domain model to have here as part of the key itself.  Therefore, the
+         * keyVersion should only be constructor-injected when EncryptionKey's are
+         * retrieved from persisted storage.
+         * 
+         * TODO - keyVersion may move into persisted user configuration
+         */
+        this.keyVersion = keyVersion;
+    }
+
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        
+        if ( !( o instanceof EncryptionKey ) )
+        {
+            return false;
+        }
+
+        EncryptionKey that = (EncryptionKey) o;
+        return ( this.keyType == that.keyType )
+                && ( Arrays.equals( this.keyValue, that.keyValue ) );
+    }
+
+    public synchronized void destroy()
+    {
+        if ( keyValue != null )
+        {
+            for ( int ii = 0; ii < keyValue.length; ii++ )
+            {
+                keyValue[ ii ] = 0;
+            }
+        }
+    }
+
+    public String toString()
+    {
+        return keyType.toString() + " (" + keyType.getOrdinal() + ")";
+    }
+
+    public EncryptionType getKeyType()
+    {
+        return keyType;
+    }
+
+    public byte[] getKeyValue()
+    {
+        return keyValue;
+    }
+
+    public int getKeyVersion()
+    {
+        return keyVersion;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptionTypeInfoEntry.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptionTypeInfoEntry.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptionTypeInfoEntry.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/EncryptionTypeInfoEntry.java Tue Aug 30 13:02:20 2005
@@ -14,33 +14,28 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.messages.value;
 
 import org.apache.kerberos.crypto.encryption.EncryptionType;
 
-
 public class EncryptionTypeInfoEntry
 {
 	private EncryptionType encryptionType;
 	private byte[]         salt;
-	
-	
+
 	public EncryptionTypeInfoEntry( EncryptionType encryptionType, byte[] salt )
-	{
-		this.encryptionType = encryptionType;
-		this.salt           = salt;
-	}
-	
-	
-	public byte[] getSalt()
-	{
-		return salt;
-	}
-	
-	public EncryptionType getEncryptionType()
-	{
-		return encryptionType;
-	}   
-}
+    {
+        this.encryptionType = encryptionType;
+        this.salt = salt;
+    }
+
+    public byte[] getSalt()
+    {
+        return salt;
+    }
 
+    public EncryptionType getEncryptionType()
+    {
+        return encryptionType;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddress.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddress.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddress.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddress.java Tue Aug 30 13:02:20 2005
@@ -16,85 +16,84 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.net.*;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 
 /**
  * Provides host address information.
  */
-public class HostAddress {
-	
-    // Host address length - inet
-	public static final int ADDR_LEN_INET      = 4;
-    // Host address length - chaos
-	public static final int ADDR_LEN_CHAOS     = 2;
-    // Host address length - osi
-	public static final int ADDR_LEN_OSI       = 0; // variable
-    // Host address length - xns
-	public static final int ADDR_LEN_XNS       = 6;
-    // Host address length - appletalk
-	public static final int ADDR_LEN_APPLETALK = 3;
-    // Host address length - decnet
-	public static final int ADDR_LEN_DECNET    = 2;
-	
-	private static byte[] localInetAddress;
-	
-	private HostAddressType _addressType;
-	private byte[]          _address;
-	
-	/**
-	 * Class constructors
-	 */
-	public HostAddress() {
-		try {
-			_addressType = HostAddressType.ADDRTYPE_INET;
-			_address     = getLocalInetAddress();
-		} catch (UnknownHostException uhe) {
-			uhe.printStackTrace();
-		}
-	}
-
-	public HostAddress(HostAddressType addressType, byte[] address) {
-		_addressType = addressType;
-		_address     = address;
-	}
-
-	public HostAddress(InetAddress internetAddress) {
-		_addressType      = HostAddressType.ADDRTYPE_INET;
-		byte[] newAddress = internetAddress.getAddress();
-		_address          = new byte[newAddress.length];
-		System.arraycopy(newAddress, 0, _address, 0, newAddress.length);
-	}
-
-	public boolean equals(HostAddress h) {
-		if (_addressType != h._addressType ||
-			(_address != null && h._address == null) ||
-			(_address == null && h._address != null))
-			return false;
-		if (_address != null && h._address != null) {
-			if (_address.length != h._address.length)
-				return false;
-			for (int i = 0; i < _address.length; i++)
-				if (_address[i] != h._address[i])
-					return false;
-		}
-		return true;
-	}
-	
-	public static byte[] getLocalInetAddress() throws UnknownHostException {
-		if (localInetAddress == null)
-			localInetAddress = InetAddress.getLocalHost().getAddress();
-		
-		byte[] result = new byte[localInetAddress.length];
-		System.arraycopy(localInetAddress, 0, result, 0, localInetAddress.length);
-		
-		return result;
-	}
-	
-	public byte[] getAddress() {
-		return _address;
-	}
-	public HostAddressType getAddressType() {
-		return _addressType;
-	}
-}
+public class HostAddress
+{
+    private HostAddressType addressType;
+    private byte[] address;
+
+    /**
+     * Class constructors
+     */
+    public HostAddress( HostAddressType addressType, byte[] address )
+    {
+        this.addressType = addressType;
+        this.address = address;
+    }
+
+    public HostAddress( InetAddress internetAddress )
+    {
+        addressType = HostAddressType.ADDRTYPE_INET;
+        byte[] newAddress = internetAddress.getAddress();
+        address = new byte[ newAddress.length ];
+        System.arraycopy( newAddress, 0, address, 0, newAddress.length );
+    }
+
+    public boolean equals( HostAddress that )
+    {
+        if ( this.addressType != that.addressType
+                || ( this.address != null && that.address == null )
+                || ( this.address == null && that.address != null ) )
+        {
+            return false;
+        }
+
+        if ( this.address != null && that.address != null )
+        {
+            if ( this.address.length != that.address.length )
+            {
+                return false;
+            }
+
+            for ( int ii = 0; ii < this.address.length; ii++ )
+            {
+                if ( this.address[ ii ] != that.address[ ii ] )
+                {
+                    return false;
+                }
+            }
+        }
 
+        return true;
+    }
+
+    public byte[] getAddress()
+    {
+        return address;
+    }
+
+    public HostAddressType getAddressType()
+    {
+        return addressType;
+    }
+
+    public String toString()
+    {
+        String result = "";
+
+        try
+        {
+            result = InetAddress.getByAddress( address ).getHostAddress();
+        }
+        catch ( UnknownHostException uhe )
+        {
+        }
+
+        return result;
+    }
+}



Mime
View raw message