You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2015/02/16 17:09:10 UTC
cxf git commit: Removing and renaming some of JWE classes
Repository: cxf
Updated Branches:
refs/heads/master 52b83045b -> 73421ee4a
Removing and renaming some of JWE classes
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/73421ee4
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/73421ee4
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/73421ee4
Branch: refs/heads/master
Commit: 73421ee4a689ddcdff39f7ffb7bc05ded1a2fe84
Parents: 52b8304
Author: Sergey Beryozkin <sb...@talend.com>
Authored: Mon Feb 16 16:08:40 2015 +0000
Committer: Sergey Beryozkin <sb...@talend.com>
Committed: Mon Feb 16 16:08:40 2015 +0000
----------------------------------------------------------------------
.../jose/jwe/DirectKeyJweDecryption.java | 34 ---------------
.../jose/jwe/DirectKeyJweEncryption.java | 44 --------------------
.../jose/jwe/EcdhDirectKeyJweDecryption.java | 2 +-
.../jose/jwe/EcdhDirectKeyJweEncryption.java | 8 ++--
.../cxf/rs/security/jose/jwe/JweDecryption.java | 28 +++++++++++++
.../cxf/rs/security/jose/jwe/JweEncryption.java | 29 +++++++++++++
.../cxf/rs/security/jose/jwe/JweUtils.java | 31 +++++++-------
.../jose/jwe/WrappedKeyJweDecryption.java | 28 -------------
.../jose/jwe/WrappedKeyJweEncryption.java | 29 -------------
.../jose/jwe/JweCompactReaderWriterTest.java | 8 ++--
.../security/jose/jwe/JweJsonProducerTest.java | 4 +-
.../jose/jwe/JwePbeHmacAesWrapTest.java | 4 +-
12 files changed, 87 insertions(+), 162 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/DirectKeyJweDecryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/DirectKeyJweDecryption.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/DirectKeyJweDecryption.java
deleted file mode 100644
index 6a98e46..0000000
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/DirectKeyJweDecryption.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * 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.cxf.rs.security.jose.jwe;
-
-import java.security.Key;
-
-public class DirectKeyJweDecryption extends AbstractJweDecryption {
- public DirectKeyJweDecryption(Key contentDecryptionKey,
- ContentDecryptionAlgorithm cipherProps) {
- this(new DirectKeyDecryptionAlgorithm(contentDecryptionKey),
- cipherProps);
- }
- protected DirectKeyJweDecryption(DirectKeyDecryptionAlgorithm direct,
- ContentDecryptionAlgorithm cipherProps) {
- super(direct, cipherProps);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/DirectKeyJweEncryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/DirectKeyJweEncryption.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/DirectKeyJweEncryption.java
deleted file mode 100644
index 5a951e1..0000000
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/DirectKeyJweEncryption.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * 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.cxf.rs.security.jose.jwe;
-
-
-public class DirectKeyJweEncryption extends AbstractJweEncryption {
-
- public DirectKeyJweEncryption(ContentEncryptionAlgorithm ceAlgo) {
- this(ceAlgo, new DirectKeyEncryptionAlgorithm());
- }
- protected DirectKeyJweEncryption(ContentEncryptionAlgorithm ceAlgo,
- DirectKeyEncryptionAlgorithm direct) {
- super(ceAlgo, direct);
- }
- @Override
- protected byte[] getProvidedContentEncryptionKey(JweHeaders headers) {
- return validateCek(super.getProvidedContentEncryptionKey(headers));
- }
- private static byte[] validateCek(byte[] cek) {
- if (cek == null) {
- // to prevent the cek from being auto-generated which
- // does not make sense for the direct key case
- throw new NullPointerException("CEK must not be null");
- }
- return cek;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/EcdhDirectKeyJweDecryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/EcdhDirectKeyJweDecryption.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/EcdhDirectKeyJweDecryption.java
index 584c54f..7284def 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/EcdhDirectKeyJweDecryption.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/EcdhDirectKeyJweDecryption.java
@@ -26,7 +26,7 @@ import org.apache.cxf.rs.security.jose.jwk.JsonWebKey;
import org.apache.cxf.rs.security.jose.jwk.JwkUtils;
-public class EcdhDirectKeyJweDecryption extends DirectKeyJweDecryption {
+public class EcdhDirectKeyJweDecryption extends JweDecryption {
public EcdhDirectKeyJweDecryption(ECPrivateKey privateKey, String supportedCtAlgo) {
super(new EcdhDirectKeyDecryptionAlgorithm(privateKey),
new AesGcmContentDecryptionAlgorithm(supportedCtAlgo));
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/EcdhDirectKeyJweEncryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/EcdhDirectKeyJweEncryption.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/EcdhDirectKeyJweEncryption.java
index aa18988..5264dff 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/EcdhDirectKeyJweEncryption.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/EcdhDirectKeyJweEncryption.java
@@ -30,18 +30,18 @@ import org.apache.cxf.rs.security.jose.jwa.Algorithm;
import org.apache.cxf.rs.security.jose.jwk.JwkUtils;
-public class EcdhDirectKeyJweEncryption extends DirectKeyJweEncryption {
+public class EcdhDirectKeyJweEncryption extends JweEncryption {
public EcdhDirectKeyJweEncryption(ECPublicKey peerPublicKey,
String curve,
String apuString,
String apvString,
String ctAlgo) {
- super(new EcdhAesGcmContentEncryptionAlgorithm(peerPublicKey,
+ super(new EcdhDirectKeyEncryptionAlgorithm(),
+ new EcdhAesGcmContentEncryptionAlgorithm(peerPublicKey,
curve,
apuString,
apvString,
- ctAlgo),
- new EcdhDirectKeyEncryptionAlgorithm());
+ ctAlgo));
}
protected static class EcdhDirectKeyEncryptionAlgorithm extends DirectKeyEncryptionAlgorithm {
protected void checkKeyEncryptionAlgorithm(JweHeaders headers) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweDecryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweDecryption.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweDecryption.java
new file mode 100644
index 0000000..9642354
--- /dev/null
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweDecryption.java
@@ -0,0 +1,28 @@
+/**
+ * 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.cxf.rs.security.jose.jwe;
+
+
+public class JweDecryption extends AbstractJweDecryption {
+
+ public JweDecryption(KeyDecryptionAlgorithm keyDecryptionAlgo,
+ ContentDecryptionAlgorithm cipherProps) {
+ super(keyDecryptionAlgo, cipherProps);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweEncryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweEncryption.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweEncryption.java
new file mode 100644
index 0000000..00d994e
--- /dev/null
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweEncryption.java
@@ -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.cxf.rs.security.jose.jwe;
+
+
+public class JweEncryption extends AbstractJweEncryption {
+ public JweEncryption(KeyEncryptionAlgorithm keyEncryptionAlgorithm,
+ ContentEncryptionAlgorithm contentEncryptionAlgo) {
+ super(contentEncryptionAlgo, keyEncryptionAlgorithm);
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
index 950efdf..c0a2b45 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
@@ -211,18 +211,21 @@ public final class JweUtils {
}
return null;
}
- public static DirectKeyJweEncryption getDirectKeyJweEncryption(JsonWebKey key) {
- return new DirectKeyJweEncryption(getContentEncryptionAlgorithm(key, key.getAlgorithm()));
+ public static JweEncryption getDirectKeyJweEncryption(JsonWebKey key) {
+ return new JweEncryption(new DirectKeyEncryptionAlgorithm(),
+ getContentEncryptionAlgorithm(key, key.getAlgorithm()));
}
- public static DirectKeyJweEncryption getDirectKeyJweEncryption(SecretKey key, String algorithm) {
- return new DirectKeyJweEncryption(getContentEncryptionAlgorithm(key, algorithm));
+ public static JweEncryption getDirectKeyJweEncryption(SecretKey key, String algorithm) {
+ return new JweEncryption(new DirectKeyEncryptionAlgorithm(),
+ getContentEncryptionAlgorithm(key, algorithm));
}
- public static DirectKeyJweDecryption getDirectKeyJweDecryption(SecretKey key, String algorithm) {
- return new DirectKeyJweDecryption(key, getContentDecryptionAlgorithm(algorithm));
+ public static JweDecryption getDirectKeyJweDecryption(SecretKey key, String algorithm) {
+ return new JweDecryption(new DirectKeyDecryptionAlgorithm(key),
+ getContentDecryptionAlgorithm(algorithm));
}
- public static DirectKeyJweDecryption getDirectKeyJweDecryption(JsonWebKey key) {
- return new DirectKeyJweDecryption(JwkUtils.toSecretKey(key),
- getContentDecryptionAlgorithm(key.getAlgorithm()));
+ public static JweDecryption getDirectKeyJweDecryption(JsonWebKey key) {
+ return new JweDecryption(new DirectKeyDecryptionAlgorithm(JwkUtils.toSecretKey(key)),
+ getContentDecryptionAlgorithm(key.getAlgorithm()));
}
public static JweEncryptionProvider loadEncryptionProvider(boolean required) {
return loadEncryptionProvider(null, required);
@@ -362,8 +365,8 @@ public final class JweUtils {
if (Algorithm.isAesCbcHmac(contentEncryptionAlgo)) {
return new AesCbcHmacJweEncryption(contentEncryptionAlgo, keyEncryptionProvider);
} else {
- return new WrappedKeyJweEncryption(keyEncryptionProvider,
- getContentEncryptionAlgorithm(contentEncryptionAlgo));
+ return new JweEncryption(keyEncryptionProvider,
+ getContentEncryptionAlgorithm(contentEncryptionAlgo));
}
}
public static JweDecryptionProvider createJweDecryptionProvider(RSAPrivateKey key,
@@ -385,8 +388,8 @@ public final class JweUtils {
if (Algorithm.isAesCbcHmac(contentDecryptionAlgo)) {
return new AesCbcHmacJweDecryption(keyDecryptionProvider, contentDecryptionAlgo);
} else {
- return new WrappedKeyJweDecryption(keyDecryptionProvider,
- getContentDecryptionAlgorithm(contentDecryptionAlgo));
+ return new JweDecryption(keyDecryptionProvider,
+ getContentDecryptionAlgorithm(contentDecryptionAlgo));
}
}
public static boolean validateCriticalHeaders(JoseHeaders headers) {
@@ -508,7 +511,7 @@ public final class JweUtils {
if (keyEncryptionProvider != null) {
return createJweEncryptionProvider(keyEncryptionProvider, headers);
} else {
- return new DirectKeyJweEncryption(ctEncryptionProvider);
+ return new JweEncryption(new DirectKeyEncryptionAlgorithm(), ctEncryptionProvider);
}
}
private static JweDecryptionProvider createJweDecryptionProvider(KeyDecryptionAlgorithm keyDecryptionProvider,
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyJweDecryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyJweDecryption.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyJweDecryption.java
deleted file mode 100644
index 4944151..0000000
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyJweDecryption.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * 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.cxf.rs.security.jose.jwe;
-
-
-public class WrappedKeyJweDecryption extends AbstractJweDecryption {
-
- public WrappedKeyJweDecryption(KeyDecryptionAlgorithm keyDecryptionAlgo,
- ContentDecryptionAlgorithm cipherProps) {
- super(keyDecryptionAlgo, cipherProps);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyJweEncryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyJweEncryption.java b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyJweEncryption.java
deleted file mode 100644
index 04c5a8b..0000000
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyJweEncryption.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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.cxf.rs.security.jose.jwe;
-
-
-public class WrappedKeyJweEncryption extends AbstractJweEncryption {
- public WrappedKeyJweEncryption(KeyEncryptionAlgorithm keyEncryptionAlgorithm,
- ContentEncryptionAlgorithm contentEncryptionAlgo) {
- super(contentEncryptionAlgo, keyEncryptionAlgorithm);
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
index 0f32318..50d8d3d 100644
--- a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
+++ b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
@@ -226,11 +226,11 @@ public class JweCompactReaderWriterTest extends Assert {
Algorithm.RSA_OAEP.getJwtName());
ContentEncryptionAlgorithm contentEncryptionAlgo =
new AesGcmContentEncryptionAlgorithm(key == null ? null : key.getEncoded(), INIT_VECTOR_A1, jwtKeyName);
- JweEncryptionProvider encryptor = new WrappedKeyJweEncryption(keyEncryptionAlgo, contentEncryptionAlgo);
+ JweEncryptionProvider encryptor = new JweEncryption(keyEncryptionAlgo, contentEncryptionAlgo);
return encryptor.encrypt(content.getBytes("UTF-8"), null);
}
private String encryptContentDirect(SecretKey key, String content) throws Exception {
- DirectKeyJweEncryption encryptor = new DirectKeyJweEncryption(
+ JweEncryption encryptor = new JweEncryption(new DirectKeyEncryptionAlgorithm(),
new AesGcmContentEncryptionAlgorithm(key, INIT_VECTOR_A1, JoseConstants.A128GCM_ALGO));
return encryptor.encrypt(content.getBytes("UTF-8"), null);
}
@@ -239,13 +239,13 @@ public class JweCompactReaderWriterTest extends Assert {
RSA_PRIVATE_EXPONENT_ENCODED_A1);
String algo = Cipher.getMaxAllowedKeyLength("AES") > 128
? JoseConstants.A256GCM_ALGO : JoseConstants.A128GCM_ALGO;
- JweDecryptionProvider decryptor = new WrappedKeyJweDecryption(new RSAKeyDecryptionAlgorithm(privateKey),
+ JweDecryptionProvider decryptor = new JweDecryption(new RSAKeyDecryptionAlgorithm(privateKey),
new AesGcmContentDecryptionAlgorithm(algo));
String decryptedText = decryptor.decrypt(jweContent).getContentText();
assertEquals(decryptedText, plainContent);
}
private void decryptDirect(SecretKey key, String jweContent, String plainContent) throws Exception {
- DirectKeyJweDecryption decryptor = new DirectKeyJweDecryption(key,
+ JweDecryption decryptor = new JweDecryption(new DirectKeyDecryptionAlgorithm(key),
new AesGcmContentDecryptionAlgorithm(JoseConstants.A128GCM_ALGO));
String decryptedText = decryptor.decrypt(jweContent).getContentText();
assertEquals(decryptedText, plainContent);
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
index 0eb8480..80f513a 100644
--- a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
+++ b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
@@ -289,10 +289,10 @@ public class JweJsonProducerTest extends Assert {
JweUtils.getSecretKeyEncryptionAlgorithm(wrapperKey1, JoseConstants.A128KW_ALGO);
ContentEncryptionAlgorithm contentEncryption =
JweUtils.getContentEncryptionAlgorithm(JoseConstants.A128GCM_ALGO);
- JweEncryptionProvider jwe1 = new WrappedKeyJweEncryption(keyEncryption1, contentEncryption);
+ JweEncryptionProvider jwe1 = new JweEncryption(keyEncryption1, contentEncryption);
KeyEncryptionAlgorithm keyEncryption2 =
JweUtils.getSecretKeyEncryptionAlgorithm(wrapperKey2, JoseConstants.A128KW_ALGO);
- JweEncryptionProvider jwe2 = new WrappedKeyJweEncryption(keyEncryption2, contentEncryption);
+ JweEncryptionProvider jwe2 = new JweEncryption(keyEncryption2, contentEncryption);
jweList.add(jwe1);
jweList.add(jwe2);
http://git-wip-us.apache.org/repos/asf/cxf/blob/73421ee4/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
index 4025cda..5f721f5 100644
--- a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
+++ b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JwePbeHmacAesWrapTest.java
@@ -63,11 +63,11 @@ public class JwePbeHmacAesWrapTest extends Assert {
final String password = "Thus from my lips, by yours, my sin is purged.";
KeyEncryptionAlgorithm keyEncryption =
new PbesHmacAesWrapKeyEncryptionAlgorithm(password, JoseConstants.PBES2_HS256_A128KW_ALGO);
- JweEncryptionProvider encryption = new WrappedKeyJweEncryption(keyEncryption,
+ JweEncryptionProvider encryption = new JweEncryption(keyEncryption,
new AesGcmContentEncryptionAlgorithm(Algorithm.A128GCM.getJwtName()));
String jweContent = encryption.encrypt(specPlainText.getBytes("UTF-8"), null);
PbesHmacAesWrapKeyDecryptionAlgorithm keyDecryption = new PbesHmacAesWrapKeyDecryptionAlgorithm(password);
- JweDecryptionProvider decryption = new WrappedKeyJweDecryption(keyDecryption,
+ JweDecryptionProvider decryption = new JweDecryption(keyDecryption,
new AesGcmContentDecryptionAlgorithm(JoseConstants.A128GCM_ALGO));
String decryptedText = decryption.decrypt(jweContent).getContentText();
assertEquals(specPlainText, decryptedText);