directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r234002 - /directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/
Date Sat, 20 Aug 2005 06:41:36 GMT
Author: erodriguez
Date: Fri Aug 19 23:41:26 2005
New Revision: 234002

URL: http://svn.apache.org/viewcvs?rev=234002&view=rev
Log:
Reformatting:  imports, whitespace, line breaks, or code convention.

Modified:
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/AuthorizationDataEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ChecksumEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncTgsRepPartEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptedDataEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptedTimestampEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionKeyEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionTypeEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionTypeInfoEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/HostAddressesEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KerberosTimeEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/LastRequestEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PreAuthenticationDataEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PrincipalNameEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/TicketEncoder.java
    directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/TransitedEncodingEncoder.java

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -27,32 +26,30 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.application.ApplicationReply;
 
-
 public class ApplicationReplyEncoder
 {
-	public static final int APPLICATION_CODE = 15;
-	
-	public byte[] encode( ApplicationReply reply ) throws IOException
-	{
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		ASN1OutputStream aos = new ASN1OutputStream( baos );
-		
-		DERSequence replySequence = encodeReplySequence( reply );
-		aos.writeObject( DERApplicationSpecific.valueOf( APPLICATION_CODE, replySequence ) );
-		aos.close();
-		
-		return baos.toByteArray();
-	}
-	
-	private DERSequence encodeReplySequence( ApplicationReply message )
-	{
-		DERSequence sequence = new DERSequence();
-		
-		sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( message.getProtocolVersionNumber() ) ) );
-		sequence.add( new DERTaggedObject( 1, DERInteger.valueOf( message.getMessageType().getOrdinal() ) ) );
-		sequence.add( new DERTaggedObject( 2, EncryptedDataEncoder.encodeSequence(message.getEncPart() ) ) );
-		
-		return sequence;
-	}
-}
+    public static final int APPLICATION_CODE = 15;
 
+    public byte[] encode( ApplicationReply reply ) throws IOException
+    {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ASN1OutputStream aos = new ASN1OutputStream( baos );
+
+        DERSequence replySequence = encodeReplySequence( reply );
+        aos.writeObject( DERApplicationSpecific.valueOf( APPLICATION_CODE, replySequence ) );
+        aos.close();
+
+        return baos.toByteArray();
+    }
+
+    private DERSequence encodeReplySequence( ApplicationReply message )
+    {
+        DERSequence sequence = new DERSequence();
+
+        sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( message.getProtocolVersionNumber() ) ) );
+        sequence.add( new DERTaggedObject( 1, DERInteger.valueOf( message.getMessageType().getOrdinal() ) ) );
+        sequence.add( new DERTaggedObject( 2, EncryptedDataEncoder.encodeSequence( message.getEncPart() ) ) );
+
+        return sequence;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/AuthorizationDataEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/AuthorizationDataEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/AuthorizationDataEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/AuthorizationDataEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.util.Iterator;
@@ -26,30 +25,28 @@
 import org.apache.kerberos.messages.value.AuthorizationData;
 import org.apache.kerberos.messages.value.AuthorizationDataEntry;
 
-
 public class AuthorizationDataEncoder
 {
-	/**
-	 * AuthorizationData ::=   SEQUENCE OF SEQUENCE {
+    /**
+     * AuthorizationData ::=   SEQUENCE OF SEQUENCE {
      *     ad-type[0]               INTEGER,
      *     ad-data[1]               OCTET STRING
      * }
      */
-	protected static DERSequence encode( AuthorizationData data )
-	{
-		Iterator it = data.iterator();
-		DERSequence outerSequence = new DERSequence();
-		
-		while ( it.hasNext() )
-		{
-			AuthorizationDataEntry entry = (AuthorizationDataEntry)it.next();
-			DERSequence sequence = new DERSequence();
-			sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( entry.getAuthorizationDataType().getOrdinal() ) ) );
-			sequence.add( new DERTaggedObject( 1, new DEROctetString( entry.getAuthorizationData() ) ) );
-			outerSequence.add( sequence );
-		}
-		
-		return outerSequence;
-	}
-}
+    protected static DERSequence encode( AuthorizationData data )
+    {
+        Iterator it = data.iterator();
+        DERSequence outerSequence = new DERSequence();
+
+        while ( it.hasNext() )
+        {
+            AuthorizationDataEntry entry = (AuthorizationDataEntry) it.next();
+            DERSequence sequence = new DERSequence();
+            sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( entry.getAuthorizationDataType().getOrdinal() ) ) );
+            sequence.add( new DERTaggedObject( 1, new DEROctetString( entry.getAuthorizationData() ) ) );
+            outerSequence.add( sequence );
+        }
 
