oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1731031 - in /oltu/trunk/jose/jwe: ./ src/main/java/org/apache/oltu/jose/jwe/ src/main/java/org/apache/oltu/jose/jwe/io/
Date Thu, 18 Feb 2016 09:47:45 GMT
Author: asanso
Date: Thu Feb 18 09:47:45 2016
New Revision: 1731031

URL: http://svn.apache.org/viewvc?rev=1731031&view=rev
Log:
OLTU-80 - Implement JWE support for JWT

Added:
    oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/Header.java
    oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/JWEConstants.java
    oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/
    oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEConstant.java
    oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/package-info.java
Modified:
    oltu/trunk/jose/jwe/pom.xml

Modified: oltu/trunk/jose/jwe/pom.xml
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jwe/pom.xml?rev=1731031&r1=1731030&r2=1731031&view=diff
==============================================================================
--- oltu/trunk/jose/jwe/pom.xml (original)
+++ oltu/trunk/jose/jwe/pom.xml Thu Feb 18 09:47:45 2016
@@ -39,7 +39,7 @@
     <dependency>
       <groupId>org.apache.oltu.commons</groupId>
       <artifactId>org.apache.oltu.commons.encodedtoken</artifactId>
-      <version>1.0.1-SNAPSHOT</version>
+      <version>1.0.0</version>
     </dependency>
 
     <dependency>

