2003/06/16 08:03:13
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:01:13 +0000 (07:01 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:01:13 +0000 (07:01 +0000)
darcs-hash:20040130070113-2ba56-fb35c628c7cffe3a6238910fd1b61162113cb5b1.gz

src/org/bouncycastle/asn1/ASN1OctetString.java
src/org/bouncycastle/asn1/ASN1TaggedObject.java
src/org/bouncycastle/asn1/BERConstructedOctetString.java
src/org/bouncycastle/asn1/BERInputStream.java
src/org/bouncycastle/asn1/BERTaggedObject.java
src/org/bouncycastle/asn1/DERBoolean.java
src/org/bouncycastle/asn1/DERInputStream.java
src/org/bouncycastle/asn1/DERTaggedObject.java
src/org/bouncycastle/asn1/DERUnknownTag.java

index 7daf025..39e488a 100644 (file)
@@ -23,7 +23,7 @@ public abstract class ASN1OctetString
     {
         return getInstance(obj.getObject());
     }
-       
+        
     /**
      * return an Octet String from the given object.
      *
index deadcdb..d209c81 100644 (file)
@@ -42,10 +42,10 @@ public abstract class ASN1TaggedObject
         this.tagNo = tagNo;
         this.obj = obj;
     }
-       
-       public boolean equals(
-               Object o)
-       {
+        
+        public boolean equals(
+                Object o)
+        {
         if (o == null || !(o instanceof ASN1TaggedObject))
         {
             return false;
@@ -55,27 +55,27 @@ public abstract class ASN1TaggedObject
         
         if(tagNo != other.tagNo || empty != other.empty || explicit != other.explicit)
         {
-                       return false;
-               }
-               
-               if(obj == null)
-               {
-                       if(other.obj != null)
-                       {
-                               return false;
-                       }
-               }
-               else
-               {
-                       if(!(obj.equals(other.obj)))
-                       {
-                               return false;
-                       }
-               }
-               
-               return true;
-       }
-       
+                        return false;
+                }
+                
+                if(obj == null)
+                {
+                        if(other.obj != null)
+                        {
+                                return false;
+                        }
+                }
+                else
+                {
+                        if(!(obj.equals(other.obj)))
+                        {
+                                return false;
+                        }
+                }
+                
+                return true;
+        }
+        
     public int getTagNo()
     {
         return tagNo;
index 20b7175..c49642b 100644 (file)
@@ -39,13 +39,13 @@ public class BERConstructedOctetString
     public BERConstructedOctetString(
         byte[]  string)
     {
-               super(string);
+                super(string);
     }
 
     public BERConstructedOctetString(
         Vector  octs)
     {
-               super(toBytes(octs));
+                super(toBytes(octs));
 
         this.octs = octs;
     }
@@ -53,7 +53,7 @@ public class BERConstructedOctetString
     public BERConstructedOctetString(
         DERObject  obj)
     {
-               super(obj);
+                super(obj);
     }
 
     public BERConstructedOctetString(
index fd960ec..af714c9 100644 (file)
@@ -7,15 +7,15 @@ import java.util.*;
 public class BERInputStream
     extends DERInputStream
 {
-       private DERObject END_OF_STREAM = new DERObject() {
-                                                                               void encode(
-                                                                                       DEROutputStream out)
-                                                                               throws IOException
-                                                                               {
-                                                                                       throw new IOException("Eeek!");
-                                                                               }
-
-                                                                       };
+        private DERObject END_OF_STREAM = new DERObject() {
+                                                                                void encode(
+                                                                                        DEROutputStream out)
+                                                                                throws IOException
+                                                                                {
+                                                                                        throw new IOException("Eeek!");
+                                                                                }
+
+                                                                        };
     public BERInputStream(
         InputStream is)
     {
@@ -35,10 +35,10 @@ public class BERInputStream
 
         while ((b = read()) >= 0)
         {
-                       if (b1 == 0 && b == 0)
-                       {
-                               break;
-                       }
+                        if (b1 == 0 && b == 0)
+                        {
+                                break;
+                        }
 
             bOut.write(b1);
             b1 = b;
@@ -47,25 +47,25 @@ public class BERInputStream
         return bOut.toByteArray();
     }
 
-       private BERConstructedOctetString buildConstructedOctetString()
-               throws IOException
-       {
+        private BERConstructedOctetString buildConstructedOctetString()
+                throws IOException
+        {
         Vector                  octs = new Vector();
 
-               for (;;)
-               {
-                       DERObject               o = readObject();
+                for (;;)
+                {
+                        DERObject               o = readObject();
 
-                       if (o == END_OF_STREAM)
-                       {
-                               break;
-                       }
+                        if (o == END_OF_STREAM)
+                        {
+                                break;
+                        }
 
             octs.addElement(o);
-               }
+                }
 
-               return new BERConstructedOctetString(octs);
-       }
+                return new BERConstructedOctetString(octs);
+        }
 
     public DERObject readObject()
         throws IOException
@@ -87,35 +87,35 @@ public class BERInputStream
             case SEQUENCE | CONSTRUCTED:
                 BERConstructedSequence  seq = new BERConstructedSequence();
     
-                               for (;;)
-                               {
-                                       DERObject   obj = readObject();
-
-                                       if (obj == END_OF_STREAM)
-                                       {
-                                               break;
-                                       }
-
-                                       seq.addObject(obj);
-                               }
-                               return seq;
+                                for (;;)
+                                {
+                                        DERObject   obj = readObject();
+
+                                        if (obj == END_OF_STREAM)
+                                        {
+                                                break;
+                                        }
+
+                                        seq.addObject(obj);
+                                }
+                                return seq;
             case OCTET_STRING | CONSTRUCTED:
-                               return buildConstructedOctetString();
+                                return buildConstructedOctetString();
             case SET | CONSTRUCTED:
                 DEREncodableVector  v = new DEREncodableVector();
     
-                               for (;;)
-                               {
-                                       DERObject   obj = readObject();
-
-                                       if (obj == END_OF_STREAM)
-                                       {
-                                               break;
-                                       }
-
-                                       v.add(obj);
-                               }
-                               return new BERSet(v);
+                                for (;;)
+                                {
+                                        DERObject   obj = readObject();
+
+                                        if (obj == END_OF_STREAM)
+                                        {
+                                                break;
+                                        }
+
+                                        v.add(obj);
+                                }
+                                return new BERSet(v);
             default:
                 //
                 // with tagged object tag number is bottom 5 bits
@@ -140,9 +140,9 @@ public class BERInputStream
                     //
                     // either constructed or explicitly tagged
                     //
-                                       DERObject               dObj = readObject();
+                                        DERObject               dObj = readObject();
 
-                                       if (dObj == END_OF_STREAM)     // empty tag!
+                                        if (dObj == END_OF_STREAM)     // empty tag!
                     {
                         return new DERTaggedObject(tag & 0x1f);
                     }
@@ -189,7 +189,7 @@ public class BERInputStream
     
             readFully(bytes);
     
-                       return buildObject(tag, bytes);
+                        return buildObject(tag, bytes);
         }
     }
 }
index 10f83e2..f01d199 100644 (file)
@@ -19,7 +19,7 @@ public class BERTaggedObject
         int             tagNo,
         DEREncodable    obj)
     {
-               super(tagNo, obj);
+                super(tagNo, obj);
     }
 
     /**
@@ -32,7 +32,7 @@ public class BERTaggedObject
         int             tagNo,
         DEREncodable    obj)
     {
-               super(explicit, tagNo, obj);
+                super(explicit, tagNo, obj);
     }
 
     /**
index 8837dfd..0cb2eb4 100644 (file)
@@ -7,8 +7,8 @@ public class DERBoolean
 {
     byte         value;
 
-       public static final DERBoolean FALSE = new DERBoolean(false);
-       public static final DERBoolean TRUE  = new DERBoolean(true);
+        public static final DERBoolean FALSE = new DERBoolean(false);
+        public static final DERBoolean TRUE  = new DERBoolean(true);
 
     /**
      * return a boolean from the passed in object.
index 9cf0ef1..296221b 100644 (file)
@@ -70,16 +70,16 @@ public class DERInputStream
         }
     }
 
-       /**
-        * build an object given its tag and a byte stream to construct it
-        * from.
-        */
+        /**
+         * build an object given its tag and a byte stream to construct it
+         * from.
+         */
     protected DERObject buildObject(
-               int         tag,
-               byte[]  bytes)
-               throws IOException
-       {
-               switch (tag)
+                int         tag,
+                byte[]  bytes)
+                throws IOException
+        {
+                switch (tag)
         {
         case NULL:
             return null;   
@@ -219,7 +219,7 @@ public class DERInputStream
 
             return new DERUnknownTag(tag, bytes);
         }
-       }
+        }
 
     public DERObject readObject()
         throws IOException