+        return outerSequence;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ChecksumEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ChecksumEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ChecksumEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ChecksumEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import org.apache.asn1.der.DERInteger;
@@ -23,7 +22,6 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.value.Checksum;
 
-
 public class ChecksumEncoder
 {
 	/**
@@ -42,4 +40,3 @@
 		return vector;
 	}
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -27,7 +26,6 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.components.EncApRepPart;
 
-
 public class EncApRepPartEncoder
 {
 	public static final int APPLICATION_CODE = 27;
@@ -64,4 +62,3 @@
 		return sequence;
 	}
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,20 +14,17 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
-
 public class EncAsRepPartEncoder extends EncKdcRepPartEncoder
 {
-	/*
-	 * EncASRepPart ::=    [APPLICATION 25[25]] EncKDCRepPart
-	 */
-	public static final int APPLICATION_CODE = 25;
-	
-	public EncAsRepPartEncoder()
-	{
-		super( APPLICATION_CODE );
-	}
-}
+    /*
+     * EncASRepPart ::=    [APPLICATION 25[25]] EncKDCRepPart
+     */
+    public static final int APPLICATION_CODE = 25;
 
+    public EncAsRepPartEncoder()
+    {
+        super( APPLICATION_CODE );
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -29,7 +28,6 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.KdcReply;
 
-
 public abstract class EncKdcRepPartEncoder
 {
 	private int applicationCode;
@@ -110,4 +108,3 @@
 		return sequence;
 	}
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -28,7 +27,6 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.components.EncKrbPrivPart;
 
-
 public class EncKrbPrivPartEncoder
 {
 	private static final int APPLICATION_CODE = 28;
@@ -76,4 +74,3 @@
 		return sequence;
 	}
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncTgsRepPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncTgsRepPartEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncTgsRepPartEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncTgsRepPartEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,20 +14,17 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
-
 public class EncTgsRepPartEncoder extends EncKdcRepPartEncoder
 {
-	/**
-	 * EncTGSRepPart ::=   [APPLICATION 26] EncKDCRepPart
-	 */
-	public static final int APPLICATION_CODE = 26;
-	
-	public EncTgsRepPartEncoder()
-	{
-		super( APPLICATION_CODE );
-	}
-}
+    /**
+     * EncTGSRepPart ::=   [APPLICATION 26] EncKDCRepPart
+     */
+    public static final int APPLICATION_CODE = 26;
 
+    public EncTgsRepPartEncoder()
+    {
+        super( APPLICATION_CODE );
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -28,7 +27,6 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.components.EncTicketPart;
 
-
 public class EncTicketPartEncoder
 {
 	private static final int APPLICATION_CODE = 3;
@@ -101,4 +99,3 @@
 		return sequence;
 	}
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptedDataEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptedDataEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptedDataEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptedDataEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -27,7 +26,6 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.value.EncryptedData;
 
-
 public class EncryptedDataEncoder
 {
 	public static byte[] encode( EncryptedData encryptedData ) throws IOException
@@ -64,4 +62,3 @@
 		return sequence;
 	}
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptedTimestampEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptedTimestampEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptedTimestampEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptedTimestampEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -26,7 +25,6 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.value.EncryptedTimeStamp;
 
-
 public class EncryptedTimestampEncoder
 {
 	public byte[] encode( EncryptedTimeStamp encryptedTimestamp ) throws IOException
@@ -60,4 +58,3 @@
 		return sequence;
 	}
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionKeyEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionKeyEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionKeyEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionKeyEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import org.apache.asn1.der.DERInteger;
@@ -23,17 +22,15 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.value.EncryptionKey;
 
-
 public class EncryptionKeyEncoder
 {
-	protected static DERSequence encode( EncryptionKey key )
-	{
-		DERSequence vector = new DERSequence();
-		
-		vector.add( new DERTaggedObject( 0, DERInteger.valueOf( key.getKeyType().getOrdinal() ) ) );
-		vector.add( new DERTaggedObject( 1, new DEROctetString( key.getKeyValue() ) ) );
-		
-		return vector;
-	}
-}
+    protected static DERSequence encode( EncryptionKey key )
+    {
+        DERSequence vector = new DERSequence();
 
+        vector.add( new DERTaggedObject( 0, DERInteger.valueOf( key.getKeyType().getOrdinal() ) ) );
+        vector.add( new DERTaggedObject( 1, new DEROctetString( key.getKeyValue() ) ) );
+
+        return vector;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionTypeEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionTypeEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionTypeEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionTypeEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,30 +14,27 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import org.apache.asn1.der.DERInteger;
 import org.apache.asn1.der.DERSequence;
 import org.apache.kerberos.crypto.encryption.EncryptionType;
 
-
 public class EncryptionTypeEncoder
 {
-	/**
+    /**
      * etype[8]             SEQUENCE OF INTEGER, -- EncryptionEngine,
      *             -- in preference order
      */
-	protected static DERSequence encode( EncryptionType[] eType )
-	{
-		DERSequence sequence = new DERSequence();
-		
-		for ( int ii = 0; ii < eType.length; ii++ )
-		{
-			sequence.add( DERInteger.valueOf( eType[ii].getOrdinal() ) );
-		}
-		
-		return sequence;
-	}
-}
+    protected static DERSequence encode( EncryptionType[] eType )
+    {
+        DERSequence sequence = new DERSequence();
 
+        for ( int ii = 0; ii < eType.length; ii++ )
+        {
+            sequence.add( DERInteger.valueOf( eType[ ii ].getOrdinal() ) );
+        }
+
+        return sequence;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionTypeInfoEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionTypeInfoEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionTypeInfoEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/EncryptionTypeInfoEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -27,53 +26,50 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.value.EncryptionTypeInfoEntry;
 
-
 public class EncryptionTypeInfoEncoder
 {
-	public static byte[] encode( EncryptionTypeInfoEntry[] entries )
-			throws IOException
-	{
-	    ByteArrayOutputStream baos = new ByteArrayOutputStream();
-	    ASN1OutputStream aos = new ASN1OutputStream( baos );
-	    aos.writeObject( encodeSequence( entries ) );
-	    aos.close();
-	    
-	    return baos.toByteArray();
-	}
-	
-	/**
-	 * ETYPE-INFO              ::= SEQUENCE OF ETYPE-INFO-ENTRY
-	 */
-	protected static DERSequence encodeSequence( EncryptionTypeInfoEntry[] entries )
-	{
-	    DERSequence sequence = new DERSequence();
-	    
-	    for ( int ii = 0; ii < entries.length; ii++ )
-	    {
-	        sequence.add( encode( entries[ ii ] ) );
-	    }
-	    
-	    return sequence;
-	}
-    
-	/**
-	 * ETYPE-INFO-ENTRY        ::= SEQUENCE {
+    public static byte[] encode( EncryptionTypeInfoEntry[] entries ) throws IOException
+    {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ASN1OutputStream aos = new ASN1OutputStream( baos );
+        aos.writeObject( encodeSequence( entries ) );
+        aos.close();
+
+        return baos.toByteArray();
+    }
+
+    /**
+     * ETYPE-INFO              ::= SEQUENCE OF ETYPE-INFO-ENTRY
+     */
+    protected static DERSequence encodeSequence( EncryptionTypeInfoEntry[] entries )
+    {
+        DERSequence sequence = new DERSequence();
+
+        for ( int ii = 0; ii < entries.length; ii++ )
+        {
+            sequence.add( encode( entries[ ii ] ) );
+        }
+
+        return sequence;
+    }
+
+    /**
+     * ETYPE-INFO-ENTRY        ::= SEQUENCE {
      *     etype               [0] Int32,
      *     salt                [1] OCTET STRING OPTIONAL
      * }
-	 */
-	protected static DERSequence encode( EncryptionTypeInfoEntry entry )
-	{
-		DERSequence sequence = new DERSequence();
-		
-		sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( entry.getEncryptionType().getOrdinal() ) ) );
-		
-		if ( entry.getSalt() != null )
-		{
-		    sequence.add( new DERTaggedObject( 1, new DEROctetString( entry.getSalt() ) ) );
-		}
-		
-		return sequence;
-	}
-}
+     */
+    protected static DERSequence encode( EncryptionTypeInfoEntry entry )
+    {
+        DERSequence sequence = new DERSequence();
+
+        sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( entry.getEncryptionType().getOrdinal() ) ) );
+
+        if ( entry.getSalt() != null )
+        {
+            sequence.add( new DERTaggedObject( 1, new DEROctetString( entry.getSalt() ) ) );
+        }
 
+        return sequence;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -30,7 +29,6 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.ErrorMessage;
 
-
 public class ErrorMessageEncoder
 {
 	public void encode( ErrorMessage message, ByteBuffer out ) throws IOException
@@ -107,4 +105,3 @@
 		return sequence;
 	}
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/HostAddressesEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/HostAddressesEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/HostAddressesEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/HostAddressesEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import org.apache.asn1.der.DERInteger;
@@ -24,42 +23,40 @@
 import org.apache.kerberos.messages.value.HostAddress;
 import org.apache.kerberos.messages.value.HostAddresses;
 
-
 public class HostAddressesEncoder
 {
-	/**
-	 * HostAddresses ::=   SEQUENCE OF SEQUENCE {
-	 *                     addr-type[0]             INTEGER,
-	 *                     address[1]               OCTET STRING
-	 * }
-	 */
-	protected static DERSequence encodeSequence( HostAddresses hosts )
-	{
-		HostAddress[] addresses = hosts.getAddresses();
-		DERSequence sequence = new DERSequence();
-		
-		for ( int ii = 0; ii < addresses.length; ii++ )
-		{
-			sequence.add( encode( addresses[ ii ] ) );
-		}
-		
-		return sequence;
-	}
-	
-	/**
-	 *  HostAddress ::=     SEQUENCE  {
+    /**
+     * HostAddresses ::=   SEQUENCE OF SEQUENCE {
      *                     addr-type[0]             INTEGER,
      *                     address[1]               OCTET STRING
      * }
      */
-	protected static DERSequence encode( HostAddress host )
-	{
-		DERSequence sequence = new DERSequence();
-		
-		sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( host.getAddressType().getOrdinal() ) ) );
-		sequence.add( new DERTaggedObject( 1, new DEROctetString( host.getAddress() ) ) );
-		
-		return sequence;
-	}
-}
+    protected static DERSequence encodeSequence( HostAddresses hosts )
+    {
+        HostAddress[] addresses = hosts.getAddresses();
+        DERSequence sequence = new DERSequence();
+
+        for ( int ii = 0; ii < addresses.length; ii++ )
+        {
+            sequence.add( encode( addresses[ ii ] ) );
+        }
+
+        return sequence;
+    }
+
+    /**
+     *  HostAddress ::=     SEQUENCE  {
+     *                     addr-type[0]             INTEGER,
+     *                     address[1]               OCTET STRING
+     * }
+     */
+    protected static DERSequence encode( HostAddress host )
+    {
+        DERSequence sequence = new DERSequence();
+
+        sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( host.getAddressType().getOrdinal() ) ) );
+        sequence.add( new DERTaggedObject( 1, new DEROctetString( host.getAddress() ) ) );
 
