updated jwe, jwt, and jwk models to have new parameters that were released in latest JOSE update

pull/105/head
Mike Derryberry 2012-07-06 15:01:03 -04:00
parent 70e90bc4c1
commit bc1ff0d964
2 changed files with 27 additions and 0 deletions

View File

@ -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();
@ -110,6 +112,14 @@ public class JweHeader extends JwtHeader{
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);
}
}

View File

@ -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);
}
}