|
From: <jbo...@li...> - 2006-07-10 21:52:06
|
Author: estebanschifman
Date: 2006-07-10 17:52:00 -0400 (Mon, 10 Jul 2006)
New Revision: 4996
Added:
labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java
labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/services/Iencryption.java
Log:
Add Iencryption interface and a factory for default dummy implementation
Added: labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java
===================================================================
--- labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java 2006-07-10 21:19:23 UTC (rev 4995)
+++ labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java 2006-07-10 21:52:00 UTC (rev 4996)
@@ -0,0 +1,36 @@
+package org.jboss.soa.esb.services;
+
+public class DefaultEncryptionFactory
+{
+ public static Iencryption getRepository(Object p_o)
+ {
+ return new DummyEncrypter();
+
+ } //________________________________
+
+ /**
+ * This is a dummy class to provide dummy
+ * encrypt/decrypt methods for a byte[]
+ *
+ */
+ private static class DummyEncrypter implements Iencryption
+ {
+// private static Cipher s_oCC;
+// static
+// { try { s_oCC = Cipher.getInstance("DES"); }
+// catch (Exception e) { e.printStackTrace(); }
+// }
+ public byte [] encrypt (byte [] p_ba, long p_lSeed)
+ throws Exception
+ {
+ return p_ba;
+ } //__________________________________
+
+ public byte [] decrypt (byte [] p_ba, long p_lSeed)
+ throws Exception
+ {
+ return p_ba;
+ } //__________________________________
+ } //___________________________________________________
+
+} //____________________________________________________________________________
\ No newline at end of file
Added: labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/services/Iencryption.java
===================================================================
--- labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/services/Iencryption.java 2006-07-10 21:19:23 UTC (rev 4995)
+++ labs/jbossesb/trunk/ESBCore/common/src/org/jboss/soa/esb/services/Iencryption.java 2006-07-10 21:52:00 UTC (rev 4996)
@@ -0,0 +1,28 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.services;
+
+public interface Iencryption
+{
+ public byte [] encrypt (byte [] p_ba, long p_lSeed) throws Exception;
+ public byte [] decrypt (byte [] p_ba, long p_lSeed) throws Exception;
+}
|