+        return sequence;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.IOException;
@@ -30,7 +29,6 @@
 import org.apache.kerberos.messages.KdcReply;
 import org.apache.kerberos.messages.value.PreAuthenticationData;
 
-
 public class KdcReplyEncoder
 {
 	/*
@@ -103,4 +101,3 @@
 		return preAuth;
 	}
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -28,7 +27,6 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.KdcRequest;
 
-
 public class KdcReqBodyEncoder
 {
 	public byte[] encode( KdcRequest request ) throws IOException
@@ -122,4 +120,3 @@
 		return sequence;
 	}
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KerberosTimeEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KerberosTimeEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KerberosTimeEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/KerberosTimeEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,22 +14,19 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import org.apache.asn1.der.DERGeneralizedTime;
 import org.apache.kerberos.messages.value.KerberosTime;
 
-
 public class KerberosTimeEncoder
 {
-	/**
-	 * KerberosTime ::=   GeneralizedTime
-	 *             -- Specifying UTC time zone (Z)
-	 */
+    /**
+     * KerberosTime ::=   GeneralizedTime
+     *             -- Specifying UTC time zone (Z)
+     */
     protected static DERGeneralizedTime encode( KerberosTime time )
     {
-    	return DERGeneralizedTime.valueOf( time.toDate() );
+        return DERGeneralizedTime.valueOf( time.toDate() );
     }
 }
