oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1729944 - in /oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws: JwsConstants.java signature/impl/SignatureMethodsHMAC256Impl.java
Date Fri, 12 Feb 2016 07:19:59 GMT
Author: asanso
Date: Fri Feb 12 07:19:59 2016
New Revision: 1729944

URL: http://svn.apache.org/viewvc?rev=1729944&view=rev
Log:
OLTU-186 - Adding constant for HS256

Modified:
    oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JwsConstants.java
    oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/signature/impl/SignatureMethodsHMAC256Impl.java

Modified: oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JwsConstants.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JwsConstants.java?rev=1729944&r1=1729943&r2=1729944&view=diff
==============================================================================
--- oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JwsConstants.java (original)
+++ oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JwsConstants.java Fri Feb 12
07:19:59 2016
@@ -23,4 +23,6 @@ public class JwsConstants {
     public static final String RS384 = "RS384";
 
     public static final String RS512 = "RS512";
+    
+    public static final String HS256 = "HS256";
 }

Modified: oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/signature/impl/SignatureMethodsHMAC256Impl.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/signature/impl/SignatureMethodsHMAC256Impl.java?rev=1729944&r1=1729943&r2=1729944&view=diff
==============================================================================
--- oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/signature/impl/SignatureMethodsHMAC256Impl.java
(original)
+++ oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/signature/impl/SignatureMethodsHMAC256Impl.java
Fri Feb 12 07:19:59 2016
@@ -18,15 +18,16 @@ package org.apache.oltu.jose.jws.signatu
 
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
+
 import javax.crypto.Mac;
 import javax.crypto.spec.SecretKeySpec;
+
 import org.apache.oltu.commons.encodedtoken.TokenDecoder;
+import org.apache.oltu.jose.jws.JwsConstants;
 import org.apache.oltu.jose.jws.signature.SignatureMethod;
 
 public class SignatureMethodsHMAC256Impl implements SignatureMethod<SymmetricKeyImpl,
SymmetricKeyImpl> {
 
-    private static final String ALG = "HS256";
-
     @Override
     public String calculate(String header, String payload, SymmetricKeyImpl signingKey) {
         StringBuilder sb = new StringBuilder();
@@ -57,7 +58,7 @@ public class SignatureMethodsHMAC256Impl
 
     @Override
     public String getAlgorithm() {
-        return ALG;
+        return JwsConstants.HS256;
     }
 
 }



Mime
View raw message