oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1731646 - in /oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption: ContentEncryptMethod.java EncryptMethod.java KeyEncryptMethod.java
Date Mon, 22 Feb 2016 14:02:32 GMT
Author: asanso
Date: Mon Feb 22 14:02:31 2016
New Revision: 1731646

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

Added:
    oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/ContentEncryptMethod.java
    oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/EncryptMethod.java
    oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/KeyEncryptMethod.java

Added: oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/ContentEncryptMethod.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/ContentEncryptMethod.java?rev=1731646&view=auto
==============================================================================
--- oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/ContentEncryptMethod.java
(added)
+++ oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/ContentEncryptMethod.java
Mon Feb 22 14:02:31 2016
@@ -0,0 +1,31 @@
+/*
+ * 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.encryption;
+
+
+/**
+ * Common definition of OAuth content encryption method algorithm.
+ *
+ * @param <E> the {@link EncryptingKey} type.
+ * @param <D> the {@link DecryptingKey} type.
+ */
+public interface ContentEncryptMethod <E extends EncryptingKey, D extends DecryptingKey>
 extends EncryptMethod<EncryptingKey, DecryptingKey>{
+    
+    String encrypt(String header, String payload, E enryptingKey);
+    
+    //TODO add validation??
+}

Added: oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/EncryptMethod.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/EncryptMethod.java?rev=1731646&view=auto
==============================================================================
--- oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/EncryptMethod.java
(added)
+++ oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/EncryptMethod.java
Mon Feb 22 14:02:31 2016
@@ -0,0 +1,29 @@
+/*
+ * 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.encryption;
+
+/**
+ * Common definition of OAuth encryption method algorithm.
+ *
+ * @param <E> the {@link EncryptingKey} type.
+ * @param <D> the {@link DecryptingKey} type.
+ */
+public interface EncryptMethod<E extends EncryptingKey, D extends DecryptingKey> {
+
+    String getAlgorithm();
+
+}
\ No newline at end of file

Added: oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/KeyEncryptMethod.java
URL: http://svn.apache.org/viewvc/oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/KeyEncryptMethod.java?rev=1731646&view=auto
==============================================================================
--- oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/KeyEncryptMethod.java
(added)
+++ oltu/trunk/jose/jwe/src/main/java/org/apache/oltu/jose/jwe/encryption/KeyEncryptMethod.java
Mon Feb 22 14:02:31 2016
@@ -0,0 +1,32 @@
+/*
+ * 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.encryption;
+
+/**
+ * Common definition of OAuth key encryption method algorithm.
+ *
+ * @param <E> the {@link EncryptingKey} type.
+ * @param <D> the {@link DecryptingKey} type.
+ */
+public interface KeyEncryptMethod  <E extends EncryptingKey, D extends DecryptingKey>
 extends EncryptMethod<EncryptingKey, DecryptingKey> {
+    
+    //TODO change to wrap?
+    String encrypt(byte [] cek, E enryptingKey);
+    
+    //TODO add validation??
+
+}



Mime
View raw message