-

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/LastRequestEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/LastRequestEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/LastRequestEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/LastRequestEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import org.apache.asn1.der.DERGeneralizedTime;
@@ -24,29 +23,27 @@
 import org.apache.kerberos.messages.value.LastRequest;
 import org.apache.kerberos.messages.value.LastRequestEntry;
 
-
 public class LastRequestEncoder
 {
-	/**
-	 * LastReq ::=   SEQUENCE OF SEQUENCE {
-	 * lr-type[0]               INTEGER,
-	 * lr-value[1]              KerberosTime
-	 * }
-	 */
-	protected static DERSequence encode( LastRequest lastReq )
-	{
-		LastRequestEntry[] entries = lastReq.getEntries();
-		DERSequence outerSequence = new DERSequence();
-		
-		for ( int ii = 0; ii < entries.length; ii++ )
-		{
-			DERSequence sequence = new DERSequence();
-			sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( entries[ii].getLastRequestType().getOrdinal() ) ) );
-			sequence.add( new DERTaggedObject( 1, DERGeneralizedTime.valueOf( entries[ii].getLastRequestValue().toDate() ) ) );
-			outerSequence.add( sequence );
-		}
-		
-		return outerSequence;
-	}
-}
+    /**
+     * LastReq ::=   SEQUENCE OF SEQUENCE {
+     * lr-type[0]               INTEGER,
+     * lr-value[1]              KerberosTime
+     * }
+     */
+    protected static DERSequence encode( LastRequest lastReq )
+    {
+        LastRequestEntry[] entries = lastReq.getEntries();
+        DERSequence outerSequence = new DERSequence();
 
+        for ( int ii = 0; ii < entries.length; ii++ )
+        {
+            DERSequence sequence = new DERSequence();
+            sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( entries[ ii ].getLastRequestType().getOrdinal() ) ) );
+            sequence.add( new DERTaggedObject( 1, DERGeneralizedTime.valueOf( entries[ ii ].getLastRequestValue().toDate() ) ) );
+            outerSequence.add( sequence );
+        }
+
+        return outerSequence;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PreAuthenticationDataEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PreAuthenticationDataEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PreAuthenticationDataEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PreAuthenticationDataEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -27,51 +26,48 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.value.PreAuthenticationData;
 
