another gcj hack
authoradam <adam@megacz.com>
Wed, 14 Apr 2004 21:13:51 +0000 (21:13 +0000)
committeradam <adam@megacz.com>
Wed, 14 Apr 2004 21:13:51 +0000 (21:13 +0000)
darcs-hash:20040414211351-5007d-69d5297d606a56747c4a42f4f0ba3f568be5fca0.gz

src/org/ibex/crypto/X509.java

index c283aaf..3c4abde 100644 (file)
@@ -67,11 +67,11 @@ public class X509 {
         public Certificate(InputStream is) throws IOException {
             int i;
             RecordingInputStream certIS = new RecordingInputStream(is);
-            DER.InputStream certSequence = new DER.InputStream(certIS).getSequenceStream();
+            DER.InputStream certSequence = DER.InputStream.New(certIS).getSequenceStream();
             RecordingInputStream tbsCertIS = new RecordingInputStream(certSequence);
         
             try {
-                Vector tbsSequence = (Vector) new DER.InputStream(tbsCertIS).readObject();
+                Vector tbsSequence = (Vector) DER.InputStream.New(tbsCertIS).readObject();
                 tbsCertBytes = tbsCertIS.getBytes();
                 signatureAlgorithm = new AlgorithmIdentifier(certSequence.readObject());
                 signature = (DER.BitString) certSequence.readObject();
@@ -120,7 +120,7 @@ public class X509 {
                         String oid = (String) extension.elementAt(0);
                         byte[] data = (byte[]) extension.elementAt(extension.size()-1);
                         if(oid.equals(BASIC_CONSTRAINTS))
-                            bc = new BC(new DER.InputStream(new ByteArrayInputStream(data)).readObject());
+                            bc = new BC(DER.InputStream.New(new ByteArrayInputStream(data)).readObject());
                     }
                 }
                 basicContraints = bc;
@@ -143,7 +143,7 @@ public class X509 {
         public RSA.PublicKey getRSAPublicKey() throws DER.Exception {
             if(!RSA_ENCRYPTION.equals(publicKeyAlgorithm.id)) throw new DER.Exception("This isn't an RSA public key");
             try {
-                return new RSA.PublicKey(new DER.InputStream(new ByteArrayInputStream(publicKey.data)).readObject());
+                return new RSA.PublicKey(DER.InputStream.New(new ByteArrayInputStream(publicKey.data)).readObject());
             } catch(IOException e) {
                 throw new DER.Exception(e.getMessage());
             } catch(RuntimeException e) {
@@ -165,7 +165,7 @@ public class X509 {
                 PKCS1 pkcs1 = new PKCS1(new RSA(rsapk.modulus,rsapk.exponent,true));
                 byte[] d = pkcs1.decode(signature.data);
             
-                Vector v = (Vector) new DER.InputStream(new ByteArrayInputStream(d)).readObject();
+                Vector v = (Vector) DER.InputStream.New(new ByteArrayInputStream(d)).readObject();
                 byte[] signedDigest = (byte[]) v.elementAt(1);
                             
                 if(signedDigest.length != digest.getDigestSize()) return false;