abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1176246 - /abdera/abdera2/common/src/main/java/org/apache/abdera2/common/security/KeyHelper.java
Date Tue, 27 Sep 2011 07:35:55 GMT
Author: jmsnell
Date: Tue Sep 27 07:35:54 2011
New Revision: 1176246

URL: http://svn.apache.org/viewvc?rev=1176246&view=rev
Log: (empty)

Modified:
    abdera/abdera2/common/src/main/java/org/apache/abdera2/common/security/KeyHelper.java

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/security/KeyHelper.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/security/KeyHelper.java?rev=1176246&r1=1176245&r2=1176246&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/security/KeyHelper.java
(original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/security/KeyHelper.java
Tue Sep 27 07:35:54 2011
@@ -41,6 +41,7 @@ import java.security.spec.X509EncodedKey
 
 import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
 
 import org.apache.commons.codec.binary.Hex;
 
@@ -156,5 +157,13 @@ public class KeyHelper {
         return false;
       }
     }
+    
+    public static SecretKeySpec decodeSecretKeySpec(String hex) {
+      try {
+        return new SecretKeySpec(Hex.decodeHex(hex.toCharArray()),"RAW");
+      } catch (Throwable t) {
+        throw new RuntimeException(t);
+      }
+    }
 }
 



Mime
View raw message