oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1524921 - /oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java
Date Fri, 20 Sep 2013 07:24:55 GMT
Author: simonetripodi
Date: Fri Sep 20 07:24:55 2013
New Revision: 1524921

URL: http://svn.apache.org/r1524921
Log:
OLTU-118 - Implement JWS of the JOSE working group

verification method has to make sure that JWS has a payload and a signature in order to execute
the verify method

Modified:
    oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java

Modified: oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java?rev=1524921&r1=1524920&r2=1524921&view=diff
==============================================================================
--- oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java (original)
+++ oltu/trunk/jose/jws/src/main/java/org/apache/oltu/jose/jws/JWS.java Fri Sep 20 07:24:55
2013
@@ -70,6 +70,12 @@ public class JWS {
         if (header == null || header.getAlgorithm() == null) {
             throw new IllegalStateException("JWS token must have a valid JSON header with
specified algorithm.");
         }
+        if (payload == null) {
+            throw new IllegalStateException("JWS token must have a payload.");
+        }
+        if (signature == null) {
+            throw new IllegalStateException("JWS token must have a signature to be verified.");
+        }
 
         if (!header.getAlgorithm().equalsIgnoreCase(method.getAlgorithm())) {
             throw new IllegalArgumentException("Impossible to verify current JWS signature
with algorithm '"



Mime
View raw message