directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r264844 [5/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/value/HostAddressType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddressType.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddressType.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddressType.java Tue Aug 30 13:02:20 2005
@@ -16,80 +16,90 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.util.*;
-
-public final class HostAddressType implements Comparable {
-
-	/**
-	 * Enumeration elements are constructed once upon class loading.
-	 * Order of appearance here determines the order of compareTo.
-	 */
-	public static final HostAddressType NULL               = new HostAddressType(0, "null");
-	public static final HostAddressType ADDRTYPE_UNIX      = new HostAddressType(1, "Unix");
-	public static final HostAddressType ADDRTYPE_INET      = new HostAddressType(2, "Internet");
-	public static final HostAddressType ADDRTYPE_IMPLINK   = new HostAddressType(3, "Arpanet");
-	public static final HostAddressType ADDRTYPE_PUP       = new HostAddressType(4, "PUP");
-	public static final HostAddressType ADDRTYPE_CHAOS     = new HostAddressType(5, "CHAOS");
-	public static final HostAddressType ADDRTYPE_XNS       = new HostAddressType(6, "XEROX Network Services");
-	public static final HostAddressType ADDRTYPE_IPX       = new HostAddressType(6, "IPX");
-	public static final HostAddressType ADDRTYPE_OSI       = new HostAddressType(7, "OSI");
-	public static final HostAddressType ADDRTYPE_ECMA      = new HostAddressType(8, "European Computer Manufacturers");
-	public static final HostAddressType ADDRTYPE_DATAKIT   = new HostAddressType(9, "Datakit");
-	public static final HostAddressType ADDRTYPE_CCITT     = new HostAddressType(10, "CCITT");
-	public static final HostAddressType ADDRTYPE_SNA       = new HostAddressType(11, "SNA");
-	public static final HostAddressType ADDRTYPE_DECNET    = new HostAddressType(12, "DECnet");
-	public static final HostAddressType ADDRTYPE_DLI       = new HostAddressType(13, "Direct Data Link Interface");
-	public static final HostAddressType ADDRTYPE_LAT       = new HostAddressType(14, "LAT");
-	public static final HostAddressType ADDRTYPE_HYLINK    = new HostAddressType(15, "NSC Hyperchannel");
-	public static final HostAddressType ADDRTYPE_APPLETALK = new HostAddressType(16, "AppleTalk");
-	public static final HostAddressType ADDRTYPE_NETBIOS   = new HostAddressType(17, "NetBios");
-	public static final HostAddressType ADDRTYPE_VOICEVIEW = new HostAddressType(18, "VoiceView");
-	public static final HostAddressType ADDRTYPE_FIREFOX   = new HostAddressType(19, "Firefox");
-	public static final HostAddressType ADDRTYPE_BAN       = new HostAddressType(21, "Banyan");
-	public static final HostAddressType ADDRTYPE_ATM       = new HostAddressType(22, "ATM");
-	public static final HostAddressType ADDRTYPE_INET6     = new HostAddressType(23, "Internet Protocol V6");
-	
-	public String toString() {
-		return _fName + " (" + _fOrdinal + ")";
-	}
-
-	public int compareTo(Object that) {
-		return _fOrdinal - ((HostAddressType) that)._fOrdinal;
-	}
-
-	public static HostAddressType 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 HostAddressType(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 HostAddressType[] fValues = {NULL, ADDRTYPE_UNIX, ADDRTYPE_INET,
-			ADDRTYPE_IMPLINK, ADDRTYPE_PUP, ADDRTYPE_CHAOS, ADDRTYPE_XNS, ADDRTYPE_IPX,
-			ADDRTYPE_OSI, ADDRTYPE_ECMA, ADDRTYPE_DATAKIT, ADDRTYPE_CCITT, ADDRTYPE_SNA,
-			ADDRTYPE_DECNET, ADDRTYPE_DLI, ADDRTYPE_LAT, ADDRTYPE_HYLINK, ADDRTYPE_APPLETALK,
-			ADDRTYPE_NETBIOS, ADDRTYPE_VOICEVIEW, ADDRTYPE_FIREFOX, ADDRTYPE_BAN, ADDRTYPE_ATM,
-			ADDRTYPE_INET6};
-	// VALUES needs to be located here, otherwise illegal forward reference
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(fValues));
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public final class HostAddressType implements Comparable
+{
+    /**
+     * Enumeration elements are constructed once upon class loading.
+     * Order of appearance here determines the order of compareTo.
+     */
+    public static final HostAddressType NULL               = new HostAddressType(0, "null");
+    public static final HostAddressType ADDRTYPE_UNIX      = new HostAddressType(1, "Unix");
+    public static final HostAddressType ADDRTYPE_INET      = new HostAddressType(2, "Internet");
+    public static final HostAddressType ADDRTYPE_IMPLINK   = new HostAddressType(3, "Arpanet");
+    public static final HostAddressType ADDRTYPE_PUP       = new HostAddressType(4, "PUP");
+    public static final HostAddressType ADDRTYPE_CHAOS     = new HostAddressType(5, "CHAOS");
+    public static final HostAddressType ADDRTYPE_XNS       = new HostAddressType(6, "XEROX Network Services");
+    public static final HostAddressType ADDRTYPE_IPX       = new HostAddressType(6, "IPX");
+    public static final HostAddressType ADDRTYPE_OSI       = new HostAddressType(7, "OSI");
+    public static final HostAddressType ADDRTYPE_ECMA      = new HostAddressType(8, "European Computer Manufacturers");
+    public static final HostAddressType ADDRTYPE_DATAKIT   = new HostAddressType(9, "Datakit");
+    public static final HostAddressType ADDRTYPE_CCITT     = new HostAddressType(10, "CCITT");
+    public static final HostAddressType ADDRTYPE_SNA       = new HostAddressType(11, "SNA");
+    public static final HostAddressType ADDRTYPE_DECNET    = new HostAddressType(12, "DECnet");
+    public static final HostAddressType ADDRTYPE_DLI       = new HostAddressType(13, "Direct Data Link Interface");
+    public static final HostAddressType ADDRTYPE_LAT       = new HostAddressType(14, "LAT");
+    public static final HostAddressType ADDRTYPE_HYLINK    = new HostAddressType(15, "NSC Hyperchannel");
+    public static final HostAddressType ADDRTYPE_APPLETALK = new HostAddressType(16, "AppleTalk");
+    public static final HostAddressType ADDRTYPE_NETBIOS   = new HostAddressType(17, "NetBios");
+    public static final HostAddressType ADDRTYPE_VOICEVIEW = new HostAddressType(18, "VoiceView");
+    public static final HostAddressType ADDRTYPE_FIREFOX   = new HostAddressType(19, "Firefox");
+    public static final HostAddressType ADDRTYPE_BAN       = new HostAddressType(21, "Banyan");
+    public static final HostAddressType ADDRTYPE_ATM       = new HostAddressType(22, "ATM");
+    public static final HostAddressType ADDRTYPE_INET6     = new HostAddressType(23, "Internet Protocol V6");
+
+    /**
+     * These two lines are all that's necessary to export a List of VALUES.
+     */
+    private static final HostAddressType[] values = { NULL, ADDRTYPE_UNIX, ADDRTYPE_INET,
+            ADDRTYPE_IMPLINK, ADDRTYPE_PUP, ADDRTYPE_CHAOS, ADDRTYPE_XNS, ADDRTYPE_IPX,
+            ADDRTYPE_OSI, ADDRTYPE_ECMA, ADDRTYPE_DATAKIT, ADDRTYPE_CCITT, ADDRTYPE_SNA,
+            ADDRTYPE_DECNET, ADDRTYPE_DLI, ADDRTYPE_LAT, ADDRTYPE_HYLINK, ADDRTYPE_APPLETALK,
+            ADDRTYPE_NETBIOS, ADDRTYPE_VOICEVIEW, ADDRTYPE_FIREFOX, ADDRTYPE_BAN, ADDRTYPE_ATM,
+            ADDRTYPE_INET6 };
+
+    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 HostAddressType( int ordinal, String name )
+    {
+        this.ordinal = ordinal;
+        this.name = name;
+    }
+
+    public String toString()
+    {
+        return name + " (" + ordinal + ")";
+    }
+
+    public int compareTo( Object that )
+    {
+        return ordinal - ( (HostAddressType) that ).ordinal;
+    }
+
+    public static HostAddressType 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;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddresses.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddresses.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddresses.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/HostAddresses.java Tue Aug 30 13:02:20 2005
@@ -16,47 +16,80 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class HostAddresses {
-	
-	private HostAddress[] _addresses;
-
-	/**
-	 * Class constructors
-	 */
-	public HostAddresses(HostAddress[] newAddresses) {
-		_addresses = newAddresses;
-	}
-
-	public HostAddresses() {
-		_addresses    = new HostAddress[1];
-		_addresses[0] = new HostAddress();
-	}
-
-	public boolean contains(HostAddress address) {
-		if (_addresses != null) {
-			for (int i = 0; i < _addresses.length; i++)
-				if (_addresses[i].equals(address))
-					return true;
-		}
-		return false;
-	}
-
-	public boolean equals(HostAddresses addresses) {
-		if ((_addresses == null && addresses._addresses != null) ||
-			(_addresses != null && addresses._addresses == null))
-			return false;
-		if (_addresses != null && addresses._addresses != null) {
-			if (_addresses.length != addresses._addresses.length)
-				return false;
-			for (int i = 0; i < _addresses.length; i++)
-				if (!_addresses[i].equals(addresses._addresses[i]))
-					return false;
-		}
-		return true;
-	}
-	
-	public HostAddress[] getAddresses() {
-		return _addresses;
-	}
-}
+public class HostAddresses
+{
+    private HostAddress[] addresses;
+
+    /**
+     * Class constructors
+     */
+    public HostAddresses( HostAddress[] addresses )
+    {
+        this.addresses = addresses;
+    }
+
+    public boolean contains( HostAddress address )
+    {
+        if ( addresses != null )
+        {
+            for ( int ii = 0; ii < addresses.length; ii++ )
+            {
+                if ( addresses[ ii ].equals( address ) )
+                {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    public boolean equals( HostAddresses that )
+    {
+        if ( ( this.addresses == null && that.addresses != null )
+                || ( this.addresses != null && that.addresses == null ) )
+        {
+            return false;
+        }
+
+        if ( this.addresses != null && that.addresses != null )
+        {
+            if ( this.addresses.length != that.addresses.length )
+            {
+                return false;
+            }
+
+            for ( int ii = 0; ii < this.addresses.length; ii++ )
+            {
+                if ( !this.addresses[ ii ].equals( that.addresses[ ii ] ) )
+                {
+                    return false;
+                }
+            }
+        }
 
+        return true;
+    }
+
+    public HostAddress[] getAddresses()
+    {
+        return addresses;
+    }
+
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        for ( int ii = 0; ii < this.addresses.length; ii++ )
+        {
+            sb.append( addresses[ ii ].toString() );
+
+            if ( ii < addresses.length - 1 )
+            {
+                sb.append( ", " );
+            }
+        }
+
+        return sb.toString();
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KdcOptions.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KdcOptions.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KdcOptions.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KdcOptions.java Tue Aug 30 13:02:20 2005
@@ -16,7 +16,8 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class KdcOptions extends Options {
+public class KdcOptions extends Options
+{
     // KDC option - reserved
 	public static final int RESERVED                    = 0;
     // KDC option - forwardable
@@ -55,54 +56,96 @@
 	public static final int RENEW                       = 30;
     // KDC option - validate
 	public static final int VALIDATE                    = 31;
-	
+
     // KDC option - maximum value
 	public static final int MAX_VALUE                   = 32;
-	
-	/**
-	 * Class constructors
-	 */
-	public KdcOptions() {
-		super(MAX_VALUE);
-	}
-	
-	public KdcOptions(byte[] bytes) {
-		super(MAX_VALUE);
-		setBytes(bytes);
-	}
-	
+
 	/**
-	 * Converts the object to a printable string
-	 */
-	public String toString() {
-		StringBuffer result = new StringBuffer();
-		if (get(ALLOW_POSTDATE))
-			result.append("ALLOW_POSTDATE ");
-		if (get(DISABLE_TRANSISTED_CHECKED))
-			result.append("DISABLE_TRANSISTED_CHECKED ");
-		if (get(ENC_TKT_IN_SKEY))
-			result.append("ENC_TKT_IN_SKEY ");
-		if (get(FORWARDABLE))
-			result.append("FORWARDABLE ");
-		if (get(FORWARDED))
-			result.append("FORWARDED ");
-		if (get(POSTDATED))
-			result.append("POSTDATED ");
-		if (get(PROXIABLE))
-			result.append("PROXIABLE ");
-		if (get(PROXY))
-			result.append("PROXY ");
-		if (get(RENEW))
-			result.append("RENEW ");
-		if (get(RENEWABLE))
-			result.append("RENEWABLE ");
-		if (get(RENEWABLE_OK))
-			result.append("RENEWABLE_OK ");
-		if (get(RESERVED))
-			result.append("RESERVED ");
-		if (get(VALIDATE))
-			result.append("VALIDATE ");
-		return result.toString().trim();
-	}
-}
+     * Class constructors
+     */
+    public KdcOptions()
+    {
+        super( MAX_VALUE );
+    }
+
+    public KdcOptions( byte[] bytes )
+    {
+        super( MAX_VALUE );
+        setBytes( bytes );
+    }
+
+    /**
+     * Converts the object to a printable string
+     */
+    public String toString()
+    {
+        StringBuffer result = new StringBuffer();
+
+        if ( get( ALLOW_POSTDATE ) )
+        {
+            result.append( "ALLOW_POSTDATE " );
+        }
+
+        if ( get( DISABLE_TRANSISTED_CHECKED ) )
+        {
+            result.append( "DISABLE_TRANSISTED_CHECKED " );
+        }
+
+        if ( get( ENC_TKT_IN_SKEY ) )
+        {
+            result.append( "ENC_TKT_IN_SKEY " );
+        }
+
+        if ( get( FORWARDABLE ) )
+        {
+            result.append( "FORWARDABLE " );
+        }
 
+        if ( get( FORWARDED ) )
+        {
+            result.append( "FORWARDED " );
+        }
+
+        if ( get( POSTDATED ) )
+        {
+            result.append( "POSTDATED " );
+        }
+
+        if ( get( PROXIABLE ) )
+        {
+            result.append( "PROXIABLE " );
+        }
+
+        if ( get( PROXY ) )
+        {
+            result.append( "PROXY " );
+        }
+
+        if ( get( RENEW ) )
+        {
+            result.append( "RENEW " );
+        }
+
+        if ( get( RENEWABLE ) )
+        {
+            result.append( "RENEWABLE " );
+        }
+
+        if ( get( RENEWABLE_OK ) )
+        {
+            result.append( "RENEWABLE_OK " );
+        }
+
+        if ( get( RESERVED ) )
+        {
+            result.append( "RESERVED " );
+        }
+
+        if ( get( VALIDATE ) )
+        {
+            result.append( "VALIDATE " );
+        }
+
+        return result.toString().trim();
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KerberosPrincipalModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KerberosPrincipalModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KerberosPrincipalModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KerberosPrincipalModifier.java Tue Aug 30 13:02:20 2005
@@ -16,34 +16,41 @@
  */
 package org.apache.kerberos.messages.value;
 
-import javax.security.auth.kerberos.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-public class KerberosPrincipalModifier {
-	
-	private static final String REALM_SEPARATOR = "@";
-	
-	PrincipalName _nameComponent;
-	String        _realm;
-	
-	public KerberosPrincipal getKerberosPrincipal() {
-		if (_nameComponent != null) {
-			StringBuffer sb = new StringBuffer();
-			sb.append(_nameComponent.getNameComponent());
-			if (_realm != null) {
-				sb.append(REALM_SEPARATOR);
-				sb.append(_realm);
-			}
-			return new KerberosPrincipal(sb.toString(), _nameComponent.getNameType());
-		}
-		return null;
-	}
-	
-	public void setPrincipalName(PrincipalName principalName) {
-		_nameComponent = principalName;
-	}
-
-	public void setRealm(String realm) {
-		_realm = realm;
-	}
-}
+public class KerberosPrincipalModifier
+{
+    private static final String REALM_SEPARATOR = "@";
+
+    PrincipalName nameComponent;
+    String realm;
+
+    public KerberosPrincipal getKerberosPrincipal()
+    {
+        if ( nameComponent != null )
+        {
+            StringBuffer sb = new StringBuffer();
+            sb.append( nameComponent.getNameComponent() );
+
+            if ( realm != null )
+            {
+                sb.append( REALM_SEPARATOR );
+                sb.append( realm );
+            }
 
+            return new KerberosPrincipal( sb.toString(), nameComponent.getNameType() );
+        }
+
+        return null;
+    }
+
+    public void setPrincipalName( PrincipalName principalName )
+    {
+        nameComponent = principalName;
+    }
+
+    public void setRealm( String realm )
+    {
+        this.realm = realm;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KerberosTime.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KerberosTime.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KerberosTime.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KerberosTime.java Tue Aug 30 13:02:20 2005
@@ -14,43 +14,52 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.messages.value;
 
+import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.TimeZone;
 
 /**
  * Implementation of the time object for Kerberos
  */
 public class KerberosTime implements Comparable
 {
-    public static final KerberosTime INFINITY = new KerberosTime(Long.MAX_VALUE);
+    public static final KerberosTime INFINITY = new KerberosTime( Long.MAX_VALUE );
+
+    private static final TimeZone UTC_TIME_ZONE = TimeZone.getTimeZone( "UTC" );
+    private static final SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyyMMddHHmmss'Z'" );
+
+    static
+    {
+        dateFormat.setTimeZone( UTC_TIME_ZONE );
+    }
 
-    private long localTime;
+    private long kerberosTime;
 
     public KerberosTime()
     {
-        localTime = System.currentTimeMillis();
+        kerberosTime = System.currentTimeMillis();
     }
 
-    public KerberosTime(long time)
+    public KerberosTime( long time )
     {
-        localTime = time;
+        kerberosTime = time;
     }
 
-    public KerberosTime(Date time)
+    public KerberosTime( Date time )
     {
-        localTime = time.getTime();
+        kerberosTime = time.getTime();
     }
 
-    public int compareTo(Object o)
+    public int compareTo( Object o )
     {
         final int BEFORE = -1;
         final int EQUAL = 0;
         final int AFTER = 1;
 
         // this optimization is usually worthwhile, and can always be added
-        if (this == o)
+        if ( this == o )
         {
             return EQUAL;
         }
@@ -61,12 +70,12 @@
         final KerberosTime that = (KerberosTime) o;
 
         // primitive numbers follow this form
-        if (this.localTime < that.localTime)
+        if ( this.kerberosTime < that.kerberosTime )
         {
             return BEFORE;
         }
-        
-        if (this.localTime > that.localTime)
+
+        if ( this.kerberosTime > that.kerberosTime )
         {
             return AFTER;
         }
@@ -76,36 +85,41 @@
 
     public long getTime()
     {
-        return localTime;
+        return kerberosTime;
     }
 
     public Date toDate()
     {
-        return new Date(localTime);
+        return new Date( kerberosTime );
     }
 
-    public boolean isInClockSkew(long clockSkew)
+    public boolean isInClockSkew( long clockSkew )
     {
-        return Math.abs(localTime - System.currentTimeMillis()) < clockSkew;
+        return Math.abs( kerberosTime - System.currentTimeMillis() ) < clockSkew;
     }
 
-    public boolean greaterThan(KerberosTime time)
+    public boolean greaterThan( KerberosTime time )
     {
-        return localTime > time.localTime;
+        return kerberosTime > time.kerberosTime;
     }
 
-    public boolean lessThan(KerberosTime time)
+    public boolean lessThan( KerberosTime time )
     {
-        return localTime < time.localTime;
+        return kerberosTime < time.kerberosTime;
     }
 
-    public boolean equals(KerberosTime time)
+    public boolean equals( KerberosTime time )
     {
-        return localTime == time.localTime;
+        return kerberosTime == time.kerberosTime;
     }
 
     public boolean isZero()
     {
-        return localTime == 0;
+        return kerberosTime == 0;
+    }
+
+    public String toString()
+    {
+        return dateFormat.format( new Date( kerberosTime ) );
     }
 }

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KrbCredInfo.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KrbCredInfo.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KrbCredInfo.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/KrbCredInfo.java Tue Aug 30 13:02:20 2005
@@ -16,65 +16,80 @@
  */
 package org.apache.kerberos.messages.value;
 
-import javax.security.auth.kerberos.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
 /**
  * Kerberos credential information
  */
-public class KrbCredInfo {
+public class KrbCredInfo
+{
+	private EncryptionKey     key;
+	private KerberosPrincipal clientPrincipal; //optional
+	private TicketFlags       flags;           //optional
+	private KerberosTime      authTime;        //optional
+	private KerberosTime      startTime;       //optional
+	private KerberosTime      endTime;         //optional
+	private KerberosTime      renewTill;       //optional
+	private KerberosPrincipal serverPrincipal; //optional
+	private HostAddresses     clientAddresses; //optional
 
-	private EncryptionKey     _key;
-	private KerberosPrincipal _clientPrincipal; //optional
-	private TicketFlags       _flags;           //optional
-	private KerberosTime      _authTime;        //optional
-	private KerberosTime      _startTime;       //optional
-	private KerberosTime      _endTime;         //optional
-	private KerberosTime      _renewTill;       //optional
-	private KerberosPrincipal _serverPrincipal; //optional
-	private HostAddresses     _clientAddresses; //optional
-
-	public KrbCredInfo(EncryptionKey key, KerberosPrincipal clientPrincipal,
-			TicketFlags flags, KerberosTime authTime, KerberosTime startTime,
-			KerberosTime endTime, KerberosTime renewTill, KerberosPrincipal serverPrincipal,
-			HostAddresses clientAddresses) {
-		
-		_key             = key;
-		_clientPrincipal = clientPrincipal;
-		_flags           = flags;
-		_authTime        = authTime;
-		_startTime       = startTime;
-		_endTime         = endTime;
-		_renewTill       = renewTill;
-		_serverPrincipal = serverPrincipal;
-		_clientAddresses = clientAddresses;
-	}
-
-	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 KerberosPrincipal getClientPrincipal() {
-		return _clientPrincipal;
-	}
-	public KerberosTime getRenewTill() {
-		return _renewTill;
-	}
-	public KerberosPrincipal getServerPrincipal() {
-		return _serverPrincipal;
-	}
-	public KerberosTime getStartTime() {
-		return _startTime;
-	}
-}
+	public KrbCredInfo( EncryptionKey key, KerberosPrincipal clientPrincipal, TicketFlags flags,
+            KerberosTime authTime, KerberosTime startTime, KerberosTime endTime,
+            KerberosTime renewTill, KerberosPrincipal serverPrincipal, HostAddresses clientAddresses )
+    {
+        this.key             = key;
+        this.clientPrincipal = clientPrincipal;
+        this.flags           = flags;
+        this.authTime        = authTime;
+        this.startTime       = startTime;
+        this.endTime         = endTime;
+        this.renewTill       = renewTill;
+        this.serverPrincipal = serverPrincipal;
+        this.clientAddresses = clientAddresses;
+    }
+
+    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 KerberosPrincipal getClientPrincipal()
+    {
+        return clientPrincipal;
+    }
+
+    public KerberosTime getRenewTill()
+    {
+        return renewTill;
+    }
+
+    public KerberosPrincipal getServerPrincipal()
+    {
+        return serverPrincipal;
+    }
+
+    public KerberosTime getStartTime()
+    {
+        return startTime;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequest.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequest.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequest.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequest.java Tue Aug 30 13:02:20 2005
@@ -16,20 +16,22 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class LastRequest {
-	
-	private LastRequestEntry[] _entries = new LastRequestEntry[1];
-	
-	public LastRequest() {
-		_entries[0] = new LastRequestEntry(LastRequestType.NONE, new KerberosTime());
-	}
-	
-	public LastRequest(LastRequestEntry[] entries) {
-		_entries = entries;
-	}
-	
-	public LastRequestEntry[] getEntries() {
-		return _entries;
-	}
-}
+public class LastRequest
+{
+    private LastRequestEntry[] entries = new LastRequestEntry[ 1 ];
+
+    public LastRequest()
+    {
+        entries[ 0 ] = new LastRequestEntry( LastRequestType.NONE, new KerberosTime() );
+    }
 
+    public LastRequest( LastRequestEntry[] entries )
+    {
+        this.entries = entries;
+    }
+
+    public LastRequestEntry[] getEntries()
+    {
+        return entries;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequestEntry.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequestEntry.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequestEntry.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequestEntry.java Tue Aug 30 13:02:20 2005
@@ -16,21 +16,24 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class LastRequestEntry {
+public class LastRequestEntry
+{
+    private LastRequestType lastRequestType;
+    private KerberosTime lastRequestValue;
 
-	private LastRequestType _lastRequestType;
-	private KerberosTime    _lastRequestValue;
-	
-	public LastRequestEntry(LastRequestType type, KerberosTime value) {
-		_lastRequestType  = type;
-		_lastRequestValue = value;
-	}
-	
-	public LastRequestType getLastRequestType() {
-		return _lastRequestType;
-	}
-	public KerberosTime getLastRequestValue() {
-		return _lastRequestValue;
-	}
-}
+    public LastRequestEntry( LastRequestType type, KerberosTime value )
+    {
+        lastRequestType = type;
+        lastRequestValue = value;
+    }
+
+    public LastRequestType getLastRequestType()
+    {
+        return lastRequestType;
+    }
 
+    public KerberosTime getLastRequestValue()
+    {
+        return lastRequestValue;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequestType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequestType.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequestType.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/LastRequestType.java Tue Aug 30 13:02:20 2005
@@ -16,10 +16,12 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.util.*;
-
-public final class LastRequestType implements Comparable {
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 
+public final class LastRequestType implements Comparable
+{
 	/**
 	 * Enumeration elements are constructed once upon class loading.
 	 * Order of appearance here determines the order of compareTo.
@@ -31,45 +33,54 @@
 	public static final LastRequestType TIME_OF_LAST_RENEWAL = new LastRequestType(4, "time of last renewal");
 	public static final LastRequestType TIME_OF_LAST_REQ     = new LastRequestType(5, "time of last request");
 	public static final LastRequestType TIME_OF_PASSWORD_EXP = new LastRequestType(6, "time of password expiration");
-	
-	public String toString() {
-		return _fName + " (" + _fOrdinal + ")";
-	}
-
-	public int compareTo(Object that) {
-		return _fOrdinal - ((LastRequestType) that)._fOrdinal;
-	}
-
-	public static LastRequestType getTypeByOrdinal(int type) {
-		for (int i = 0; i < fValues.length; i++)
-			if (fValues[i]._fOrdinal == type)
-				return fValues[i];
-		return NONE;
-	}
-	
-	public int getOrdinal() {
-		return _fOrdinal;
-	}
-
-	/// PRIVATE /////
-	private final String _fName;
-	private final int    _fOrdinal;
-
-	/**
-	 * Private constructor prevents construction outside of this class.
-	 */
-	private LastRequestType(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 LastRequestType[] fValues = {NONE, TIME_OF_INITIAL_TGT,
-			TIME_OF_INITIAL_REQ, TIME_OF_NEWEST_TGT, TIME_OF_LAST_RENEWAL,
-			TIME_OF_LAST_REQ, TIME_OF_PASSWORD_EXP};
-	// 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 - ( (LastRequestType) that ).ordinal;
+    }
+
+    public static LastRequestType getTypeByOrdinal( int type )
+    {
+        for ( int ii = 0; ii < values.length; ii++ )
+        {
+            if ( values[ ii ].ordinal == type )
+            {
+                return values[ ii ];
+            }
+        }
+
+        return NONE;
+    }
+
+    public int getOrdinal()
+    {
+        return ordinal;
+    }
+
+    /// PRIVATE /////
+    private final String name;
+    private final int ordinal;
+
+    /**
+     * Private constructor prevents construction outside of this class.
+     */
+    private LastRequestType( 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 LastRequestType[] values = { NONE, TIME_OF_INITIAL_TGT,
+            TIME_OF_INITIAL_REQ, TIME_OF_NEWEST_TGT, TIME_OF_LAST_RENEWAL, TIME_OF_LAST_REQ,
+            TIME_OF_PASSWORD_EXP };
+    // 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/Options.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/Options.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/Options.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/Options.java Tue Aug 30 13:02:20 2005
@@ -16,59 +16,71 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.util.*;
+import java.util.BitSet;
 
-public abstract class Options {
-	
-	private BitSet _options;
-	private int    _maxSize;
-	
-	protected Options(int maxSize) {
-		_maxSize = maxSize;
-		_options = new BitSet(_maxSize);
-	}
-	
-	public boolean match(Options options, int option) {
-		return options.get(option) == this.get(option);
-	}
-	
-	public boolean get(int index) {
-		return _options.get(index);
-	}
-	
-	public void set(int index) {
-		_options.set(index);
-	}
-	
-	public void clear(int index) {
-		_options.clear(index);
-	}
-	
-	/*
-	 * Byte-reversing methods are an anomaly of the BouncyCastle
-	 * DERBitString endianness.  Thes methods can be removed if the
-	 * Apache Directory Snickers codecs operate differently.
-	 */
-    public byte[] getBytes() {
-        byte[] bytes = new byte[_maxSize/8];
-        for (int i=0; i<_maxSize; i++) {
-            if (_options.get(reversePosition(i))) {
-                bytes[bytes.length-i/8-1] |= 1<<(i%8);
+public abstract class Options
+{
+	private BitSet options;
+    private int maxSize;
+
+    protected Options( int maxSize )
+    {
+        this.maxSize = maxSize;
+        options = new BitSet( maxSize );
+    }
+
+    public boolean match( Options options, int option )
+    {
+        return options.get( option ) == this.get( option );
+    }
+
+    public boolean get( int index )
+    {
+        return options.get( index );
+    }
+
+    public void set( int index )
+    {
+        options.set( index );
+    }
+
+    public void clear( int index )
+    {
+        options.clear( index );
+    }
+
+    /*
+     * Byte-reversing methods are an anomaly of the BouncyCastle
+     * DERBitString endianness.  Thes methods can be removed if the
+     * Apache Directory Snickers codecs operate differently.
+     */
+    public byte[] getBytes()
+    {
+        byte[] bytes = new byte[ maxSize / 8 ];
+        
+        for ( int ii = 0; ii < maxSize; ii++ )
+        {
+            if ( options.get( reversePosition( ii ) ) )
+            {
+                bytes[ bytes.length - ii / 8 - 1 ] |= 1 << ( ii % 8 );
             }
         }
         return bytes;
     }
-	
-    protected void setBytes(byte[] bytes) {
-	    for (int i=0; i<bytes.length*8; i++) {
-	        if ((bytes[bytes.length-i/8-1]&(1<<(i%8))) > 0) {
-	            _options.set(reversePosition(i));
-	        }
-	    }
-    }
-    
-	private int reversePosition(int position) {
-		return _maxSize - 1 - position;
-	}
-}
 
+    protected void setBytes( byte[] bytes )
+    {
+        for ( int ii = 0; ii < bytes.length * 8; ii++ )
+        {
+            if ( ( bytes[ bytes.length - ii / 8 - 1 ] & ( 1 << ( ii % 8 ) ) ) > 0 )
+            {
+                options.set( reversePosition( ii ) );
+            }
+        }
+    }
+
+    private int reversePosition( int position )
+    {
+        return maxSize - 1 - position;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationData.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationData.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationData.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationData.java Tue Aug 30 13:02:20 2005
@@ -14,29 +14,26 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.messages.value;
 
-
 public class PreAuthenticationData
 {
-	private PreAuthenticationDataType dataType;
-	private byte[]                    dataValue;
-	
-	public PreAuthenticationData( PreAuthenticationDataType dataType, byte[] dataValue )
+    private PreAuthenticationDataType dataType;
+    private byte[] dataValue;
+
+    public PreAuthenticationData( PreAuthenticationDataType dataType, byte[] dataValue )
     {
-		this.dataType  = dataType;
-		this.dataValue = dataValue;
-	}
-	
-	public PreAuthenticationDataType getDataType()
+        this.dataType = dataType;
+        this.dataValue = dataValue;
+    }
+
+    public PreAuthenticationDataType getDataType()
     {
-		return dataType;
-	}
-	
-	public byte[] getDataValue()
+        return dataType;
+    }
+
+    public byte[] getDataValue()
     {
-		return dataValue;
-	}
+        return dataValue;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationDataModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationDataModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationDataModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationDataModifier.java Tue Aug 30 13:02:20 2005
@@ -14,28 +14,25 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.messages.value;
 
-
 public class PreAuthenticationDataModifier
 {
-	private PreAuthenticationDataType dataType;
-	private byte[]                    dataValue;
-	
-	public PreAuthenticationData getPreAuthenticationData()
+    private PreAuthenticationDataType dataType;
+    private byte[] dataValue;
+
+    public PreAuthenticationData getPreAuthenticationData()
     {
-		return new PreAuthenticationData( dataType, dataValue );
-	}
-	
-	public void setDataType( PreAuthenticationDataType dataType )
+        return new PreAuthenticationData( dataType, dataValue );
+    }
+
+    public void setDataType( PreAuthenticationDataType dataType )
     {
-		this.dataType = dataType;
-	}
-	
-	public void setDataValue( byte[] dataValue )
+        this.dataType = dataType;
+    }
+
+    public void setDataValue( byte[] dataValue )
     {
-		this.dataValue = dataValue;
-	}
+        this.dataValue = dataValue;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationDataType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationDataType.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationDataType.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PreAuthenticationDataType.java Tue Aug 30 13:02:20 2005
@@ -14,14 +14,12 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.messages.value;
 
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-
 public class PreAuthenticationDataType implements Comparable
 {
 	/**
@@ -46,59 +44,56 @@
 	public static final PreAuthenticationDataType PA_USE_SPECIFIED_KVNO  = new PreAuthenticationDataType( 20, "use specified key version" );
 	public static final PreAuthenticationDataType SAM_REDIRECT           = new PreAuthenticationDataType( 21, "SAM redirect." );
 	public static final PreAuthenticationDataType PA_GET_FROM_TYPED_DATA = new PreAuthenticationDataType( 22, "Get from typed data" );
-	
+
 	/** Array for building a List of VALUES. */
-	private static final PreAuthenticationDataType[] values = {
-	    NULL, PA_TGS_REQ, PA_ENC_TIMESTAMP, PA_PW_SALT, PA_ENC_UNIX_TIME, PA_SANDIA_SECUREID,
-	    PA_SESAME, PA_OSF_DCE, PA_CYBERSAFE_SECUREID, PA_ASF3_SALT, PA_ENCTYPE_INFO,
-		SAM_CHALLENGE, SAM_RESPONSE, PA_PK_AS_REQ, PA_PK_AS_REP, PA_USE_SPECIFIED_KVNO,
-		SAM_REDIRECT, PA_GET_FROM_TYPED_DATA
-	};
-	
-	/** A list of all the pre-authentication type constants. */
-	public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
-	
-	/** The name of the pre-authentication type. */
-	private final String name;
-	
-	/** The value/code for the pre-authentication type. */
-	private final int ordinal;
-	
-	/**
-	 * Private constructor prevents construction outside of this class.
-	 */
-	private PreAuthenticationDataType( int ordinal, String name )
-	{
-		this.ordinal = ordinal;
-		this.name    = name;
-	}
-	
-	public String toString()
-	{
-		return name + " (" + ordinal + ")";
-	}
-	
-	public int compareTo( Object that )
-	{
-		return ordinal - ( (PreAuthenticationDataType) that ).ordinal;
-	}
-
-	public static PreAuthenticationDataType 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 static final PreAuthenticationDataType[] values = { NULL, PA_TGS_REQ, PA_ENC_TIMESTAMP,
+            PA_PW_SALT, PA_ENC_UNIX_TIME, PA_SANDIA_SECUREID, PA_SESAME, PA_OSF_DCE,
+            PA_CYBERSAFE_SECUREID, PA_ASF3_SALT, PA_ENCTYPE_INFO, SAM_CHALLENGE, SAM_RESPONSE,
+            PA_PK_AS_REQ, PA_PK_AS_REP, PA_USE_SPECIFIED_KVNO, SAM_REDIRECT, PA_GET_FROM_TYPED_DATA };
+
+    /** A list of all the pre-authentication type constants. */
+    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
+
+    /** The name of the pre-authentication type. */
+    private final String name;
+
+    /** The value/code for the pre-authentication type. */
+    private final int ordinal;
+
+    /**
+     * Private constructor prevents construction outside of this class.
+     */
+    private PreAuthenticationDataType( int ordinal, String name )
+    {
+        this.ordinal = ordinal;
+        this.name = name;
+    }
+
+    public String toString()
+    {
+        return name + " (" + ordinal + ")";
+    }
+
+    public int compareTo( Object that )
+    {
+        return ordinal - ( (PreAuthenticationDataType) that ).ordinal;
+    }
+
+    public static PreAuthenticationDataType 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;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalName.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalName.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalName.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalName.java Tue Aug 30 13:02:20 2005
@@ -16,22 +16,24 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class PrincipalName {
-	
-	private String _nameComponent;
-	private int    _nameType;
-	
-	public PrincipalName(String nameComponent, int nameType) {
-		_nameComponent = nameComponent;
-		_nameType      = nameType;
-	}
+public class PrincipalName
+{
+    private String nameComponent;
+    private int nameType;
 
-	public int getNameType() {
-		return _nameType;
-	}
+    public PrincipalName( String nameComponent, int nameType )
+    {
+        this.nameComponent = nameComponent;
+        this.nameType = nameType;
+    }
 
-	public String getNameComponent() {
-		return _nameComponent;
-	}
-}
+    public int getNameType()
+    {
+        return nameType;
+    }
 
+    public String getNameComponent()
+    {
+        return nameComponent;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalNameModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalNameModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalNameModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalNameModifier.java Tue Aug 30 13:02:20 2005
@@ -16,34 +16,43 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
-public class PrincipalNameModifier {
-	
-	private static final String COMPONENT_SEPARATOR = "/";
-	
-	List   _components = new ArrayList();
-	int    _nameType;
-	
-	public PrincipalName getPrincipalName() {
-		StringBuffer sb = new StringBuffer();
-		Iterator it = _components.iterator();
-		while (it.hasNext()) {
-			String component = (String)it.next();
-			sb.append(component);
-			if (it.hasNext()) {
-				sb.append(COMPONENT_SEPARATOR);
-			}
-		}
-		return new PrincipalName(sb.toString(), _nameType);
-	}
-
-	public void setType(int type) {
-		_nameType = type;
-	}
-
-	public void addName(String name) {
-		_components.add(name);
-	}
-}
+public class PrincipalNameModifier
+{
+    private static final String COMPONENT_SEPARATOR = "/";
+
+    List components = new ArrayList();
+    int nameType;
+
+    public PrincipalName getPrincipalName()
+    {
+        StringBuffer sb = new StringBuffer();
+        Iterator it = components.iterator();
+
+        while ( it.hasNext() )
+        {
+            String component = (String) it.next();
+            sb.append( component );
 
+            if ( it.hasNext() )
+            {
+                sb.append( COMPONENT_SEPARATOR );
+            }
+        }
+
+        return new PrincipalName( sb.toString(), nameType );
+    }
+
+    public void setType( int type )
+    {
+        nameType = type;
+    }
+
+    public void addName( String name )
+    {
+        components.add( name );
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalNameType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalNameType.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalNameType.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/PrincipalNameType.java Tue Aug 30 13:02:20 2005
@@ -16,10 +16,12 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.util.*;
-
-public final class PrincipalNameType implements Comparable {
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 
+public final class PrincipalNameType implements Comparable
+{
 	/**
 	 * Enumeration elements are constructed once upon class loading.
 	 * Order of appearance here determines the order of compareTo.
@@ -38,44 +40,53 @@
 		new PrincipalNameType(5, "unique ID name type");
 	public static final PrincipalNameType KRB_NT_X500_PRINCIPAL =  
 		new PrincipalNameType(6, "nt x500 principal; encoded X.509 Distinguished name [RFC 2253]");
-	
-	public String toString() {
-		return _fName + " (" + _fOrdinal + ")";
-	}
-
-	public int compareTo(Object that) {
-		return _fOrdinal - ((PrincipalNameType) that)._fOrdinal;
-	}
-
-	public static PrincipalNameType getTypeByOrdinal(int type) {
-		for (int i = 0; i < fValues.length; i++)
-			if (fValues[i]._fOrdinal == type)
-				return fValues[i];
-		return KRB_NT_UNKNOWN;
-	}
-	
-	public int getOrdinal() {
-		return _fOrdinal;
-	}
-
-	/// PRIVATE /////
-	private final String _fName;
-	private final int    _fOrdinal;
-
-	/**
-	 * Private constructor prevents construction outside of this class.
-	 */
-	private PrincipalNameType(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 PrincipalNameType[] fValues = {KRB_NT_UNKNOWN, KRB_NT_PRINCIPAL, 
-			KRB_NT_SRV_INST, KRB_NT_SRV_HST, KRB_NT_SRV_XHST, KRB_NT_UID, KRB_NT_X500_PRINCIPAL};
-	// 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 - ( (PrincipalNameType) that ).ordinal;
+    }
+
+    public static PrincipalNameType getTypeByOrdinal( int type )
+    {
+        for ( int ii = 0; ii < values.length; ii++ )
+        {
+            if ( values[ ii ].ordinal == type )
+            {
+                return values[ ii ];
+            }
+        }
+        
+        return KRB_NT_UNKNOWN;
+    }
+
+    public int getOrdinal()
+    {
+        return ordinal;
+    }
+
+    /// PRIVATE /////
+    private final String name;
+    private final int ordinal;
+
+    /**
+     * Private constructor prevents construction outside of this class.
+     */
+    private PrincipalNameType( 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 PrincipalNameType[] values = { KRB_NT_UNKNOWN, KRB_NT_PRINCIPAL,
+            KRB_NT_SRV_INST, KRB_NT_SRV_HST, KRB_NT_SRV_XHST, KRB_NT_UID, KRB_NT_X500_PRINCIPAL };
+    // 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/RequestBody.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/RequestBody.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/RequestBody.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/RequestBody.java Tue Aug 30 13:02:20 2005
@@ -16,75 +16,95 @@
  */
 package org.apache.kerberos.messages.value;
 
-import org.apache.kerberos.crypto.encryption.*;
-import org.apache.kerberos.messages.components.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.crypto.encryption.EncryptionType;
+import org.apache.kerberos.messages.components.Ticket;
 
-public class RequestBody {
-
-	private KdcOptions        _kdcOptions;
-	private KerberosPrincipal _clientPrincipal;      //optional in TgsReq only
-	private KerberosPrincipal _serverPrincipal;
-	private KerberosTime      _from;                 //optional
-	private KerberosTime      _till;
-	private KerberosTime      _rtime;                //optional
-	private int               _nonce;
-	private EncryptionType[]  _eType;
-	private HostAddresses     _addresses;            //optional
-	private EncryptedData     _encAuthorizationData; //optional
-	private Ticket[]          _additionalTickets;    //optional
-
-	public RequestBody(KdcOptions kdcOptions, KerberosPrincipal clientPrincipal,
-			KerberosPrincipal serverPrincipal, KerberosTime from, KerberosTime till, KerberosTime rtime,
-			int nonce, EncryptionType[] eType, HostAddresses addresses, EncryptedData encAuthorizationData,
-			Ticket[] additionalTickets) {
-		
-		_kdcOptions           = kdcOptions;
-		_clientPrincipal      = clientPrincipal;
-		_serverPrincipal      = serverPrincipal;
-		_from                 = from;
-		_till                 = till;
-		_rtime                = rtime;
-		_nonce                = nonce;
-		_eType                = eType;
-		_addresses            = addresses;
-		_encAuthorizationData = encAuthorizationData;
-		_additionalTickets    = additionalTickets;
-	}
-
-	public Ticket[] getAdditionalTickets() {
-		return _additionalTickets;
-	}
-	public HostAddresses getAddresses() {
-		return _addresses;
-	}
-	public KerberosPrincipal getClientPrincipal() {
-		return _clientPrincipal;
-	}
-	public KerberosPrincipal getServerPrincipal() {
-		return _serverPrincipal;
-	}
-	public EncryptedData getEncAuthorizationData() {
-		return _encAuthorizationData;
-	}
-	public EncryptionType[] getEType() {
-		return _eType;
-	}
-	public KerberosTime getFrom() {
-		return _from;
-	}
-	public KdcOptions getKdcOptions() {
-		return _kdcOptions;
-	}
-	public int getNonce() {
-		return _nonce;
-	}
-	public KerberosTime getRtime() {
-		return _rtime;
-	}
-	public KerberosTime getTill() {
-		return _till;
-	}
+public class RequestBody
+{
+	private KdcOptions        kdcOptions;
+	private KerberosPrincipal clientPrincipal;      //optional in TgsReq only
+	private KerberosPrincipal serverPrincipal;
+	private KerberosTime      from;                 //optional
+	private KerberosTime      till;
+	private KerberosTime      rtime;                //optional
+	private int               nonce;
+	private EncryptionType[]  eType;
+	private HostAddresses     addresses;            //optional
+	private EncryptedData     encAuthorizationData; //optional
+	private Ticket[]          additionalTickets;    //optional
+
+	public RequestBody( KdcOptions kdcOptions, KerberosPrincipal clientPrincipal,
+            KerberosPrincipal serverPrincipal, KerberosTime from, KerberosTime till,
+            KerberosTime rtime, int nonce, EncryptionType[] eType, HostAddresses addresses,
+            EncryptedData encAuthorizationData, Ticket[] additionalTickets )
+    {
+        this.kdcOptions           = kdcOptions;
+        this.clientPrincipal      = clientPrincipal;
+        this.serverPrincipal      = serverPrincipal;
+        this.from                 = from;
+        this.till                 = till;
+        this.rtime                = rtime;
+        this.nonce                = nonce;
+        this.eType                = eType;
+        this.addresses            = addresses;
+        this.encAuthorizationData = encAuthorizationData;
+        this.additionalTickets    = additionalTickets;
+    }
+
+    public Ticket[] getAdditionalTickets()
+    {
+        return additionalTickets;
+    }
+
+    public HostAddresses getAddresses()
+    {
+        return addresses;
+    }
+
+    public KerberosPrincipal getClientPrincipal()
+    {
+        return clientPrincipal;
+    }
+
+    public KerberosPrincipal getServerPrincipal()
+    {
+        return serverPrincipal;
+    }
+
+    public EncryptedData getEncAuthorizationData()
+    {
+        return encAuthorizationData;
+    }
+
+    public EncryptionType[] getEType()
+    {
+        return eType;
+    }
+
+    public KerberosTime getFrom()
+    {
+        return from;
+    }
+
+    public KdcOptions getKdcOptions()
+    {
+        return kdcOptions;
+    }
+
+    public int getNonce()
+    {
+        return nonce;
+    }
+
+    public KerberosTime getRtime()
+    {
+        return rtime;
+    }
+
+    public KerberosTime getTill()
+    {
+        return till;
+    }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/RequestBodyModifier.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/RequestBodyModifier.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/RequestBodyModifier.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/RequestBodyModifier.java Tue Aug 30 13:02:20 2005
@@ -16,69 +16,92 @@
  */
 package org.apache.kerberos.messages.value;
 
-import org.apache.kerberos.crypto.encryption.*;
-import org.apache.kerberos.messages.components.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.crypto.encryption.EncryptionType;
+import org.apache.kerberos.messages.components.Ticket;
 
-public class RequestBodyModifier {
-	
-	private KerberosPrincipalModifier _clientModifier = new KerberosPrincipalModifier(); //optional in TgsReq only
-	private KerberosPrincipalModifier _serverModifier = new KerberosPrincipalModifier();
-	private KdcOptions       _kdcOptions;
-	private KerberosTime     _from;                 //optional
-	private KerberosTime     _till;
-	private KerberosTime     _rtime;                //optional
-	private int              _nonce;
-	private EncryptionType[] _eType;
-	private HostAddresses    _addresses;            //optional
-	private EncryptedData    _encAuthorizationData; //optional
-	private Ticket[]         _additionalTickets;    //optional
-	
-	public RequestBody getRequestBody() {
-		KerberosPrincipal clientPrincipal = _clientModifier.getKerberosPrincipal();
-		KerberosPrincipal serverPrincipal = _serverModifier.getKerberosPrincipal();
-		
-		return new RequestBody(_kdcOptions, clientPrincipal, serverPrincipal, _from, _till, _rtime,
-			_nonce, _eType, _addresses, _encAuthorizationData, _additionalTickets);
-	}
-	
-	public void setClientName(PrincipalName clientName) {
-		_clientModifier.setPrincipalName(clientName);
-	}
-	public void setServerName(PrincipalName serverName) {
-		_serverModifier.setPrincipalName(serverName);
-	}
-	public void setRealm(String realm) {
-		_clientModifier.setRealm(realm);
-		_serverModifier.setRealm(realm);
-	}
-	public void setAdditionalTickets(Ticket[] tickets) {
-		_additionalTickets = tickets;
-	}
-	public void setAddresses(HostAddresses addresses) {
-		_addresses = addresses;
-	}
-	public void setEncAuthorizationData(EncryptedData authorizationData) {
-		_encAuthorizationData = authorizationData;
-	}
-	public void setEType(EncryptionType[] type) {
-		_eType = type;
-	}
-	public void setFrom(KerberosTime from) {
-		_from = from;
-	}
-	public void setKdcOptions(KdcOptions options) {
-		_kdcOptions = options;
-	}
-	public void setNonce(int nonce) {
-		_nonce = nonce;
-	}
-	public void setRtime(KerberosTime rtime) {
-		_rtime = rtime;
-	}
-	public void setTill(KerberosTime till) {
-		_till = till;
-	}
-}
+public class RequestBodyModifier
+{
+	private KerberosPrincipalModifier clientModifier = new KerberosPrincipalModifier(); //optional in TgsReq only
+	private KerberosPrincipalModifier serverModifier = new KerberosPrincipalModifier();
+	private KdcOptions       kdcOptions;
+	private KerberosTime     from;                 //optional
+	private KerberosTime     till;
+	private KerberosTime     rtime;                //optional
+	private int              nonce;
+	private EncryptionType[] eType;
+	private HostAddresses    addresses;            //optional
+	private EncryptedData    encAuthorizationData; //optional
+	private Ticket[]         additionalTickets;    //optional
+
+	public RequestBody getRequestBody()
+    {
+        KerberosPrincipal clientPrincipal = clientModifier.getKerberosPrincipal();
+        KerberosPrincipal serverPrincipal = serverModifier.getKerberosPrincipal();
+
+        return new RequestBody( kdcOptions, clientPrincipal, serverPrincipal, from, till,
+                rtime, nonce, eType, addresses, encAuthorizationData, additionalTickets );
+    }
+
+    public void setClientName( PrincipalName clientName )
+    {
+        clientModifier.setPrincipalName( clientName );
+    }
+
+    public void setServerName( PrincipalName serverName )
+    {
+        serverModifier.setPrincipalName( serverName );
+    }
+
+    public void setRealm( String realm )
+    {
+        clientModifier.setRealm( realm );
+        serverModifier.setRealm( realm );
+    }
+
+    public void setAdditionalTickets( Ticket[] tickets )
+    {
+        additionalTickets = tickets;
+    }
+
+    public void setAddresses( HostAddresses addresses )
+    {
+        this.addresses = addresses;
+    }
 
+    public void setEncAuthorizationData( EncryptedData authorizationData )
+    {
+        encAuthorizationData = authorizationData;
+    }
+
+    public void setEType( EncryptionType[] type )
+    {
+        eType = type;
+    }
+
+    public void setFrom( KerberosTime from )
+    {
+        this.from = from;
+    }
+
+    public void setKdcOptions( KdcOptions options )
+    {
+        kdcOptions = options;
+    }
+
+    public void setNonce( int nonce )
+    {
+        this.nonce = nonce;
+    }
+
+    public void setRtime( KerberosTime rtime )
+    {
+        this.rtime = rtime;
+    }
+
+    public void setTill( KerberosTime till )
+    {
+        this.till = till;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/SamType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/SamType.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/SamType.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/SamType.java Tue Aug 30 13:02:20 2005
@@ -16,11 +16,9 @@
  */
 package org.apache.kerberos.messages.value;
 
-
-import java.util.List;
 import java.util.Arrays;
 import java.util.Collections;
-
+import java.util.List;
 
 /**
  * Type safe enumeration of Single-use Authentication Mechanism types
@@ -72,7 +70,6 @@
     /** the value/code for the sam type */
     private final int ordinal;
 
-
     /**
      * Private constructor prevents construction outside of this class.
      */
@@ -82,7 +79,6 @@
         this.name    = name;
     }
 
-
     /**
      * Returns the name of the SamType.
      *
@@ -93,7 +89,6 @@
 		return name;
 	}
 
-
     /**
      * Compares this type to another object hopefully one that is of the same
      * type.
@@ -106,7 +101,6 @@
 		return ordinal - ( ( SamType ) that ).ordinal;
 	}
 
-
     /**
      * Gets the ordinal by its ordinal value.
      *
@@ -126,7 +120,6 @@
 		return PA_SAM_TYPE_APACHE;
 	}
 
-
     /**
      * Gets the ordinal value associated with this SAM type.
      *
@@ -137,4 +130,3 @@
 		return ordinal;
 	}
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TicketFlags.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TicketFlags.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TicketFlags.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TicketFlags.java Tue Aug 30 13:02:20 2005
@@ -16,7 +16,8 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class TicketFlags extends Options {
+public class TicketFlags extends Options
+{
 	// Ticket flag - reserved
 	public static final int RESERVED                 = 0;
 	// Ticket flag - forwardable
@@ -45,54 +46,96 @@
 	public static final int TRANSITED_POLICY_CHECKED = 12;
 	// Ticket flag - OK as delegate
 	public static final int OK_AS_DELEGATE           = 13;
-	
+
 	// Ticket flag - maximum value
 	public static final int MAX_VALUE                = 32;
 
 	/**
-	 * Class constructor
-	 */
-	public TicketFlags() {
-		super(MAX_VALUE);
-	}
-	
-	public TicketFlags(byte[] options) {
-		super(MAX_VALUE);
-		setBytes(options);
-	}
+     * Class constructor
+     */
+    public TicketFlags()
+    {
+        super( MAX_VALUE );
+    }
 
-	/**
-	 * Converts the object to a printable string
-	 */
-	public String toString() {
-		StringBuffer result = new StringBuffer();
-		if (get(FORWARDABLE))
-			result.append("FORWARDABLE ");
-		if (get(FORWARDED))
-			result.append("FORWARDED ");
-		if (get(PROXIABLE))
-			result.append("PROXIABLE ");
-		if (get(PROXY))
-			result.append("PROXY ");
-		if (get(MAY_POSTDATE))
-			result.append("MAY_POSTDATE ");
-		if (get(POSTDATED))
-			result.append("POSTDATED ");
-		if (get(INVALID))
-			result.append("INVALID ");
-		if (get(RENEWABLE))
-			result.append("RENEWABLE ");
-		if (get(INITIAL))
-			result.append("INITIAL ");
-		if (get(PRE_AUTHENT))
-			result.append("PRE_AUTHENT ");
-		if (get(HW_AUTHENT))
-			result.append("HW_AUTHENT ");
-		if (get(TRANSITED_POLICY_CHECKED))
-			result.append("TRANSITED_POLICY_CHECKED ");
-		if (get(OK_AS_DELEGATE))
-			result.append("OPTS_OK_AS_DELEGATE ");
-		return result.toString().trim();
-	}
-}
+    public TicketFlags( byte[] options )
+    {
+        super( MAX_VALUE );
+        setBytes( options );
+    }
+
+    /**
+     * Converts the object to a printable string
+     */
+    public String toString()
+    {
+        StringBuffer result = new StringBuffer();
+
+        if ( get( FORWARDABLE ) )
+        {
+            result.append( "FORWARDABLE " );
+        }
+
+        if ( get( FORWARDED ) )
+        {
+            result.append( "FORWARDED " );
+        }
+
+        if ( get( PROXIABLE ) )
+        {
+            result.append( "PROXIABLE " );
+        }
+
+        if ( get( PROXY ) )
+        {
+            result.append( "PROXY " );
+        }
+
+        if ( get( MAY_POSTDATE ) )
+        {
+            result.append( "MAY_POSTDATE " );
+        }
 
+        if ( get( POSTDATED ) )
+        {
+            result.append( "POSTDATED " );
+        }
+
+        if ( get( INVALID ) )
+        {
+            result.append( "INVALID " );
+        }
+
+        if ( get( RENEWABLE ) )
+        {
+            result.append( "RENEWABLE " );
+        }
+
+        if ( get( INITIAL ) )
+        {
+            result.append( "INITIAL " );
+        }
+
+        if ( get( PRE_AUTHENT ) )
+        {
+            result.append( "PRE_AUTHENT " );
+        }
+
+        if ( get( HW_AUTHENT ) )
+        {
+            result.append( "HW_AUTHENT " );
+        }
+
+        if ( get( TRANSITED_POLICY_CHECKED ) )
+        {
+            result.append( "TRANSITED_POLICY_CHECKED " );
+        }
+
+        if ( get( OK_AS_DELEGATE ) )
+        {
+            result.append( "OPTS_OK_AS_DELEGATE " );
+        }
+
+        return result.toString().trim();
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TransitedEncoding.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TransitedEncoding.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TransitedEncoding.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TransitedEncoding.java Tue Aug 30 13:02:20 2005
@@ -16,26 +16,30 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class TransitedEncoding {
-	
-	private TransitedEncodingType _type;
-	private byte[]                _contents;
-	
-	public TransitedEncoding() {
-		_type = TransitedEncodingType.NULL;
-		_contents = new byte[0];
-	}
-	
-	public TransitedEncoding(TransitedEncodingType type, byte[] contents) {
-		_type     = type;
-		_contents = contents;
-	}
-	
-	public byte[] getContents() {
-		return _contents;
-	}
-	public TransitedEncodingType getType() {
-		return _type;
-	}
-}
+public class TransitedEncoding
+{
+    private TransitedEncodingType type;
+    private byte[] contents;
+
+    public TransitedEncoding()
+    {
+        type = TransitedEncodingType.NULL;
+        contents = new byte[ 0 ];
+    }
+
+    public TransitedEncoding( TransitedEncodingType type, byte[] contents )
+    {
+        this.type = type;
+        this.contents = contents;
+    }
 
+    public byte[] getContents()
+    {
+        return contents;
+    }
+
+    public TransitedEncodingType getType()
+    {
+        return type;
+    }
+}

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TransitedEncodingType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TransitedEncodingType.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TransitedEncodingType.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/value/TransitedEncodingType.java Tue Aug 30 13:02:20 2005
@@ -16,53 +16,64 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.util.*;
-
-public final class TransitedEncodingType implements Comparable {
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 
+public final class TransitedEncodingType implements Comparable
+{
 	/**
 	 * Enumeration elements are constructed once upon class loading.
 	 * Order of appearance here determines the order of compareTo.
 	 */
 	public static final TransitedEncodingType NULL                 = new TransitedEncodingType(0, "null");
 	public static final TransitedEncodingType DOMAIN_X500_COMPRESS = new TransitedEncodingType(1, "Domain X500 compress");
-	
-	public String toString() {
-		return _fName + " (" + _fOrdinal + ")";
-	}
-
-	public int compareTo(Object that) {
-		return _fOrdinal - ((TransitedEncodingType) that)._fOrdinal;
-	}
-
-	public static TransitedEncodingType 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 TransitedEncodingType(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 TransitedEncodingType[] fValues = {NULL, DOMAIN_X500_COMPRESS};
-	// 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 - ( (TransitedEncodingType) that ).ordinal;
+    }
+
+    public static TransitedEncodingType 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 TransitedEncodingType( 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 TransitedEncodingType[] values = { NULL, DOMAIN_X500_COMPRESS };
+    // 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/replay/InMemoryReplayCache.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/replay/InMemoryReplayCache.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/replay/InMemoryReplayCache.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/replay/InMemoryReplayCache.java Tue Aug 30 13:02:20 2005
@@ -16,68 +16,82 @@
  */
 package org.apache.kerberos.replay;
 
-import org.apache.kerberos.messages.value.*;
-
-import java.util.*;
-
-import javax.security.auth.kerberos.*;
-
-public class InMemoryReplayCache implements ReplayCache {
-	
-	private static final long TWO_WEEKS = 1000 * 60 * 60 * 24 * 14;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.security.auth.kerberos.KerberosPrincipal;
+
+import org.apache.kerberos.messages.value.KerberosTime;
+
+public class InMemoryReplayCache implements ReplayCache
+{
+    private static final long TWO_WEEKS = 1000 * 60 * 60 * 24 * 14;
 
     private List list = new ArrayList();
 
-    public synchronized boolean isReplay(KerberosTime clientTime, KerberosPrincipal clientPrincipal) {
-        ReplayCacheEntry testEntry = new ReplayCacheEntry(clientTime, clientPrincipal);
+    public synchronized boolean isReplay( KerberosTime clientTime, KerberosPrincipal clientPrincipal )
+    {
+        ReplayCacheEntry testEntry = new ReplayCacheEntry( clientTime, clientPrincipal );
         Iterator it = list.iterator();
-        while (it.hasNext()) {
-            ReplayCacheEntry entry = (ReplayCacheEntry)it.next();
-            if (entry.equals(testEntry))
+        while ( it.hasNext() )
+        {
+            ReplayCacheEntry entry = (ReplayCacheEntry) it.next();
+            if ( entry.equals( testEntry ) )
+            {
                 return true;
+            }
         }
         return false;
     }
 
-    public synchronized void save(KerberosTime clientTime, KerberosPrincipal clientPrincipal) {
-        list.add(new ReplayCacheEntry(clientTime, clientPrincipal));
+    public synchronized void save( KerberosTime clientTime, KerberosPrincipal clientPrincipal )
+    {
+        list.add( new ReplayCacheEntry( clientTime, clientPrincipal ) );
         purgeExpired();
     }
-    
+
     /*
      * TODO - age needs to be configurable; requires store
      */
-    private synchronized void purgeExpired() {
-    	long now = new Date().getTime();
-    	
-        KerberosTime age = new KerberosTime(now - TWO_WEEKS);
-        
+    private synchronized void purgeExpired()
+    {
+        long now = new Date().getTime();
+
+        KerberosTime age = new KerberosTime( now - TWO_WEEKS );
+
         Iterator it = list.iterator();
-        while (it.hasNext()) {
-            ReplayCacheEntry entry = (ReplayCacheEntry)it.next();
-            if (entry.olderThan(age))
-                list.remove(entry);
+        while ( it.hasNext() )
+        {
+            ReplayCacheEntry entry = (ReplayCacheEntry) it.next();
+            if ( entry.olderThan( age ) )
+            {
+                list.remove( entry );
+            }
         }
     }
-    
-    private class ReplayCacheEntry {
 
-    	private KerberosTime      _clientTime;
-    	private KerberosPrincipal _clientPrincipal;
-    	
-    	public ReplayCacheEntry(KerberosTime time, KerberosPrincipal principal) {
-    		_clientTime      = time;
-    		_clientPrincipal = principal;
-    	}
-    	
-        public boolean equals(ReplayCacheEntry other) {
-            return _clientTime.equals(other._clientTime) && 
-    				_clientPrincipal.equals(other._clientPrincipal);
+    private class ReplayCacheEntry
+    {
+        private KerberosTime clientTime;
+        private KerberosPrincipal clientPrincipal;
+
+        public ReplayCacheEntry( KerberosTime time, KerberosPrincipal principal )
+        {
+            clientTime = time;
+            clientPrincipal = principal;
         }
-        
-        public boolean olderThan(KerberosTime time) {
-            return time.greaterThan(_clientTime);
+
+        public boolean equals( ReplayCacheEntry other )
+        {
+            return clientTime.equals( other.clientTime )
+                    && clientPrincipal.equals( other.clientPrincipal );
+        }
+
+        public boolean olderThan( KerberosTime time )
+        {
+            return time.greaterThan( clientTime );
         }
     }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/replay/ReplayCache.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/replay/ReplayCache.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/replay/ReplayCache.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/replay/ReplayCache.java Tue Aug 30 13:02:20 2005
@@ -16,14 +16,13 @@
  */
 package org.apache.kerberos.replay;
 
-import org.apache.kerberos.messages.value.*;
+import javax.security.auth.kerberos.KerberosPrincipal;
 
-import javax.security.auth.kerberos.*;
+import org.apache.kerberos.messages.value.KerberosTime;
 
-public interface ReplayCache {
+public interface ReplayCache
+{
+    boolean isReplay( KerberosTime clientTime, KerberosPrincipal clientPrincipal );
 
-    boolean isReplay(KerberosTime clientTime, KerberosPrincipal clientPrincipal);
-    
-    void save(KerberosTime clientTime, KerberosPrincipal clientPrincipal);
+    void save( KerberosTime clientTime, KerberosPrincipal clientPrincipal );
 }
-

Propchange: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/ErrorMessageHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/GetPrincipalStoreEntry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyAuthHeader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyTicket.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/ContextOperation.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/ContextOperation.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/ContextOperation.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/ContextOperation.java Tue Aug 30 13:02:20 2005
@@ -16,13 +16,11 @@
  */
 package org.apache.kerberos.store;
 
-
 import java.io.Serializable;
 
 import javax.naming.Name;
 import javax.naming.directory.DirContext;
 
-
 /**
  * Doc me.
  *
@@ -41,4 +39,3 @@
      */
     public Object execute( DirContext ctx, Name searchBaseDn ) throws Exception;
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java Tue Aug 30 13:02:20 2005
@@ -16,11 +16,9 @@
  */
 package org.apache.kerberos.store;
 
-
 import javax.naming.Name;
 import javax.naming.ldap.LdapContext;
 
-
 /**
  * A simple implementation of the PrincipalStore interface using a JNDI
  * based store.
@@ -36,7 +34,6 @@
     /** the search searchBase relative to the DN of the context supplied */
     private Name searchBase;
 
-
     /**
      * Creates the action to be used against the embedded ApacheDS DIT.  Note
      * the searchBase is a relative name to the context and not a DN.
@@ -51,13 +48,11 @@
         this.searchBase = searchBase;
     }
 
-
     public Object execute( ContextOperation operation ) throws Exception
     {
         return operation.execute( ctx, searchBase );
     }
 
-
     /**
      * Gets the LdapContext used to search for principals in the JNDI store.
      *
@@ -68,7 +63,6 @@
         return ctx;
     }
 
-
     /**
      * Gets the search base use for finding principals in the the store.
      *
@@ -79,4 +73,3 @@
         return searchBase;
     }
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/KerberosAttribute.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/KerberosAttribute.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/KerberosAttribute.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/KerberosAttribute.java Tue Aug 30 13:02:20 2005
@@ -14,16 +14,14 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.store;
 
-
 public class KerberosAttribute
 {
     // ------------------------------------------------------------------------
     // Krb5 Schema Attributes
     // ------------------------------------------------------------------------
-    
+
     /** the krb5kdc schema key for a krb5KDCEntry */
     public static final String KEY       = "krb5Key";
     /** the krb5kdc schema key encryption type for a krb5KDCEntry */
@@ -33,6 +31,5 @@
     /** the krb5kdc schema key version identifier for a krb5KDCEntry */
     public static final String VERSION   = "krb5KeyVersionNumber";
     /** the Apache specific SAM type attribute */
-    public static final String SAM_TYPE   = "apacheSamType";
+    public static final String SAM_TYPE  = "apacheSamType";
 }
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStore.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStore.java?rev=264844&r1=264843&r2=264844&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStore.java (original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStore.java Tue Aug 30 13:02:20 2005
@@ -14,12 +14,9 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.store;
 
-
 public interface PrincipalStore
 {
     public Object execute( ContextOperation operation ) throws Exception;
 }
-



Mime
View raw message