@@ -235,6 +235,6 @@ public class DERInputStream
 
         readFully(bytes);
 
-               return buildObject(tag, bytes);
-       }
+                return buildObject(tag, bytes);
+        }
 }
index ba69412..ef06042 100644 (file)
@@ -18,7 +18,7 @@ public class DERTaggedObject
         int             tagNo,
         DEREncodable    obj)
     {
-               super(tagNo, obj);
+                super(tagNo, obj);
     }
 
     /**
@@ -31,7 +31,7 @@ public class DERTaggedObject
         int             tagNo,
         DEREncodable    obj)
     {
-               super(explicit, tagNo, obj);
+                super(explicit, tagNo, obj);
     }
 
     /**
index 010f911..6e5b97b 100644 (file)
@@ -40,9 +40,9 @@ public class DERUnknownTag
         out.writeEncoded(tag, data);
     }
     
-       public boolean equals(
-               Object o)
-       {
+        public boolean equals(
+                Object o)
+        {
         if ((o == null) || !(o instanceof DERUnknownTag))
         {
             return false;
@@ -52,22 +52,22 @@ public class DERUnknownTag
         
         if(tag != other.tag)
         {
-                       return false;
-               }
-               
-               if(data.length != other.data.length)
-               {
-                       return false;
-               }
-               
-               for(int i = 0; i < data.length; i++) 
-               {
-                       if(data[i] != other.data[i])
-                       {
-                               return false;
-                       }
-               }
-               
-               return true;
-       }
+                        return false;
+                }
+                
+                if(data.length != other.data.length)
+                {
+                        return false;
+                }
+                
+                for(int i = 0; i < data.length; i++) 
+                {
+                        if(data[i] != other.data[i])
+                        {
+                                return false;
+                        }
+                }
+                
+                return true;
+        }
 }