Added: oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/Header.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/Header.java?rev=1731031&view=auto
==============================================================================
--- oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/Header.java (added)
+++ oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/Header.java Thu Feb 18 09:47:45
2016
@@ -0,0 +1,165 @@
+/*
+ * 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.oltu.jose.jwe;
+
+import java.util.Map;
+
+import org.apache.oltu.commons.json.CustomizableEntity;
+
+/**
+ * Represents the Header as defined in the section 4 of the JWE specification.
+ *
+ * @see https://tools.ietf.org/html/rfc7516#section-4
+ */
+public final class Header extends CustomizableEntity {
+	
+    /**
+     * The {@code alg} JWE Header parameter.
+     */
+    private final String algorithm;
+    
+    /**
+     * The {@code enc} JWE Header parameter.
+     */
+    private final String encryptionAlgorithm;
+    
+    /**
+     * The {@code zip} JWE Header key.
+     */
+    private final String compressionAlgorithm;
+    
+    /**
+     * The {@code jku} JWE Header parameter.
+     */
+    private final String jwkSetUrl;
+
+    /**
+     * The {@code jwk} JWE Header parameter.
+     */
+    private final String jsonWebKey;
+    
+    /**
+     * The {@code x5u} JWE Header parameter.
+     */
+    private final String x509url;
+
+    /**
+     * The {@code x5t} JWE Header parameter.
+     */
+    private final String x509CertificateThumbprint;
+
+    /**
+     * The {@code x5c} JWE Header parameter.
+     */
+    private final String x509CertificateChain;
+    
+    /**
+     * The {@code kid} JWE Header parameter.
+     */
+    private final String keyId;
+
+    /**
+     * The {@code typ} JWE Header parameter.
+     */
+    private final String type;
+
+    /**
+     * The {@code cty} JWE Header parameter.
+     */
+    private final String contentType;
+
+    /**
+     * The {@code crit} JWE Header parameter.
+     */
+    private final String[] critical;
+    
+    Header(String algorithm,
+            String encryptionAlgorithm,
+            String compressionAlgorithm,
+            String jwkSetUrl,
+            String jsonWebKey,
+            String x509url,
+            String x509CertificateThumbprint,
+            String x509CertificateChain,
+            String keyId,
+            String type,
+            String contentType,
+            String[] critical,
+            Map<String, Object> customFields) {
+        super(customFields);
+        this.algorithm = algorithm;
+        this.encryptionAlgorithm = encryptionAlgorithm;
+        this.compressionAlgorithm = compressionAlgorithm;
+        this.jwkSetUrl = jwkSetUrl;
+        this.jsonWebKey = jsonWebKey;
+        this.x509url = x509url;
+        this.x509CertificateThumbprint = x509CertificateThumbprint;
+        this.x509CertificateChain = x509CertificateChain;
+        this.keyId = keyId;
+        this.type = type;
+        this.contentType = contentType;
+        this.critical = critical;
+    }
+
+    public String getAlgorithm() {
+        return algorithm;
+    }
+
+    public String getEncryptionAlgorithm() {
+        return encryptionAlgorithm;
+    }
+
+    public String getCompressionAlgorithm() {
+        return compressionAlgorithm;
+    }
+
+    public String getJwkSetUrl() {
+        return jwkSetUrl;
+    }
+
+    public String getJsonWebKey() {
+        return jsonWebKey;
+    }
+
+    public String getX509url() {
+        return x509url;
+    }
+
+    public String getX509CertificateThumbprint() {
+        return x509CertificateThumbprint;
+    }
+
+    public String getX509CertificateChain() {
+        return x509CertificateChain;
+    }
+
+    public String getKeyId() {
+        return keyId;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public String getContentType() {
+        return contentType;
+    }
+
+    public String[] getCritical() {
+        return critical;
+    }
+}

Added: oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/JWEConstants.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/JWEConstants.java?rev=1731031&view=auto
==============================================================================
--- oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/JWEConstants.java (added)
+++ oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/JWEConstants.java Thu Feb 18
09:47:45 2016
@@ -0,0 +1,25 @@
+/*
+ * 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.oltu.jose.jwe;
+
+public class JWEConstants {
+
+    public static final String A128KW = "A128KW";
+    
+    public static final String A128CBC_HS256 = "A128CBC-HS256";
+    
+}

Added: oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEConstant.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEConstant.java?rev=1731031&view=auto
==============================================================================
--- oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEConstant.java (added)
+++ oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEConstant.java Thu Feb
18 09:47:45 2016
@@ -0,0 +1,84 @@
+/*
+ * 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.oltu.jose.jwe.io;
+
+public class JWEConstant {
+
+    // header defined in the JWE specification
+	// https://tools.ietf.org/html/rfc7516
+	
+    /**
+     * The {@code alg} JWE Header key.
+     */
+    public static final String ALGORITHM = "alg";
+    
+    /**
+     * The {@code enc} JWE Header key.
+     */
+    public static final String ENCRYPTION_ALGORITHM = "enc";
+    
+    /**
+     * The {@code zip} JWE Header key.
+     */
+    public static final String COMPRESSION = "zip";
+    
+    /**
+     * The {@code jku} JWE Header key.
+     */
+    public static final String JWK_SET_URL = "jku";
+
+    /**
+     * The {@code jwk} JWE Header key.
+     */
+    public static final String JSON_WEB_KEY = "jwk";
+    
+    /**
+     * The {@code kid} JWE Header key.
+     */
+    public static final String KEY_ID = "kid";
+    
+    /**
+     * The {@code x5u} JWE Header key.
+     */
+    public static final String X509_URL = "x5u";
+
+    /**
+     * The {@code x5t} JWE Header key.
+     */
+    public static final String X509_CERTIFICATE_THUMBPRINT = "x5t";
+
+    /**
+     * The {@code x5c} JWE Header key.
+     */
+    public static final String X509_CERTIFICATE_CHAIN = "x5c";
+    
+    /**
+     * The {@code typ} JWE Header key.
+     */
+    public static final String TYPE = "typ";
+
+    /**
+     * The {@code cty} JWE Header key.
+     */
+    public static final String CONTENT_TYPE = "cty";
+
+    /**
+     * The {@code crit} JWE Header key.
+     */
+    public static final String CRITICAL = "crit";
+
+}

Added: oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/package-info.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/package-info.java?rev=1731031&view=auto
==============================================================================
--- oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/package-info.java (added)
+++ oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/package-info.java Thu Feb
18 09:47:45 2016
@@ -0,0 +1,21 @@
+/*
+ * 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.oltu.jose.jwe.io;



Mime
View raw message