From bc1ff0d964b2b54b8c7eb35812c60721969ecc2e Mon Sep 17 00:00:00 2001 From: Mike Derryberry Date: Fri, 6 Jul 2012 15:01:03 -0400 Subject: [PATCH] updated jwe, jwt, and jwk models to have new parameters that were released in latest JOSE update --- .../java/org/mitre/jwe/model/JweHeader.java | 18 ++++++++++++++++++ .../java/org/mitre/jwt/model/JwtHeader.java | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/openid-connect-common/src/main/java/org/mitre/jwe/model/JweHeader.java b/openid-connect-common/src/main/java/org/mitre/jwe/model/JweHeader.java index 78ed1e097..0c39e256c 100644 --- a/openid-connect-common/src/main/java/org/mitre/jwe/model/JweHeader.java +++ b/openid-connect-common/src/main/java/org/mitre/jwe/model/JweHeader.java @@ -19,6 +19,8 @@ public class JweHeader extends JwtHeader{ public static final String X509_CERTIFICATE_THUMBPRINT = "x5t"; public static final String X509_CERTIFICATE_CHAIN = "x5c"; public static final String KEY_ID = "kid"; + public static final String KEY_DERIVATION_FUNCTION = "kdf"; + public static final String CONTENT_TYPE = "cty"; public JweHeader(){ super(); @@ -109,6 +111,14 @@ public class JweHeader extends JwtHeader{ public String getKeyId() { return KEY_ID; } + + public static String getKeyDerivationFunction() { + return KEY_DERIVATION_FUNCTION; + } + + public static String getContentType() { + return CONTENT_TYPE; + } public void setIv(String iv) { setClaim(INITIALIZATION_VECTOR, iv); @@ -149,4 +159,12 @@ public class JweHeader extends JwtHeader{ public void setKeyId(String kid) { setClaim(KEY_ID, kid); } + + public void setKeyDerivationFunction(String kdf) { + setClaim(KEY_DERIVATION_FUNCTION, kdf); + } + + public void setContentType(String cty) { + setClaim(CONTENT_TYPE, cty); + } } diff --git a/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtHeader.java b/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtHeader.java index b2e5bd4be..b2e130d37 100644 --- a/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtHeader.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtHeader.java @@ -25,6 +25,7 @@ public class JwtHeader extends ClaimSet { public static final String TYPE = "typ"; public static final String ALGORITHM = "alg"; public static final String ENCRYPTION_METHOD = "enc"; + public static final String CONTENT_TYPE = "cty"; /** * Make an empty header @@ -119,4 +120,12 @@ public class JwtHeader extends ClaimSet { setClaim(ENCRYPTION_METHOD, encryptionMethod); } + public static String getContentType() { + return CONTENT_TYPE; + } + + public void setContentType(String cty) { + setClaim(CONTENT_TYPE, cty); + } + }