changeset 96:fea4b10e38f2

2007-07-18 Lillian Angel <langel@redhat.com> * jce/gnu/javax/crypto/jce/PBESecretKeyFactory.java: Reformatted (GNU style). * jce/gnu/javax/crypto/jce/cipher/PBE.java: Likewise. * jce/gnu/javax/crypto/key/GnuPBEKey.java: Likewise.
author Lillian Angel <langel@redhat.com>
date Wed, 18 Jul 2007 14:47:20 -0400
parents e9bcd67287e8
children 7fd23bf2b4b0
files ChangeLog jce/gnu/javax/crypto/jce/PBESecretKeyFactory.java jce/gnu/javax/crypto/jce/cipher/PBE.java jce/gnu/javax/crypto/key/GnuPBEKey.java
diffstat 4 files changed, 99 insertions(+), 90 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jul 18 13:58:33 2007 -0400
+++ b/ChangeLog	Wed Jul 18 14:47:20 2007 -0400
@@ -1,3 +1,10 @@
+2007-07-18  Lillian Angel  <langel@redhat.com>
+
+	* jce/gnu/javax/crypto/jce/PBESecretKeyFactory.java: Reformatted (GNU
+	style).
+	* jce/gnu/javax/crypto/jce/cipher/PBE.java: Likewise.
+	* jce/gnu/javax/crypto/key/GnuPBEKey.java: Likewise.
+
 2007-07-18  Lillian Angel  <langel@redhat.com>
 
 	* jce/gnu/javax/crypto/jce/GnuCrypto.java: Added PBEWithMD5AndDES and
--- a/jce/gnu/javax/crypto/jce/PBESecretKeyFactory.java	Wed Jul 18 13:58:33 2007 -0400
+++ b/jce/gnu/javax/crypto/jce/PBESecretKeyFactory.java	Wed Jul 18 14:47:20 2007 -0400
@@ -1,39 +1,39 @@
 /* PBESecretKeyFactory.java -- 
-   Copyright (C) 2007  Free Software Foundation, Inc.
+ Copyright (C) 2007  Free Software Foundation, Inc.
 
-This file is a part of GNU Classpath.
+ This file is a part of GNU Classpath.
 
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or (at
+ your option) any later version.
 
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA
 
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library.  Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
 
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.  */
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module.  An independent module is a module which is not derived from
+ or based on this library.  If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so.  If you do not wish to do so, delete this
+ exception statement from your version.  */
 
 
 package gnu.javax.crypto.jce;
@@ -47,7 +47,6 @@
 import javax.crypto.SecretKeyFactorySpi;
 import javax.crypto.spec.PBEKeySpec;
 
-
 public class PBESecretKeyFactory
     extends SecretKeyFactorySpi
 {
@@ -57,7 +56,7 @@
   {
     super();
   }
-  
+
   protected PBESecretKeyFactory(String name)
   {
     this.name = name;
--- a/jce/gnu/javax/crypto/jce/cipher/PBE.java	Wed Jul 18 13:58:33 2007 -0400
+++ b/jce/gnu/javax/crypto/jce/cipher/PBE.java	Wed Jul 18 14:47:20 2007 -0400
@@ -1,39 +1,39 @@
 /* PBE.java -- 
-   Copyright (C) 2007  Free Software Foundation, Inc.
+ Copyright (C) 2007  Free Software Foundation, Inc.
 
-This file is a part of GNU Classpath.
+ This file is a part of GNU Classpath.
 
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or (at
+ your option) any later version.
 
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
-USA
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA
 
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library.  Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
 
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.  */
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module.  An independent module is a module which is not derived from
+ or based on this library.  If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so.  If you do not wish to do so, delete this
+ exception statement from your version.  */
 
 
 package gnu.javax.crypto.jce.cipher;
@@ -59,23 +59,24 @@
     extends CipherAdapter
 {
   Cipher cipher;
+
   MessageDigest hash;
-  
+
   protected PBE(String cipher, String hash)
   {
-	super(cipher);
-	try
-	{
-		this.cipher = Cipher.getInstance(cipher);
-		this.hash = MessageDigest.getInstance(hash);
-	}
-	catch (NoSuchAlgorithmException e)
-	{
-	}
-	catch (NoSuchPaddingException e)
-	{
-	}
-  } 
+    super(cipher);
+    try
+      {
+        this.cipher = Cipher.getInstance(cipher);
+        this.hash = MessageDigest.getInstance(hash);
+      }
+    catch (NoSuchAlgorithmException e)
+      {
+      }
+    catch (NoSuchPaddingException e)
+      {
+      }
+  }
 
   protected void engineInit(int opmode, Key key, SecureRandom random)
       throws InvalidKeyException
@@ -90,8 +91,8 @@
       InvalidAlgorithmParameterException
   {
     if (! (key instanceof GnuPBEKey))
-        throw new InvalidKeyException("not a GNU PBE key");
-      super.engineInit(opmode, (GnuPBEKey) key, params, random);
+      throw new InvalidKeyException("not a GNU PBE key");
+    super.engineInit(opmode, (GnuPBEKey) key, params, random);
   }
 
   protected void engineInit(int opmode, Key key, AlgorithmParameters params,
@@ -99,23 +100,25 @@
       InvalidAlgorithmParameterException
   {
     if (! (key instanceof GnuPBEKey))
-        throw new InvalidKeyException("not a GNU PBE key");
-      super.engineInit(opmode, (GnuPBEKey) key, params, random);
+      throw new InvalidKeyException("not a GNU PBE key");
+    super.engineInit(opmode, (GnuPBEKey) key, params, random);
   }
-  
-  public static class MD5 extends PBE
+
+  public static class MD5
+      extends PBE
   {
-	public MD5(String cipher) 
-    { 
-      super(cipher, "MD5"); 
+    public MD5(String cipher)
+    {
+      super(cipher, "MD5");
     }
 
-	public static class DES extends MD5
+    public static class DES
+        extends MD5
     {
-      public DES() 
-      { 
-    	super("DES"); 
+      public DES()
+      {
+        super("DES");
       }
     }
-  } 
+  }
 }
--- a/jce/gnu/javax/crypto/key/GnuPBEKey.java	Wed Jul 18 13:58:33 2007 -0400
+++ b/jce/gnu/javax/crypto/key/GnuPBEKey.java	Wed Jul 18 14:47:20 2007 -0400
@@ -90,7 +90,7 @@
 
   public byte[] getEncoded ()
   {
-	String pass = new String(getPassword());
-	return pass.getBytes();
+    String pass = new String(getPassword());
+    return pass.getBytes();
   }
 }