oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1732145 - /oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEWriter.java
Date Wed, 24 Feb 2016 13:14:11 GMT
Author: asanso
Date: Wed Feb 24 13:14:11 2016
New Revision: 1732145

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

Added:
    oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEWriter.java

Added: oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEWriter.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEWriter.java?rev=1732145&view=auto
==============================================================================
--- oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEWriter.java (added)
+++ oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/io/JWEWriter.java Wed Feb 24
13:14:11 2016
@@ -0,0 +1,41 @@
+/*
+ * 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;
+
+import org.apache.oltu.commons.encodedtoken.TokenWriter;
+import org.apache.oltu.jose.jwe.JWE;
+
+public final class JWEWriter extends TokenWriter<JWE> {
+
+    @Override
+    protected String writeHeader(JWE token) {
+        return new JWEHeaderWriter().write(token.getHeader());
+    }
+
+    @Override
+    protected String writeBody(JWE token) {
+        return "";
+    }
+
+    @Override
+    protected String writeSignature(JWE token) {
+        StringBuilder sb = new StringBuilder();
+        sb.append(token.getEncryptedKey()).append(token.getContentEncryption());
+        return sb.toString();
+    }
+
+}



Mime
View raw message