You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2016/06/28 22:17:09 UTC

commons-crypto git commit: OpensslJnaCipher should not be public

Repository: commons-crypto
Updated Branches:
  refs/heads/master 59389d1f2 -> 42f541f39


OpensslJnaCipher should not be public

Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/42f541f3
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/42f541f3
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/42f541f3

Branch: refs/heads/master
Commit: 42f541f39d997c87df250a1029626a1c0bc431a4
Parents: 59389d1
Author: Sebb <se...@apache.org>
Authored: Tue Jun 28 23:17:05 2016 +0100
Committer: Sebb <se...@apache.org>
Committed: Tue Jun 28 23:17:05 2016 +0100

----------------------------------------------------------------------
 .../apache/commons/crypto/jna/OpensslJna.java   | 35 ++++++++++++++++++++
 .../commons/crypto/jna/OpensslJnaCipher.java    |  2 +-
 .../crypto/cipher/AbstractCipherTest.java       |  4 +--
 3 files changed, 38 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/42f541f3/src/main/java/org/apache/commons/crypto/jna/OpensslJna.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/jna/OpensslJna.java b/src/main/java/org/apache/commons/crypto/jna/OpensslJna.java
new file mode 100644
index 0000000..e27f96c
--- /dev/null
+++ b/src/main/java/org/apache/commons/crypto/jna/OpensslJna.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package org.apache.commons.crypto.jna;
+
+import org.apache.commons.crypto.cipher.CryptoCipher;
+import org.apache.commons.crypto.random.CryptoRandom;
+
+/**
+ * Public class to give access to the package protected class objects
+ */
+public final class OpensslJna {
+
+    public static Class<? extends CryptoCipher> getCipherClass() {
+        return OpensslJnaCipher.class;
+    }
+
+    public static Class<? extends CryptoRandom> getRandomClass() {
+        return OpensslJnaCryptoRandom.class;
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/42f541f3/src/main/java/org/apache/commons/crypto/jna/OpensslJnaCipher.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/jna/OpensslJnaCipher.java b/src/main/java/org/apache/commons/crypto/jna/OpensslJnaCipher.java
index 3bb56b5..05ee367 100644
--- a/src/main/java/org/apache/commons/crypto/jna/OpensslJnaCipher.java
+++ b/src/main/java/org/apache/commons/crypto/jna/OpensslJnaCipher.java
@@ -43,7 +43,7 @@ import com.sun.jna.ptr.PointerByReference;
 /**
  * Implements the CryptoCipher using JNA into OpenSSL.
  */
-public class OpensslJnaCipher implements CryptoCipher {
+class OpensslJnaCipher implements CryptoCipher {
 
     private final static int AES_BLOCK_SIZE = 16;
     

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/42f541f3/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java b/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
index 1cc720a..affca80 100644
--- a/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
+++ b/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
@@ -31,7 +31,7 @@ import javax.crypto.spec.SecretKeySpec;
 import javax.xml.bind.DatatypeConverter;
 
 import org.apache.commons.crypto.conf.ConfigurationKeys;
-import org.apache.commons.crypto.jna.OpensslJnaCipher;
+import org.apache.commons.crypto.jna.OpensslJna;
 import org.apache.commons.crypto.utils.ReflectionUtils;
 import org.apache.commons.crypto.utils.Utils;
 import org.junit.Assert;
@@ -44,7 +44,7 @@ public abstract class AbstractCipherTest {
 
     public static final String JCE_CIPHER_CLASSNAME = JceCipher.class.getName();
 
-    public static final String OPENSSLJNA_CIPHER_CLASSNAME = OpensslJnaCipher.class.getName();
+    public static final String OPENSSLJNA_CIPHER_CLASSNAME = OpensslJna.getCipherClass().getName();
 
     // data
     public static final int BYTEBUFFER_SIZE = 1000;