cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Updating Jwe/JwsHeaders to use enums
Date Thu, 11 Jun 2015 13:40:44 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 2f4c098eb -> 4180bb26a


Updating Jwe/JwsHeaders to use enums


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4180bb26
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4180bb26
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4180bb26

Branch: refs/heads/master
Commit: 4180bb26a3103c50c77d82ddac79d6d9f75261f4
Parents: 2f4c098
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Jun 11 14:40:21 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Jun 11 14:40:21 2015 +0100

----------------------------------------------------------------------
 .../rs/security/jose/jwa/AlgorithmUtils.java    |  8 ++---
 .../cxf/rs/security/jose/jwa/KeyAlgorithm.java  |  5 ++--
 .../jose/jwe/AbstractJweDecryption.java         |  6 ++--
 .../jose/jwe/AbstractJweEncryption.java         |  8 ++---
 .../jwe/AbstractWrapKeyEncryptionAlgorithm.java | 12 ++++----
 .../jose/jwe/AesCbcHmacJweEncryption.java       |  2 +-
 .../jwe/AesGcmContentDecryptionAlgorithm.java   |  2 +-
 .../jose/jwe/EcdhDirectKeyJweDecryption.java    |  2 +-
 .../jose/jwe/EcdhDirectKeyJweEncryption.java    |  4 +--
 .../cxf/rs/security/jose/jwe/JweHeaders.java    | 31 +++++++-------------
 .../rs/security/jose/jwe/JweJsonConsumer.java   |  5 ++--
 .../jose/jwe/JweJwtCompactConsumer.java         | 11 +++----
 .../cxf/rs/security/jose/jwe/JweUtils.java      | 12 ++++----
 .../jose/jwe/WrappedKeyDecryptionAlgorithm.java |  5 ++--
 .../cxf/rs/security/jose/jws/JwsHeaders.java    | 14 +++------
 .../jose/jwe/JweCompactReaderWriterTest.java    |  4 +--
 .../security/jose/jwe/JweJsonProducerTest.java  |  5 ++--
 .../jose/jwe/JwePbeHmacAesWrapTest.java         |  2 +-
 .../rs/security/jose/jwk/JsonWebKeyTest.java    | 10 +++----
 19 files changed, 68 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/AlgorithmUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/AlgorithmUtils.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/AlgorithmUtils.java
index 96eb27e..f505caa 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/AlgorithmUtils.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/AlgorithmUtils.java
@@ -35,7 +35,7 @@ public final class AlgorithmUtils {
     // JWA
     public static final String RSA_OAEP_ALGO = "RSA-OAEP";
     public static final String RSA_OAEP_256_ALGO = "RSA-OAEP-256";
-    public static final String RSA_1_5_ALGO = "RSA1_5";
+    public static final String RSA1_5_ALGO = "RSA1_5";
     public static final String A128KW_ALGO = "A128KW";
     public static final String A192KW_ALGO = "A192KW";
     public static final String A256KW_ALGO = "A256KW";
@@ -108,7 +108,7 @@ public final class AlgorithmUtils {
                                                                        ES_SHA_512_ALGO));
     public static final Set<String> RSA_CEK_SET = new HashSet<String>(Arrays.asList(RSA_OAEP_ALGO,
                                                                                   RSA_OAEP_256_ALGO,
-                                                                                  RSA_1_5_ALGO));
+                                                                                  RSA1_5_ALGO));
     public static final Set<String> AES_GCM_CEK_SET = new HashSet<String>(Arrays.asList(A128GCM_ALGO,
                                                                                       A192GCM_ALGO,
                                                                                       A256GCM_ALGO));