-
 public class PreAuthenticationDataEncoder
 {
-	public static byte[] encode( PreAuthenticationData[] preAuth )
-			throws IOException
-	{
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		ASN1OutputStream aos = new ASN1OutputStream( baos );
-		
-		aos.writeObject( encodeSequence( preAuth ) );
-		aos.close();
-
-		return baos.toByteArray();
-	}
-	
-	protected static DERSequence encodeSequence( PreAuthenticationData[] preAuth )
-	{
-		DERSequence sequence = new DERSequence();
-		
-		for ( int ii = 0; ii < preAuth.length; ii++ )
-		{
-			sequence.add( encode( preAuth[ ii ] ) );
-		}
-		
-		return sequence;
-	}
-	
-	/**
-	 * PA-DATA ::=        SEQUENCE {
-	 *         padata-type[1]        INTEGER,
-	 *         padata-value[2]       OCTET STRING
-	 * }
-	 */
-	protected static DERSequence encode( PreAuthenticationData preAuth )
-	{
-		DERSequence sequence = new DERSequence();
-		
-		sequence.add( new DERTaggedObject( 1, DERInteger.valueOf( preAuth.getDataType().getOrdinal() ) ) );
-		
-		if ( preAuth.getDataValue() != null )
-		{
-		    sequence.add( new DERTaggedObject( 2, new DEROctetString( preAuth.getDataValue() ) ) );
-		}
-		
-		return sequence;
-	}
-}
+    public static byte[] encode( PreAuthenticationData[] preAuth ) throws IOException
+    {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ASN1OutputStream aos = new ASN1OutputStream( baos );
+
+        aos.writeObject( encodeSequence( preAuth ) );
+        aos.close();
+
+        return baos.toByteArray();
+    }
+
+    protected static DERSequence encodeSequence( PreAuthenticationData[] preAuth )
+    {
+        DERSequence sequence = new DERSequence();
+
+        for ( int ii = 0; ii < preAuth.length; ii++ )
+        {
+            sequence.add( encode( preAuth[ ii ] ) );
+        }
+
+        return sequence;
+    }
+
+    /**
+     * PA-DATA ::=        SEQUENCE {
+     *         padata-type[1]        INTEGER,
+     *         padata-value[2]       OCTET STRING
+     * }
+     */
+    protected static DERSequence encode( PreAuthenticationData preAuth )
+    {
+        DERSequence sequence = new DERSequence();
+
+        sequence.add( new DERTaggedObject( 1, DERInteger.valueOf( preAuth.getDataType().getOrdinal() ) ) );
+
+        if ( preAuth.getDataValue() != null )
+        {
+            sequence.add( new DERTaggedObject( 2, new DEROctetString( preAuth.getDataValue() ) ) );
+        }
 
+        return sequence;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PrincipalNameEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PrincipalNameEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PrincipalNameEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PrincipalNameEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.util.Arrays;
@@ -28,47 +27,45 @@
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
 
-
 public class PrincipalNameEncoder
 {
-	private static final String COMPONENT_SEPARATOR = "/";
-	private static final String REALM_SEPARATOR     = "@";
-	
-	/**
-	 * PrincipalName ::=   SEQUENCE {
-	 *               name-type[0]     INTEGER,
-	 *               name-string[1]   SEQUENCE OF GeneralString
-	 * }
-	 */
-	protected static DERSequence encode( KerberosPrincipal principal )
-	{
-		DERSequence vector = new DERSequence();
-		
-		vector.add( new DERTaggedObject( 0, DERInteger.valueOf( principal.getNameType() ) ) );
-		vector.add( new DERTaggedObject( 1, encodeNameSequence( principal ) ) );
-		
-		return vector;
-	}
-	
-	private static DERSequence encodeNameSequence( KerberosPrincipal principal )
-	{
-		Iterator it = getNameStrings( principal ).iterator();
-		
-		DERSequence vector = new DERSequence();
-		
-		while ( it.hasNext() )
-		{
-			vector.add( DERGeneralString.valueOf( (String)it.next() ) );
-		}
-		
-		return vector;
-	}
-	
-	private static List getNameStrings( KerberosPrincipal principal )
-	{
-		String nameComponent = principal.getName().split( REALM_SEPARATOR )[0];
-		String[] components = nameComponent.split( COMPONENT_SEPARATOR );
-		return Arrays.asList( components );
-	}
-}
+    private static final String COMPONENT_SEPARATOR = "/";
+    private static final String REALM_SEPARATOR = "@";
 
+    /**
+     * PrincipalName ::=   SEQUENCE {
+     *               name-type[0]     INTEGER,
+     *               name-string[1]   SEQUENCE OF GeneralString
+     * }
+     */
+    protected static DERSequence encode( KerberosPrincipal principal )
+    {
+        DERSequence vector = new DERSequence();
+
+        vector.add( new DERTaggedObject( 0, DERInteger.valueOf( principal.getNameType() ) ) );
+        vector.add( new DERTaggedObject( 1, encodeNameSequence( principal ) ) );
+
+        return vector;
+    }
+
+    private static DERSequence encodeNameSequence( KerberosPrincipal principal )
+    {
+        Iterator it = getNameStrings( principal ).iterator();
+
+        DERSequence vector = new DERSequence();
+
+        while ( it.hasNext() )
+        {
+            vector.add( DERGeneralString.valueOf( (String) it.next() ) );
+        }
+
+        return vector;
+    }
+
+    private static List getNameStrings( KerberosPrincipal principal )
+    {
+        String nameComponent = principal.getName().split( REALM_SEPARATOR )[ 0 ];
+        String[] components = nameComponent.split( COMPONENT_SEPARATOR );
+        return Arrays.asList( components );
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import java.io.ByteArrayOutputStream;
@@ -27,30 +26,28 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.application.PrivateMessage;
 
-
 public class PrivateMessageEncoder
 {
-	public byte[] encode( PrivateMessage message ) throws IOException
-	{
-		ByteArrayOutputStream baos = new ByteArrayOutputStream();
-		ASN1OutputStream aos = new ASN1OutputStream( baos );
-		
-		DERSequence privateMessageSequence = encodePrivateMessageSequence( message );
-		aos.writeObject( DERApplicationSpecific.valueOf( message.getMessageType().getOrdinal(), privateMessageSequence ) );
-		aos.close();
-		
-		return baos.toByteArray();
-	}
-	
-	private DERSequence encodePrivateMessageSequence( PrivateMessage message )
-	{
-		DERSequence sequence = new DERSequence();
-		
-		sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( message.getProtocolVersionNumber() ) ) );
-		sequence.add( new DERTaggedObject( 1, DERInteger.valueOf( message.getMessageType().getOrdinal() ) ) );
-		sequence.add( new DERTaggedObject( 3, EncryptedDataEncoder.encodeSequence( message.getEncryptedPart() ) ) );
-		
-		return sequence;
-	}
-}
+    public byte[] encode( PrivateMessage message ) throws IOException
+    {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ASN1OutputStream aos = new ASN1OutputStream( baos );
+
+        DERSequence privateMessageSequence = encodePrivateMessageSequence( message );
+        aos.writeObject( DERApplicationSpecific.valueOf( message.getMessageType().getOrdinal(), privateMessageSequence ) );
+        aos.close();
+
+        return baos.toByteArray();
+    }
+
+    private DERSequence encodePrivateMessageSequence( PrivateMessage message )
+    {
+        DERSequence sequence = new DERSequence();
+
+        sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( message.getProtocolVersionNumber() ) ) );
+        sequence.add( new DERTaggedObject( 1, DERInteger.valueOf( message.getMessageType().getOrdinal() ) ) );
+        sequence.add( new DERTaggedObject( 3, EncryptedDataEncoder.encodeSequence( message.getEncryptedPart() ) ) );
 
