cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Minor updates to JWE headers
Date Fri, 10 Apr 2015 13:42:28 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 24db3d78f -> e21501b29


Minor updates to JWE headers


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

Branch: refs/heads/3.0.x-fixes
Commit: e21501b29b0f9cbe15257abd0341abb39a74b410
Parents: 24db3d7
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Apr 10 14:41:27 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Apr 10 14:42:12 2015 +0100

----------------------------------------------------------------------
 .../cxf/rs/security/jose/jwe/JweHeaders.java      | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e21501b2/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 ead32de..b0bd902 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
@@ -26,6 +26,8 @@ import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.rs.security.jose.JoseConstants;
 import org.apache.cxf.rs.security.jose.JoseHeaders;
 import org.apache.cxf.rs.security.jose.JoseHeadersReaderWriter;
+import org.apache.cxf.rs.security.jose.jwa.ContentAlgorithm;
+import org.apache.cxf.rs.security.jose.jwa.KeyAlgorithm;
 
 
 
@@ -67,19 +69,33 @@ public class JweHeaders extends JoseHeaders {
     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() {
+        String algo = getKeyEncryptionAlgorithm();
+        return algo == null ? null : KeyAlgorithm.getAlgorithm(algo);
+    }
     
     public void setContentEncryptionAlgorithm(String type) {
         setHeader(JoseConstants.JWE_HEADER_CONTENT_ENC_ALGORITHM, type);
     }
     
+    public void setContentEncryptionAlgorithm(ContentAlgorithm algo) {
+        this.setContentEncryptionAlgorithm(algo.getJwaName());
+    }
+    
     public String getContentEncryptionAlgorithm() {
         return (String)getHeader(JoseConstants.JWE_HEADER_CONTENT_ENC_ALGORITHM);
     }
-    
+    public ContentAlgorithm getContentEncryptionAlgorithmEnum() {
+        String algo = getContentEncryptionAlgorithm();
+        return algo == null ? null : ContentAlgorithm.getAlgorithm(algo);
+    }
     public void setZipAlgorithm(String type) {
         setHeader(JoseConstants.JWE_HEADER_ZIP_ALGORITHM, type);
     }


Mime
View raw message