@@ -146,7 +146,7 @@ public final class AlgorithmUtils {
         JAVA_TO_JWA_NAMES.put(ES_SHA_512_JAVA, ES_SHA_512_ALGO);
         JAVA_TO_JWA_NAMES.put(RSA_OAEP_ALGO_JAVA, RSA_OAEP_ALGO);
         JAVA_TO_JWA_NAMES.put(RSA_OAEP_256_ALGO_JAVA, RSA_OAEP_256_ALGO);
-        JAVA_TO_JWA_NAMES.put(RSA_1_5_ALGO_JAVA, RSA_1_5_ALGO);
+        JAVA_TO_JWA_NAMES.put(RSA_1_5_ALGO_JAVA, RSA1_5_ALGO);
         JAVA_TO_JWA_NAMES.put(AES_GCM_ALGO_JAVA, A256GCM_ALGO);
         JAVA_TO_JWA_NAMES.put(AES_GCM_ALGO_JAVA, A192GCM_ALGO);
         JAVA_TO_JWA_NAMES.put(AES_GCM_ALGO_JAVA, A128GCM_ALGO);
@@ -171,7 +171,7 @@ public final class AlgorithmUtils {
         JWA_TO_JAVA_NAMES.put(ES_SHA_512_ALGO, ES_SHA_512_JAVA);
         JWA_TO_JAVA_NAMES.put(RSA_OAEP_ALGO, RSA_OAEP_ALGO_JAVA);
         JWA_TO_JAVA_NAMES.put(RSA_OAEP_256_ALGO, RSA_OAEP_256_ALGO_JAVA);
-        JWA_TO_JAVA_NAMES.put(RSA_1_5_ALGO, RSA_1_5_ALGO_JAVA);
+        JWA_TO_JAVA_NAMES.put(RSA1_5_ALGO, RSA_1_5_ALGO_JAVA);
         JWA_TO_JAVA_NAMES.put(A128KW_ALGO, AES_WRAP_ALGO_JAVA);
         JWA_TO_JAVA_NAMES.put(A192KW_ALGO, AES_WRAP_ALGO_JAVA);
         JWA_TO_JAVA_NAMES.put(A256KW_ALGO, AES_WRAP_ALGO_JAVA);

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java
index 6fe6bf4..446f039 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java
@@ -25,7 +25,7 @@ package org.apache.cxf.rs.security.jose.jwa;
 public enum KeyAlgorithm {
     RSA_OAEP(AlgorithmUtils.RSA_OAEP_ALGO, "RSA/ECB/OAEPWithSHA-1AndMGF1Padding", -1),
     RSA_OAEP_256(AlgorithmUtils.RSA_OAEP_256_ALGO, "RSA/ECB/OAEPWithSHA-256AndMGF1Padding",
-1),
-    RSA_1_5(AlgorithmUtils.RSA_1_5_ALGO, "RSA/ECB/PKCS1Padding", -1),
+    RSA1_5(AlgorithmUtils.RSA1_5_ALGO, "RSA/ECB/PKCS1Padding", -1),
     A128KW(AlgorithmUtils.A128KW_ALGO, "AESWrap", 128),
     A192KW(AlgorithmUtils.A192KW_ALGO, "AESWrap", 192),
     A256KW(AlgorithmUtils.A256KW_ALGO, "AESWrap", 256),
@@ -37,7 +37,8 @@ public enum KeyAlgorithm {
     PBES2_HS512_A256KW(AlgorithmUtils.PBES2_HS512_A256KW_ALGO, "AESWrap", 256),
     ECDH_ES_A128KW(AlgorithmUtils.ECDH_ES_A128KW_ALGO, "AESWrap", 128),
     ECDH_ES_A192KW(AlgorithmUtils.ECDH_ES_A192KW_ALGO, "AESWrap", 192),
-    ECDH_ES_A256KW(AlgorithmUtils.ECDH_ES_A256KW_ALGO, "AESWrap", 256);
+    ECDH_ES_A256KW(AlgorithmUtils.ECDH_ES_A256KW_ALGO, "AESWrap", 256),
+    ECDH_ES_DIRECT(AlgorithmUtils.ECDH_ES_DIRECT_ALGO, null, -1);
         
     private final String jwaName;
     private final String javaName;

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweDecryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweDecryption.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweDecryption.java
index dbae000..f1bb990 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweDecryption.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweDecryption.java
@@ -63,7 +63,8 @@ public abstract class AbstractJweDecryption implements JweDecryptionProvider
{
         boolean compressionSupported = 
             JoseConstants.DEFLATE_ZIP_ALGORITHM.equals(jweDecryptionInput.getJweHeaders().getZipAlgorithm());
         keyProperties.setCompressionSupported(compressionSupported);
-        byte[] actualCek = getActualCek(cek, jweDecryptionInput.getJweHeaders().getContentEncryptionAlgorithm());
+        byte[] actualCek = getActualCek(cek, 
+                               jweDecryptionInput.getJweHeaders().getContentEncryptionAlgorithm().getJwaName());
         Key secretKey = CryptoUtils.createSecretKeySpec(actualCek, keyProperties.getKeyAlgo());
         byte[] bytes = 
             CryptoUtils.decryptBytes(getEncryptedContentWithAuthTag(jweDecryptionInput),
secretKey, keyProperties);
@@ -77,7 +78,8 @@ public abstract class AbstractJweDecryption implements JweDecryptionProvider
{
             getContentEncryptionCipherInitVector(jweDecryptionInput));
     }
     protected String getContentEncryptionAlgorithm(JweDecryptionInput jweDecryptionInput)
{
-        return AlgorithmUtils.toJavaName(jweDecryptionInput.getJweHeaders().getContentEncryptionAlgorithm());
+        return AlgorithmUtils.toJavaName(jweDecryptionInput.getJweHeaders()
+                                         .getContentEncryptionAlgorithm().getJwaName());
     }
     protected byte[] getContentEncryptionCipherAAD(JweDecryptionInput jweDecryptionInput)
{
         return contentDecryptionAlgo.getAdditionalAuthenticationData(

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweEncryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweEncryption.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweEncryption.java
index 6d4c0cb..dee590c 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweEncryption.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractJweEncryption.java
@@ -160,20 +160,20 @@ public abstract class AbstractJweEncryption implements JweEncryptionProvider
{
     private JweEncryptionInternal getInternalState(JweHeaders jweInHeaders, JweEncryptionInput
jweInput) {
         JweHeaders theHeaders = new JweHeaders();
         if (getKeyAlgorithm() != null) {
-            theHeaders.setKeyEncryptionAlgorithm(getKeyAlgorithm().getJwaName());
+            theHeaders.setKeyEncryptionAlgorithm(getKeyAlgorithm());
         }
-        theHeaders.setContentEncryptionAlgorithm(getContentEncryptionAlgoJwt());
+        theHeaders.setContentEncryptionAlgorithm(getContentEncryptionAlgorithm().getAlgorithm());
         
         JweHeaders protectedHeaders = null;
         if (jweInHeaders != null) {
             if (jweInHeaders.getKeyEncryptionAlgorithm() != null 
                 && (getKeyAlgorithm() == null 
-                    || !getKeyAlgorithm().getJwaName().equals(jweInHeaders.getKeyEncryptionAlgorithm())))
{
+                    || !getKeyAlgorithm().equals(jweInHeaders.getKeyEncryptionAlgorithm())))
{
                 LOG.warning("Invalid key encryption algorithm");
                 throw new JweException(JweException.Error.INVALID_KEY_ALGORITHM);
             }
             if (jweInHeaders.getContentEncryptionAlgorithm() != null 
-                && !getContentEncryptionAlgoJwt().equals(jweInHeaders.getContentEncryptionAlgorithm()))
{
+                && !getContentEncryptionAlgoJwt().equals(jweInHeaders.getContentEncryptionAlgorithm().getJwaName()))
{
                 LOG.warning("Invalid content encryption algorithm");
                 throw new JweException(JweException.Error.INVALID_CONTENT_ALGORITHM);
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractWrapKeyEncryptionAlgorithm.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractWrapKeyEncryptionAlgorithm.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractWrapKeyEncryptionAlgorithm.java
index 7e94cd6..ffb971f 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractWrapKeyEncryptionAlgorithm.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AbstractWrapKeyEncryptionAlgorithm.java
@@ -73,10 +73,10 @@ public abstract class AbstractWrapKeyEncryptionAlgorithm implements KeyEncryptio
         }
     }
     protected String getKeyEncryptionAlgoJava(JweHeaders headers) {
-        return AlgorithmUtils.toJavaName(headers.getKeyEncryptionAlgorithm());
+        return AlgorithmUtils.toJavaName(headers.getKeyEncryptionAlgorithm().getJwaName());
     }
     protected String getContentEncryptionAlgoJava(JweHeaders headers) {
-        return AlgorithmUtils.toJavaName(headers.getContentEncryptionAlgorithm());
+        return AlgorithmUtils.toJavaName(headers.getContentEncryptionAlgorithm().getJwaName());
     }
     protected AlgorithmParameterSpec getAlgorithmParameterSpec(JweHeaders headers) {
         return null;
@@ -89,16 +89,16 @@ public abstract class AbstractWrapKeyEncryptionAlgorithm implements KeyEncryptio
         return algo;
     }
     protected void checkAlgorithms(JweHeaders headers) {
-        String providedAlgo = headers.getKeyEncryptionAlgorithm();
-        if (providedAlgo != null && !providedAlgo.equals(algorithm.getJwaName()))
{
+        KeyAlgorithm providedAlgo = headers.getKeyEncryptionAlgorithm();
+        if (providedAlgo != null && !providedAlgo.equals(algorithm)) {
             LOG.warning("Invalid key encryption algorithm: " + providedAlgo);
             throw new JweException(JweException.Error.INVALID_KEY_ALGORITHM);
         }
         if (providedAlgo != null) {
-            checkAlgorithm(providedAlgo);
+            checkAlgorithm(providedAlgo.getJwaName());
         } else {
             checkAlgorithm(algorithm.getJwaName());
-            headers.setKeyEncryptionAlgorithm(algorithm.getJwaName());
+            headers.setKeyEncryptionAlgorithm(algorithm);
         }
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesCbcHmacJweEncryption.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesCbcHmacJweEncryption.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesCbcHmacJweEncryption.java
index 36d21e8..80a8630 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesCbcHmacJweEncryption.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesCbcHmacJweEncryption.java
@@ -104,7 +104,7 @@ public class AesCbcHmacJweEncryption extends JweEncryption {
                                                      byte[] extraAad,
                                                      JweHeaders theHeaders,
                                                      String protectedHeadersJson) {
-        String algoJwt = theHeaders.getContentEncryptionAlgorithm();
+        String algoJwt = theHeaders.getContentEncryptionAlgorithm().getJwaName();
         int size = getFullCekKeySize(algoJwt) / 2;
         byte[] macKey = new byte[size];
         System.arraycopy(secretKey, 0, macKey, 0, size);

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesGcmContentDecryptionAlgorithm.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesGcmContentDecryptionAlgorithm.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesGcmContentDecryptionAlgorithm.java
index c588c5e..9e95f00 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesGcmContentDecryptionAlgorithm.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesGcmContentDecryptionAlgorithm.java
@@ -31,7 +31,7 @@ public class AesGcmContentDecryptionAlgorithm extends AbstractContentEncryptionC
 
     @Override
     public byte[] getEncryptedSequence(JweHeaders headers, byte[] cipher, byte[] authTag)
{
-        String algo = headers.getContentEncryptionAlgorithm();
+        String algo = headers.getContentEncryptionAlgorithm().getJwaName();
         if (!AlgorithmUtils.isAesGcm(algo) || !getAlgorithm().getJwaName().equals(algo))
{
             LOG.warning("Invalid content encryption algorithm");
             throw new JweException(JweException.Error.INVALID_CONTENT_ALGORITHM);

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/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 90466c4..64cb7e5 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
@@ -33,7 +33,7 @@ public class EcdhDirectKeyJweDecryption extends JweDecryption {
     }
     protected static byte[] getDecryptedContentEncryptionKeyFromHeaders(JweHeaders headers,
                                                                         ECPrivateKey privateKey)
{
-        ContentAlgorithm jwtAlgo = ContentAlgorithm.valueOf(headers.getContentEncryptionAlgorithm());
+        ContentAlgorithm jwtAlgo = headers.getContentEncryptionAlgorithm();
         JsonWebKey publicJwk = headers.getJsonWebKey("epv");
         String apuHeader = (String)headers.getHeader("apu");
         byte[] apuBytes = apuHeader == null ? null : JoseUtils.decode(apuHeader);

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/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 95aa6dc..39b6928 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
@@ -24,8 +24,8 @@ import java.security.interfaces.ECPublicKey;
 
 import org.apache.cxf.common.util.Base64UrlUtility;
 import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.rs.security.jose.jwa.AlgorithmUtils;
 import org.apache.cxf.rs.security.jose.jwa.ContentAlgorithm;
+import org.apache.cxf.rs.security.jose.jwa.KeyAlgorithm;
 import org.apache.cxf.rs.security.jose.jwk.JwkUtils;
 import org.apache.cxf.rt.security.crypto.CryptoUtils;
 
@@ -50,7 +50,7 @@ public class EcdhDirectKeyJweEncryption extends JweEncryption {
     }
     protected static class EcdhDirectKeyEncryptionAlgorithm extends DirectKeyEncryptionAlgorithm
{
         protected void checkKeyEncryptionAlgorithm(JweHeaders headers) {
-            headers.setKeyEncryptionAlgorithm(AlgorithmUtils.ECDH_ES_DIRECT_ALGO);
+            headers.setKeyEncryptionAlgorithm(KeyAlgorithm.ECDH_ES_DIRECT);
         }
     }
     protected static class EcdhAesGcmContentEncryptionAlgorithm extends AesGcmContentEncryptionAlgorithm
{

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweHeaders.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweHeaders.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweHeaders.java
index 51ca4d7..4b98cb7 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweHeaders.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweHeaders.java
@@ -58,43 +58,32 @@ public class JweHeaders extends JoseHeaders {
     }
     private void init(String keyEncAlgo, String ctEncAlgo, boolean deflate) {
         if (keyEncAlgo != null) {
-            setKeyEncryptionAlgorithm(keyEncAlgo);    
+            setKeyEncryptionAlgorithm(KeyAlgorithm.getAlgorithm(keyEncAlgo));    
         }
-        setContentEncryptionAlgorithm(ctEncAlgo);
+        setContentEncryptionAlgorithm(ContentAlgorithm.getAlgorithm(ctEncAlgo));
         if (deflate) {
             setZipAlgorithm(JoseConstants.DEFLATE_ZIP_ALGORITHM);
         }
     }
     
-    public void setKeyEncryptionAlgorithm(String type) {
-        super.setAlgorithm(type);
-    }
     public void setKeyEncryptionAlgorithm(KeyAlgorithm algo) {
-        this.setKeyEncryptionAlgorithm(algo.getJwaName());
-    }
-    
-    public String getKeyEncryptionAlgorithm() {
-        return super.getAlgorithm();
-    }
-    public KeyAlgorithm getKeyEncryptionAlgorithmEnum() {
-        return KeyAlgorithm.getAlgorithm(getKeyEncryptionAlgorithm());
+        super.setAlgorithm(algo.getJwaName());
     }
     
-    public void setContentEncryptionAlgorithm(String type) {
-        setHeader(JoseConstants.JWE_HEADER_CONTENT_ENC_ALGORITHM, type);
+    public KeyAlgorithm getKeyEncryptionAlgorithm() {
+        String algo = super.getAlgorithm();
+        return algo == null ? null : KeyAlgorithm.getAlgorithm(algo);
     }
     
     public void setContentEncryptionAlgorithm(ContentAlgorithm algo) {
-        this.setContentEncryptionAlgorithm(algo.getJwaName());
+        setHeader(JoseConstants.JWE_HEADER_CONTENT_ENC_ALGORITHM, algo.getJwaName());
     }
     
-    public String getContentEncryptionAlgorithm() {
+    public ContentAlgorithm getContentEncryptionAlgorithm() {
         Object prop = getHeader(JoseConstants.JWE_HEADER_CONTENT_ENC_ALGORITHM);
-        return prop == null ? null : prop.toString();
-    }
-    public ContentAlgorithm getContentEncryptionAlgorithmEnum() {
-        return ContentAlgorithm.getAlgorithm(getContentEncryptionAlgorithm());
+        return prop == null ? null : ContentAlgorithm.getAlgorithm(prop.toString());
     }
+    
     public void setZipAlgorithm(String type) {
         setHeader(JoseConstants.JWE_HEADER_ZIP_ALGORITHM, type);
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
index b13d367..0a86a14 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
@@ -31,6 +31,7 @@ import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxrs.provider.json.JsonMapObjectReaderWriter;
 import org.apache.cxf.rs.security.jose.JoseException;
 import org.apache.cxf.rs.security.jose.JoseUtils;
+import org.apache.cxf.rs.security.jose.jwa.KeyAlgorithm;
 
 public class JweJsonConsumer {
     protected static final Logger LOG = LogUtils.getL7dLogger(JweJsonConsumer.class);
@@ -83,8 +84,8 @@ public class JweJsonConsumer {
 
     private JweJsonEncryptionEntry getJweDecryptionEntry(JweDecryptionProvider jwe) {
         for (Map.Entry<JweJsonEncryptionEntry, JweHeaders> entry : recipientsMap.entrySet())
{
-            String keyAlgo = entry.getValue().getKeyEncryptionAlgorithm();
-            if (keyAlgo != null && keyAlgo.equals(jwe.getKeyAlgorithm().getJwaName())
+            KeyAlgorithm keyAlgo = entry.getValue().getKeyEncryptionAlgorithm();
+            if (keyAlgo != null && keyAlgo.equals(jwe.getKeyAlgorithm())
                 || keyAlgo == null && jwe.getKeyAlgorithm() == null) {
                 return entry.getKey();        
             }    

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJwtCompactConsumer.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJwtCompactConsumer.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJwtCompactConsumer.java
index 77dcf27..09e491b 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJwtCompactConsumer.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJwtCompactConsumer.java
@@ -35,17 +35,18 @@ public class JweJwtCompactConsumer  {
         headers = jweConsumer.getJweHeaders();
     }
     public JwtToken decryptWith(JsonWebKey key) {
-        return decryptWith(JweUtils.createJweDecryptionProvider(key, headers.getContentEncryptionAlgorithm()));
+        return decryptWith(JweUtils.createJweDecryptionProvider(key, 
+                               headers.getContentEncryptionAlgorithm().getJwaName()));
     }
     public JwtToken decryptWith(RSAPrivateKey key) {
         return decryptWith(JweUtils.createJweDecryptionProvider(key, 
-                                                                headers.getKeyEncryptionAlgorithm(),
-                                                                headers.getContentEncryptionAlgorithm()));
+                               headers.getKeyEncryptionAlgorithm().getJwaName(),
+                               headers.getContentEncryptionAlgorithm().getJwaName()));
     }
     public JwtToken decryptWith(SecretKey key) {
         return decryptWith(JweUtils.createJweDecryptionProvider(key, 
-                                                                headers.getKeyEncryptionAlgorithm(),
-                                                                headers.getContentEncryptionAlgorithm()));
+                               headers.getKeyEncryptionAlgorithm().getJwaName(),
+                               headers.getContentEncryptionAlgorithm().getJwaName()));
     }
     public JwtToken decryptWith(JweDecryptionProvider jwe) {
         byte[] bytes = jwe.decrypt(jweConsumer.getJweDecryptionInput());

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/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 a6b4b1f..61f6680 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
@@ -332,9 +332,9 @@ public final class JweUtils {
             KeyManagementUtils.validateCertificateChain(props, chain);
             PrivateKey privateKey = 
                 KeyManagementUtils.loadPrivateKey(m, props, chain, KeyOperation.DECRYPT);
-            contentEncryptionAlgo = inHeaders.getContentEncryptionAlgorithm();
+            contentEncryptionAlgo = inHeaders.getContentEncryptionAlgorithm().getJwaName();
             keyDecryptionProvider = getPrivateKeyDecryptionAlgorithm(privateKey, 
-                                                                 inHeaders.getKeyEncryptionAlgorithm());
+                                                                 inHeaders.getKeyEncryptionAlgorithm().getJwaName());
         } else {
             if (JwkUtils.JWK_KEY_STORE_TYPE.equals(props.get(KeyManagementUtils.RSSEC_KEY_STORE_TYPE)))
{
                 JsonWebKey jwk = JwkUtils.loadJsonWebKey(m, props, KeyOperation.DECRYPT);
@@ -362,7 +362,7 @@ public final class JweUtils {
     }
     public static JweEncryptionProvider createJweEncryptionProvider(RSAPublicKey key, JweHeaders
headers) {
         KeyEncryptionProvider keyEncryptionProvider = getRSAKeyEncryptionProvider(key, 
-                                                           headers.getKeyEncryptionAlgorithm());
+                                                           headers.getKeyEncryptionAlgorithm().getJwaName());
         return createJweEncryptionProvider(keyEncryptionProvider, headers);
     }
     public static JweEncryptionProvider createJweEncryptionProvider(SecretKey key,
@@ -374,7 +374,7 @@ public final class JweUtils {
     }
     public static JweEncryptionProvider createJweEncryptionProvider(SecretKey key, JweHeaders
headers) {
         KeyEncryptionProvider keyEncryptionProvider = getSecretKeyEncryptionAlgorithm(key,

-                                                           headers.getKeyEncryptionAlgorithm());
+                                                           headers.getKeyEncryptionAlgorithm().getJwaName());
         return createJweEncryptionProvider(keyEncryptionProvider, headers);
     }
     public static JweEncryptionProvider createJweEncryptionProvider(JsonWebKey key,
@@ -397,7 +397,7 @@ public final class JweUtils {
     }
     public static JweEncryptionProvider createJweEncryptionProvider(KeyEncryptionProvider
keyEncryptionProvider,
                                                                     JweHeaders headers) {
-        String contentEncryptionAlgo = headers.getContentEncryptionAlgorithm();
+        String contentEncryptionAlgo = headers.getContentEncryptionAlgorithm().getJwaName();
         if (AlgorithmUtils.isAesCbcHmac(contentEncryptionAlgo)) { 
             return new AesCbcHmacJweEncryption(getContentAlgo(contentEncryptionAlgo), keyEncryptionProvider);
         } else {
@@ -531,7 +531,7 @@ public final class JweUtils {
         if (keyEncryptionAlgo != null) {
             headers.setAlgorithm(keyEncryptionAlgo);
         }
-        headers.setContentEncryptionAlgorithm(contentEncryptionAlgo);
+        headers.setContentEncryptionAlgorithm(ContentAlgorithm.getAlgorithm(contentEncryptionAlgo));
         if (compression != null) {
             headers.setZipAlgorithm(compression);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyDecryptionAlgorithm.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyDecryptionAlgorithm.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyDecryptionAlgorithm.java
index 7def0ce..e7ee28e 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyDecryptionAlgorithm.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/WrappedKeyDecryptionAlgorithm.java
@@ -66,7 +66,7 @@ public class WrappedKeyDecryptionAlgorithm implements KeyDecryptionAlgorithm
{
         return -1;
     }
     protected String getKeyEncryptionAlgorithm(JweDecryptionInput jweDecryptionInput) {
-        String keyAlgo = jweDecryptionInput.getJweHeaders().getKeyEncryptionAlgorithm();
+        String keyAlgo = jweDecryptionInput.getJweHeaders().getKeyEncryptionAlgorithm().getJwaName();
         validateKeyEncryptionAlgorithm(keyAlgo);
         return AlgorithmUtils.toJavaName(keyAlgo);
     }
@@ -81,7 +81,8 @@ public class WrappedKeyDecryptionAlgorithm implements KeyDecryptionAlgorithm
{
         throw new JweException(JweException.Error.INVALID_KEY_ALGORITHM);
     }
     protected String getContentEncryptionAlgorithm(JweDecryptionInput jweDecryptionInput)
{
-        return AlgorithmUtils.toJavaName(jweDecryptionInput.getJweHeaders().getContentEncryptionAlgorithm());
+        return AlgorithmUtils.toJavaName(
+            jweDecryptionInput.getJweHeaders().getContentEncryptionAlgorithm().getJwaName());
     }
     protected AlgorithmParameterSpec getAlgorithmParameterSpec(JweDecryptionInput jweDecryptionInput)
{
         return null;

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsHeaders.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsHeaders.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsHeaders.java
index 2477f1a..d0f34a3 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsHeaders.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/JwsHeaders.java
@@ -41,18 +41,12 @@ public class JwsHeaders extends JoseHeaders {
         setAlgorithm(sigAlgo);
     }
 
-    public void setSignatureAlgorithm(String type) {
-        setAlgorithm(type);
-    }
-    
     public void setSignatureAlgorithm(SignatureAlgorithm algo) {
-        this.setSignatureAlgorithm(algo.getJwaName());
+        super.setAlgorithm(algo.getJwaName());
     }
     
-    public String getSignatureAlgorithm() {
-        return super.getAlgorithm();
-    }
-    public SignatureAlgorithm getSignatureAlgorithmEnum() {
-        return SignatureAlgorithm.getAlgorithm(getSignatureAlgorithm());
+    public SignatureAlgorithm getSignatureAlgorithm() {
+        String algo = super.getAlgorithm();
+        return algo == null ? null : SignatureAlgorithm.getAlgorithm(algo);
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/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 ff01a24..3124371 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
@@ -146,7 +146,7 @@ public class JweCompactReaderWriterTest extends Assert {
                                                              RSA_PUBLIC_EXPONENT_ENCODED_A1);
         
         KeyEncryptionProvider keyEncryption = new RSAKeyEncryptionAlgorithm(publicKey, 
-                                                                             KeyAlgorithm.RSA_1_5);
+                                                                             KeyAlgorithm.RSA1_5);
         
         JweEncryptionProvider encryption = new AesCbcHmacJweEncryption(ContentAlgorithm.A128CBC_HS256,
                                                            CONTENT_ENCRYPTION_KEY_A3, 
@@ -157,7 +157,7 @@ public class JweCompactReaderWriterTest extends Assert {
         RSAPrivateKey privateKey = CryptoUtils.getRSAPrivateKey(RSA_MODULUS_ENCODED_A1, 
                                                                 RSA_PRIVATE_EXPONENT_ENCODED_A1);
         KeyDecryptionAlgorithm keyDecryption = new RSAKeyDecryptionAlgorithm(privateKey,
-                                                                             KeyAlgorithm.RSA_1_5);
+                                                                             KeyAlgorithm.RSA1_5);
         JweDecryptionProvider decryption = new AesCbcHmacJweDecryption(keyDecryption);
         String decryptedText = decryption.decrypt(jweContent).getContentText();
         assertEquals(specPlainText, decryptedText);

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/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 d3e9136..ba51999 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
@@ -28,6 +28,7 @@ import javax.crypto.SecretKey;
 import org.apache.cxf.common.util.Base64UrlUtility;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.rs.security.jose.jwa.AlgorithmUtils;
+import org.apache.cxf.rs.security.jose.jwa.KeyAlgorithm;
 import org.apache.cxf.rt.security.crypto.CryptoUtils;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.junit.AfterClass;
@@ -259,7 +260,7 @@ public class JweJsonProducerTest extends Assert {
             }
         };
         JweHeaders recepientUnprotectedHeaders = new JweHeaders();
-        recepientUnprotectedHeaders.setKeyEncryptionAlgorithm(AlgorithmUtils.A128KW_ALGO);
+        recepientUnprotectedHeaders.setKeyEncryptionAlgorithm(KeyAlgorithm.A128KW);
         String jweJson = p.encryptWith(jwe, recepientUnprotectedHeaders);
         assertEquals(SINGLE_RECIPIENT_ALL_HEADERS_AAD_OUTPUT, jweJson);
     }
@@ -272,7 +273,7 @@ public class JweJsonProducerTest extends Assert {
         JweHeaders protectedHeaders = new JweHeaders(AlgorithmUtils.A128GCM_ALGO);
         JweHeaders sharedUnprotectedHeaders = new JweHeaders();
         sharedUnprotectedHeaders.setJsonWebKeysUrl("https://server.example.com/keys.jwks");
-        sharedUnprotectedHeaders.setKeyEncryptionAlgorithm(AlgorithmUtils.A128KW_ALGO);
+        sharedUnprotectedHeaders.setKeyEncryptionAlgorithm(KeyAlgorithm.A128KW);
         
         List<JweEncryptionProvider> jweList = new LinkedList<JweEncryptionProvider>();
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/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 2e1d942..3cca584 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
@@ -60,7 +60,7 @@ public class JwePbeHmacAesWrapTest extends Assert {
         final String specPlainText = "Live long and prosper.";
         JweHeaders headers = new JweHeaders();
         headers.setAlgorithm(AlgorithmUtils.PBES2_HS256_A128KW_ALGO);
-        headers.setContentEncryptionAlgorithm(ContentAlgorithm.A128GCM.getJwaName());
+        headers.setContentEncryptionAlgorithm(ContentAlgorithm.A128GCM);
         final String password = "Thus from my lips, by yours, my sin is purged."; 
         KeyEncryptionProvider keyEncryption = 
             new PbesHmacAesWrapKeyEncryptionAlgorithm(password, KeyAlgorithm.PBES2_HS256_A128KW);

http://git-wip-us.apache.org/repos/asf/cxf/blob/4180bb26/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java
b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java
index 8ecabd7..6a60fc9 100644
--- a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java
+++ b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwk/JsonWebKeyTest.java
@@ -130,9 +130,8 @@ public class JsonWebKeyTest extends Assert {
             String encryptedKeySet = JwkUtils.encryptJwkSet(jwks, password.toCharArray());
             JweCompactConsumer c = new JweCompactConsumer(encryptedKeySet);
             assertEquals("jwk-set+json", c.getJweHeaders().getContentType());
-            assertEquals(KeyAlgorithm.PBES2_HS256_A128KW.getJwaName(), c.getJweHeaders().getKeyEncryptionAlgorithm());
-            assertEquals(ContentAlgorithm.A128CBC_HS256.getJwaName(), 
-                         c.getJweHeaders().getContentEncryptionAlgorithm());
+            assertEquals(KeyAlgorithm.PBES2_HS256_A128KW, c.getJweHeaders().getKeyEncryptionAlgorithm());
+            assertEquals(ContentAlgorithm.A128CBC_HS256, c.getJweHeaders().getContentEncryptionAlgorithm());
             assertNotNull(c.getJweHeaders().getHeader("p2s"));
             assertNotNull(c.getJweHeaders().getHeader("p2c"));
             jwks = JwkUtils.decryptJwkSet(encryptedKeySet, password.toCharArray());
@@ -155,9 +154,8 @@ public class JsonWebKeyTest extends Assert {
             String encryptedKey = JwkUtils.encryptJwkKey(jwk, password.toCharArray());
             JweCompactConsumer c = new JweCompactConsumer(encryptedKey);
             assertEquals("jwk+json", c.getJweHeaders().getContentType());
-            assertEquals(KeyAlgorithm.PBES2_HS256_A128KW.getJwaName(), c.getJweHeaders().getKeyEncryptionAlgorithm());
-            assertEquals(ContentAlgorithm.A128CBC_HS256.getJwaName(), 
-                         c.getJweHeaders().getContentEncryptionAlgorithm());
+            assertEquals(KeyAlgorithm.PBES2_HS256_A128KW, c.getJweHeaders().getKeyEncryptionAlgorithm());
+            assertEquals(ContentAlgorithm.A128CBC_HS256, c.getJweHeaders().getContentEncryptionAlgorithm());
             assertNotNull(c.getJweHeaders().getHeader("p2s"));
             assertNotNull(c.getJweHeaders().getHeader("p2c"));
             jwk = JwkUtils.decryptJwkKey(encryptedKey, password.toCharArray());


Mime
View raw message