+        return sequence;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/TicketEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/TicketEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/TicketEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/TicketEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import org.apache.asn1.der.DERApplicationSpecific;
@@ -24,11 +23,10 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.components.Ticket;
 
-
 public class TicketEncoder
 {
-	/**
-	 * Ticket ::=                    [APPLICATION 1] SEQUENCE {
+    /**
+     * Ticket ::=                    [APPLICATION 1] SEQUENCE {
      *     tkt-vno[0]                   INTEGER,
      *     realm[1]                     Realm,
      *     sname[2]                     PrincipalName,
@@ -37,39 +35,38 @@
      */
     protected static DERApplicationSpecific encode( Ticket ticket )
     {
-		DERSequence vector = new DERSequence();
-		
-		vector.add( new DERTaggedObject( 0, DERInteger.valueOf( ticket.getVersionNumber() ) ) );
-		vector.add( new DERTaggedObject( 1, DERGeneralString.valueOf( ticket.getRealm() ) ) );
-		vector.add( new DERTaggedObject( 2, PrincipalNameEncoder.encode( ticket.getServerPrincipal() ) ) );
-		vector.add( new DERTaggedObject( 3, EncryptedDataEncoder.encodeSequence( ticket.getEncPart() ) ) );
-		
-		DERApplicationSpecific ticketSequence = null;
-		
-		try
-		{
-			ticketSequence = DERApplicationSpecific.valueOf( 1, vector );
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-		
-		return ticketSequence;
+        DERSequence vector = new DERSequence();
+
+        vector.add( new DERTaggedObject( 0, DERInteger.valueOf( ticket.getVersionNumber() ) ) );
+        vector.add( new DERTaggedObject( 1, DERGeneralString.valueOf( ticket.getRealm() ) ) );
+        vector.add( new DERTaggedObject( 2, PrincipalNameEncoder.encode( ticket.getServerPrincipal() ) ) );
+        vector.add( new DERTaggedObject( 3, EncryptedDataEncoder.encodeSequence( ticket.getEncPart() ) ) );
+
+        DERApplicationSpecific ticketSequence = null;
+
+        try
+        {
+            ticketSequence = DERApplicationSpecific.valueOf( 1, vector );
+        }
+        catch ( Exception e )
+        {
+            e.printStackTrace();
+        }
+
+        return ticketSequence;
     }
-    
-	protected static DERSequence encodeSequence( Ticket[] tickets )
-	{
-		DERSequence outerVector = new DERSequence();
-
-		for ( int ii = 0; ii < tickets.length; ii++ )
-		{
-			DERSequence vector = new DERSequence();
-			vector.add( encode( tickets[ii] ) );
-			outerVector.add( vector );
-		}
-		
-		return outerVector;
-	}
-}
 
+    protected static DERSequence encodeSequence( Ticket[] tickets )
+    {
+        DERSequence outerVector = new DERSequence();
+
+        for ( int ii = 0; ii < tickets.length; ii++ )
+        {
+            DERSequence vector = new DERSequence();
+            vector.add( encode( tickets[ ii ] ) );
+            outerVector.add( vector );
+        }
+
+        return outerVector;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/TransitedEncodingEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/TransitedEncodingEncoder.java?rev=234002&r1=234001&r2=234002&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/TransitedEncodingEncoder.java (original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/io/encoder/TransitedEncodingEncoder.java Fri Aug 19 23:41:26 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.io.encoder;
 
 import org.apache.asn1.der.DERInteger;
@@ -23,24 +22,22 @@
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.value.TransitedEncoding;
 
-
 public class TransitedEncodingEncoder
 {
-	/**
-	 * TransitedEncoding ::=         SEQUENCE {
+    /**
+     * TransitedEncoding ::=         SEQUENCE {
      *     tr-type[0]  INTEGER, -- must be registered
      *     contents[1]          OCTET STRING
      * }
      */
-	protected static DERSequence encode( TransitedEncoding te )
-	{
-		
-		DERSequence sequence = new DERSequence();
-		
-		sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( te.getType().getOrdinal() ) ) );
-		sequence.add( new DERTaggedObject( 1, new DEROctetString( te.getContents() ) ) );
-		
-		return sequence;
-	}
-}
+    protected static DERSequence encode( TransitedEncoding te )
+    {
 
+        DERSequence sequence = new DERSequence();
+
+        sequence.add( new DERTaggedObject( 0, DERInteger.valueOf( te.getType().getOrdinal() ) ) );
+        sequence.add( new DERTaggedObject( 1, new DEROctetString( te.getContents() ) ) );
+
+        return sequence;
+    }
+}



Mime
View raw message