cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1583022 - in /cayenne/main/trunk/cayenne-crypto/src: main/java/org/apache/cayenne/crypto/transformer/value/ test/java/org/apache/cayenne/crypto/transformer/value/
Date Sat, 29 Mar 2014 16:32:05 GMT
Author: aadamchik
Date: Sat Mar 29 16:32:04 2014
New Revision: 1583022

URL: http://svn.apache.org/r1583022
Log:
CAY-1916 cayenne-crypto module that enables data encryption for certain model attributes

refactoring: reducing the number of converters

Added:
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64StringConverter.java
      - copied, changed from r1583021, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64ToBytesConverter.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/BytesConverter.java
      - copied, changed from r1583021, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/FromBytesConverter.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8StringConverter.java
      - copied, changed from r1583021, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8ToBytesConverter.java
Removed:
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64FromBytesConverter.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64ToBytesConverter.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/FromBytesConverter.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/ToBytesConverter.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8FromBytesConverter.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8ToBytesConverter.java
Modified:
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/BytesToBytesConverter.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactory.java
    cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceValueTransformer.java
    cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactoryTest.java
    cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/transformer/value/JceValueTransformerTest.java

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64StringConverter.java
(from r1583021, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64ToBytesConverter.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64StringConverter.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64StringConverter.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64ToBytesConverter.java&r1=1583021&r2=1583022&rev=1583022&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64ToBytesConverter.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Base64StringConverter.java
Sat Mar 29 16:32:04 2014
@@ -23,13 +23,18 @@ import javax.xml.bind.DatatypeConverter;
 /**
  * @since 3.2
  */
-class Base64ToBytesConverter implements ToBytesConverter {
+class Base64StringConverter implements BytesConverter {
 
-    static final ToBytesConverter INSTANCE = new Base64ToBytesConverter();
+    static final BytesConverter INSTANCE = new Base64StringConverter();
 
     @Override
     public byte[] toBytes(Object value) {
         return DatatypeConverter.parseBase64Binary((String) value);
     }
 
+    @Override
+    public Object fromBytes(byte[] bytes) {
+        return DatatypeConverter.printBase64Binary(bytes);
+    }
+
 }

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/BytesConverter.java
(from r1583021, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/FromBytesConverter.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/BytesConverter.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/BytesConverter.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/FromBytesConverter.java&r1=1583021&r2=1583022&rev=1583022&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/FromBytesConverter.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/BytesConverter.java
Sat Mar 29 16:32:04 2014
@@ -21,8 +21,9 @@ package org.apache.cayenne.crypto.transf
 /**
  * @since 3.2
  */
-interface FromBytesConverter {
+interface BytesConverter {
 
     Object fromBytes(byte[] bytes);
 
+    byte[] toBytes(Object value);
 }

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/BytesToBytesConverter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/BytesToBytesConverter.java?rev=1583022&r1=1583021&r2=1583022&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/BytesToBytesConverter.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/BytesToBytesConverter.java
Sat Mar 29 16:32:04 2014
@@ -21,7 +21,7 @@ package org.apache.cayenne.crypto.transf
 /**
  * @since 3.2
  */
-final class BytesToBytesConverter implements ToBytesConverter, FromBytesConverter {
+class BytesToBytesConverter implements BytesConverter {
 
     static final BytesToBytesConverter INSTANCE = new BytesToBytesConverter();
 

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactory.java?rev=1583022&r1=1583021&r2=1583022&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactory.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactory.java
Sat Mar 29 16:32:04 2014
@@ -41,11 +41,11 @@ import org.apache.cayenne.map.ObjEntity;
  */
 public class JceTransformerFactory implements ValueTransformerFactory {
 
-    private Map<String, ToBytesConverter> objectToBytes;
-    private Map<Integer, ToBytesConverter> dbToBytes;
+    private Map<String, BytesConverter> objectToBytes;
+    private Map<Integer, BytesConverter> dbToBytes;
 
-    private Map<String, FromBytesConverter> bytesToObject;
-    private Map<Integer, FromBytesConverter> bytesToDb;
+    private Map<String, BytesConverter> bytesToObject;
+    private Map<Integer, BytesConverter> bytesToDb;
 
     private ConcurrentMap<DbAttribute, ValueTransformer> encryptors;
     private ConcurrentMap<DbAttribute, ValueTransformer> decryptors;
@@ -58,7 +58,6 @@ public class JceTransformerFactory imple
         this.dbToBytes = createDbToBytesConverters();
         this.bytesToObject = createBytesToObjectConverters();
         this.bytesToDb = createBytesToDbConverters();
-
     }
 
     @Override
@@ -91,53 +90,53 @@ public class JceTransformerFactory imple
         return e;
     }
 
-    protected Map<Integer, ToBytesConverter> createDbToBytesConverters() {
-        Map<Integer, ToBytesConverter> map = new HashMap<Integer, ToBytesConverter>();
+    protected Map<Integer, BytesConverter> createDbToBytesConverters() {
+        Map<Integer, BytesConverter> map = new HashMap<Integer, BytesConverter>();
 
         map.put(Types.BINARY, BytesToBytesConverter.INSTANCE);
         map.put(Types.BLOB, BytesToBytesConverter.INSTANCE);
         map.put(Types.VARBINARY, BytesToBytesConverter.INSTANCE);
         map.put(Types.LONGVARBINARY, BytesToBytesConverter.INSTANCE);
 
-        map.put(Types.CHAR, Base64ToBytesConverter.INSTANCE);
-        map.put(Types.CLOB, Base64ToBytesConverter.INSTANCE);
-        map.put(Types.LONGNVARCHAR, Base64ToBytesConverter.INSTANCE);
-        map.put(Types.VARCHAR, Base64ToBytesConverter.INSTANCE);
+        map.put(Types.CHAR, Base64StringConverter.INSTANCE);
+        map.put(Types.CLOB, Base64StringConverter.INSTANCE);
+        map.put(Types.LONGNVARCHAR, Base64StringConverter.INSTANCE);
+        map.put(Types.VARCHAR, Base64StringConverter.INSTANCE);
 
         return map;
     }
 
-    protected Map<String, ToBytesConverter> createObjectToBytesConverters() {
-        Map<String, ToBytesConverter> map = new HashMap<String, ToBytesConverter>();
+    protected Map<Integer, BytesConverter> createBytesToDbConverters() {
+        Map<Integer, BytesConverter> map = new HashMap<Integer, BytesConverter>();
 
-        map.put("byte[]", BytesToBytesConverter.INSTANCE);
-        map.put(String.class.getName(), Utf8ToBytesConverter.INSTANCE);
+        map.put(Types.BINARY, BytesToBytesConverter.INSTANCE);
+        map.put(Types.BLOB, BytesToBytesConverter.INSTANCE);
+        map.put(Types.VARBINARY, BytesToBytesConverter.INSTANCE);
+        map.put(Types.LONGVARBINARY, BytesToBytesConverter.INSTANCE);
+
+        map.put(Types.CHAR, Base64StringConverter.INSTANCE);
+        map.put(Types.CLOB, Base64StringConverter.INSTANCE);
+        map.put(Types.LONGNVARCHAR, Base64StringConverter.INSTANCE);
+        map.put(Types.VARCHAR, Base64StringConverter.INSTANCE);
 
         return map;
     }
 
-    protected Map<String, FromBytesConverter> createBytesToObjectConverters() {
-
-        Map<String, FromBytesConverter> map = new HashMap<String, FromBytesConverter>();
+    protected Map<String, BytesConverter> createObjectToBytesConverters() {
+        Map<String, BytesConverter> map = new HashMap<String, BytesConverter>();
 
         map.put("byte[]", BytesToBytesConverter.INSTANCE);
-        map.put(String.class.getName(), Utf8FromBytesConverter.INSTANCE);
+        map.put(String.class.getName(), Utf8StringConverter.INSTANCE);
 
         return map;
     }
 
-    protected Map<Integer, FromBytesConverter> createBytesToDbConverters() {
-        Map<Integer, FromBytesConverter> map = new HashMap<Integer, FromBytesConverter>();
+    protected Map<String, BytesConverter> createBytesToObjectConverters() {
 
-        map.put(Types.BINARY, BytesToBytesConverter.INSTANCE);
-        map.put(Types.BLOB, BytesToBytesConverter.INSTANCE);
-        map.put(Types.VARBINARY, BytesToBytesConverter.INSTANCE);
-        map.put(Types.LONGVARBINARY, BytesToBytesConverter.INSTANCE);
+        Map<String, BytesConverter> map = new HashMap<String, BytesConverter>();
 
-        map.put(Types.CHAR, Base64FromBytesConverter.INSTANCE);
-        map.put(Types.CLOB, Base64FromBytesConverter.INSTANCE);
-        map.put(Types.LONGNVARCHAR, Base64FromBytesConverter.INSTANCE);
-        map.put(Types.VARCHAR, Base64FromBytesConverter.INSTANCE);
+        map.put("byte[]", BytesToBytesConverter.INSTANCE);
+        map.put(String.class.getName(), Utf8StringConverter.INSTANCE);
 
         return map;
     }
@@ -146,13 +145,13 @@ public class JceTransformerFactory imple
 
         String type = getJavaType(a);
 
-        ToBytesConverter toBytes = objectToBytes.get(type);
+        BytesConverter toBytes = objectToBytes.get(type);
         if (toBytes == null) {
             throw new IllegalArgumentException("The type " + type + " for attribute " + a
                     + " has no object-to-bytes conversion");
         }
 
-        FromBytesConverter fromBytes = bytesToDb.get(a.getType());
+        BytesConverter fromBytes = bytesToDb.get(a.getType());
         if (fromBytes == null) {
             throw new IllegalArgumentException("The type " + TypesMapping.getSqlNameByType(a.getType())
                     + " for attribute " + a + " has no bytes-to-db conversion");
@@ -163,14 +162,14 @@ public class JceTransformerFactory imple
 
     protected ValueTransformer createDecryptor(DbAttribute a) {
 
-        ToBytesConverter toBytes = dbToBytes.get(a.getType());
+        BytesConverter toBytes = dbToBytes.get(a.getType());
         if (toBytes == null) {
             throw new IllegalArgumentException("The type " + TypesMapping.getSqlNameByType(a.getType())
                     + " for attribute " + a + " has no db-to-bytes conversion");
         }
 
         String type = getJavaType(a);
-        FromBytesConverter fromBytes = bytesToObject.get(type);
+        BytesConverter fromBytes = bytesToObject.get(type);
         if (fromBytes == null) {
             throw new IllegalArgumentException("The type " + type + " for attribute " + a
                     + " has no bytes-to-object conversion");

Modified: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceValueTransformer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceValueTransformer.java?rev=1583022&r1=1583021&r2=1583022&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceValueTransformer.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/JceValueTransformer.java
Sat Mar 29 16:32:04 2014
@@ -29,19 +29,19 @@ import org.apache.cayenne.crypto.Cayenne
  */
 public class JceValueTransformer implements ValueTransformer {
 
-    private ToBytesConverter preConverter;
-    private FromBytesConverter postConverter;
+    private BytesConverter preConverter;
+    private BytesConverter postConverter;
 
-    public JceValueTransformer(ToBytesConverter preConverter, FromBytesConverter postConverter)
{
+    public JceValueTransformer(BytesConverter preConverter, BytesConverter postConverter)
{
         this.preConverter = preConverter;
         this.postConverter = postConverter;
     }
 
-    ToBytesConverter getPreConverter() {
+    BytesConverter getPreConverter() {
         return preConverter;
     }
 
-    FromBytesConverter getPostConverter() {
+    BytesConverter getPostConverter() {
         return postConverter;
     }
 

Copied: cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8StringConverter.java
(from r1583021, cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8ToBytesConverter.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8StringConverter.java?p2=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8StringConverter.java&p1=cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8ToBytesConverter.java&r1=1583021&r2=1583022&rev=1583022&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8ToBytesConverter.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/value/Utf8StringConverter.java
Sat Mar 29 16:32:04 2014
@@ -23,15 +23,15 @@ import java.nio.charset.Charset;
 /**
  * @since 3.2
  */
-final class Utf8ToBytesConverter implements ToBytesConverter {
+final class Utf8StringConverter implements BytesConverter {
 
     static final String DEFAULT_CHARSET = "UTF-8";
 
-    static final ToBytesConverter INSTANCE = new Utf8ToBytesConverter();
+    static final BytesConverter INSTANCE = new Utf8StringConverter();
 
     private Charset utf8;
 
-    Utf8ToBytesConverter() {
+    Utf8StringConverter() {
         this.utf8 = Charset.forName(DEFAULT_CHARSET);
     }
 
@@ -39,5 +39,10 @@ final class Utf8ToBytesConverter impleme
     public byte[] toBytes(Object value) {
         return ((String) value).getBytes(utf8);
     }
+    
+    @Override
+    public Object fromBytes(byte[] bytes) {
+        return new String(bytes, utf8);
+    }
 
 }

Modified: cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactoryTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactoryTest.java?rev=1583022&r1=1583021&r2=1583022&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactoryTest.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/transformer/value/JceTransformerFactoryTest.java
Sat Mar 29 16:32:04 2014
@@ -85,8 +85,8 @@ public class JceTransformerFactoryTest {
         ValueTransformer t1 = f.createEncryptor(t1_ct);
         assertNotNull(t1);
         assertTrue(t1 instanceof JceValueTransformer);
-        assertSame(Utf8ToBytesConverter.INSTANCE, ((JceValueTransformer) t1).getPreConverter());
-        assertSame(Base64FromBytesConverter.INSTANCE, ((JceValueTransformer) t1).getPostConverter());
+        assertSame(Utf8StringConverter.INSTANCE, ((JceValueTransformer) t1).getPreConverter());
+        assertSame(Base64StringConverter.INSTANCE, ((JceValueTransformer) t1).getPostConverter());
 
         DbAttribute t2_cb = t2.getAttribute("CRYPTO_BYTES");
 
@@ -106,8 +106,8 @@ public class JceTransformerFactoryTest {
         ValueTransformer t1 = f.createDecryptor(t1_ct);
         assertNotNull(t1);
         assertTrue(t1 instanceof JceValueTransformer);
-        assertSame(Base64ToBytesConverter.INSTANCE, ((JceValueTransformer) t1).getPreConverter());
-        assertSame(Utf8FromBytesConverter.INSTANCE, ((JceValueTransformer) t1).getPostConverter());
+        assertSame(Base64StringConverter.INSTANCE, ((JceValueTransformer) t1).getPreConverter());
+        assertSame(Utf8StringConverter.INSTANCE, ((JceValueTransformer) t1).getPostConverter());
 
         DbAttribute t2_cb = t2.getAttribute("CRYPTO_BYTES");
 
@@ -123,7 +123,7 @@ public class JceTransformerFactoryTest {
         assertNotNull(t3);
         assertTrue(t3 instanceof JceValueTransformer);
         assertSame(BytesToBytesConverter.INSTANCE, ((JceValueTransformer) t3).getPreConverter());
-        assertSame(Utf8FromBytesConverter.INSTANCE, ((JceValueTransformer) t3).getPostConverter());
+        assertSame(Utf8StringConverter.INSTANCE, ((JceValueTransformer) t3).getPostConverter());
     }
 
 }

Modified: cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/transformer/value/JceValueTransformerTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/transformer/value/JceValueTransformerTest.java?rev=1583022&r1=1583021&r2=1583022&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/transformer/value/JceValueTransformerTest.java
(original)
+++ cayenne/main/trunk/cayenne-crypto/src/test/java/org/apache/cayenne/crypto/transformer/value/JceValueTransformerTest.java
Sat Mar 29 16:32:04 2014
@@ -121,7 +121,7 @@ public class JceValueTransformerTest {
     public void testTransform_StringToBytes() throws UnsupportedEncodingException, IllegalBlockSizeException,
             BadPaddingException {
 
-        JceValueTransformer e = new JceValueTransformer(Utf8ToBytesConverter.INSTANCE, BytesToBytesConverter.INSTANCE);
+        JceValueTransformer e = new JceValueTransformer(Utf8StringConverter.INSTANCE, BytesToBytesConverter.INSTANCE);
 
         String s1 = "ab";
         String s2 = "cd";
@@ -130,20 +130,20 @@ public class JceValueTransformerTest {
 
         assertNotNull(b1_t);
         assertEquals(encCipher.getBlockSize(), b1_t.length);
-        assertEquals(s1, new String(decCipher.doFinal(b1_t), Utf8ToBytesConverter.DEFAULT_CHARSET));
+        assertEquals(s1, new String(decCipher.doFinal(b1_t), Utf8StringConverter.DEFAULT_CHARSET));
 
         byte[] b2_t = (byte[]) e.transform(encCipher, s2);
 
         assertNotNull(b2_t);
         assertEquals(encCipher.getBlockSize(), b2_t.length);
-        assertEquals(s2, new String(decCipher.doFinal(b2_t), Utf8ToBytesConverter.DEFAULT_CHARSET));
+        assertEquals(s2, new String(decCipher.doFinal(b2_t), Utf8StringConverter.DEFAULT_CHARSET));
     }
 
     @Test
     public void testTransform_StringToString() throws UnsupportedEncodingException, IllegalBlockSizeException,
             BadPaddingException {
 
-        JceValueTransformer e = new JceValueTransformer(Utf8ToBytesConverter.INSTANCE, Base64FromBytesConverter.INSTANCE);
+        JceValueTransformer e = new JceValueTransformer(Utf8StringConverter.INSTANCE, Base64StringConverter.INSTANCE);
 
         String s1 = "ab";
 
@@ -160,7 +160,7 @@ public class JceValueTransformerTest {
         assertNotEquals(s1_t, s1);
 
         byte[] b1_t = DatatypeConverter.parseBase64Binary(s1_t);
-        assertEquals(s1, new String(decCipher.doFinal(b1_t), Utf8ToBytesConverter.DEFAULT_CHARSET));
+        assertEquals(s1, new String(decCipher.doFinal(b1_t), Utf8StringConverter.DEFAULT_CHARSET));
 
         String s2_t = (String) e.transform(encCipher, s2);
 
@@ -168,6 +168,6 @@ public class JceValueTransformerTest {
         assertNotEquals(s2_t, s2);
 
         byte[] b2_t = DatatypeConverter.parseBase64Binary(s2_t);
-        assertEquals(s2, new String(decCipher.doFinal(b2_t), Utf8ToBytesConverter.DEFAULT_CHARSET));
+        assertEquals(s2, new String(decCipher.doFinal(b2_t), Utf8StringConverter.DEFAULT_CHARSET));
     }
 }



Mime
View raw message