From 87fc92f97df1576e1b68bd2012d854a9b45a48c6 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Tue, 19 Feb 2013 17:07:01 -0500 Subject: [PATCH] extra constructors for algorithm wrappers --- .../org/mitre/jose/JWEAlgorithmEntity.java | 30 +++++++++++++++++-- .../org/mitre/jose/JWSAlgorithmEntity.java | 13 ++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/openid-connect-common/src/main/java/org/mitre/jose/JWEAlgorithmEntity.java b/openid-connect-common/src/main/java/org/mitre/jose/JWEAlgorithmEntity.java index 1a9753178..d33af3baf 100644 --- a/openid-connect-common/src/main/java/org/mitre/jose/JWEAlgorithmEntity.java +++ b/openid-connect-common/src/main/java/org/mitre/jose/JWEAlgorithmEntity.java @@ -22,12 +22,24 @@ public class JWEAlgorithmEntity { private JWEAlgorithm algorithm; + public JWEAlgorithmEntity() { + + } + + public JWEAlgorithmEntity(JWEAlgorithm algorithm) { + this.algorithm = algorithm; + } + + public JWEAlgorithmEntity(String algorithmName) { + setAlgorithmName(algorithmName); + } + /** * Get the name of this algorithm, return null if no algorithm set. * @return */ @Basic - public String getAlgorithm() { + public String getAlgorithmName() { if (algorithm != null) { return algorithm.getName(); } else { @@ -40,7 +52,7 @@ public class JWEAlgorithmEntity { * Calls JWEAlgorithm.parse() * @param algorithmName */ - public void setAlgorithm(String algorithmName) { + public void setAlgorithmName(String algorithmName) { if (algorithmName != null) { algorithm = JWEAlgorithm.parse(algorithmName); } else { @@ -55,5 +67,19 @@ public class JWEAlgorithmEntity { public String toString() { return "JWEAlgorithmEntity [algorithm=" + algorithm + "]"; } + + /** + * @return the algorithm + */ + public JWEAlgorithm getAlgorithm() { + return algorithm; + } + + /** + * @param algorithm the algorithm to set + */ + public void setAlgorithm(JWEAlgorithm algorithm) { + this.algorithm = algorithm; + } } diff --git a/openid-connect-common/src/main/java/org/mitre/jose/JWSAlgorithmEntity.java b/openid-connect-common/src/main/java/org/mitre/jose/JWSAlgorithmEntity.java index 1a8096f7c..49232dc60 100644 --- a/openid-connect-common/src/main/java/org/mitre/jose/JWSAlgorithmEntity.java +++ b/openid-connect-common/src/main/java/org/mitre/jose/JWSAlgorithmEntity.java @@ -22,6 +22,19 @@ import com.nimbusds.jose.JWSAlgorithm; public class JWSAlgorithmEntity { private JWSAlgorithm algorithm; + + public JWSAlgorithmEntity() { + + } + + public JWSAlgorithmEntity(JWSAlgorithm algorithm) { + super(); + this.algorithm = algorithm; + } + + public JWSAlgorithmEntity(String algorithmName) { + setAlgorithmName(algorithmName); + } /** * Get the name of this algorithm, return null if no algorithm set.