extra constructors for algorithm wrappers
parent
e5732da857
commit
87fc92f97d
|
@ -22,12 +22,24 @@ public class JWEAlgorithmEntity {
|
||||||
|
|
||||||
private JWEAlgorithm algorithm;
|
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.
|
* Get the name of this algorithm, return null if no algorithm set.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Basic
|
@Basic
|
||||||
public String getAlgorithm() {
|
public String getAlgorithmName() {
|
||||||
if (algorithm != null) {
|
if (algorithm != null) {
|
||||||
return algorithm.getName();
|
return algorithm.getName();
|
||||||
} else {
|
} else {
|
||||||
|
@ -40,7 +52,7 @@ public class JWEAlgorithmEntity {
|
||||||
* Calls JWEAlgorithm.parse()
|
* Calls JWEAlgorithm.parse()
|
||||||
* @param algorithmName
|
* @param algorithmName
|
||||||
*/
|
*/
|
||||||
public void setAlgorithm(String algorithmName) {
|
public void setAlgorithmName(String algorithmName) {
|
||||||
if (algorithmName != null) {
|
if (algorithmName != null) {
|
||||||
algorithm = JWEAlgorithm.parse(algorithmName);
|
algorithm = JWEAlgorithm.parse(algorithmName);
|
||||||
} else {
|
} else {
|
||||||
|
@ -55,5 +67,19 @@ public class JWEAlgorithmEntity {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "JWEAlgorithmEntity [algorithm=" + algorithm + "]";
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,19 @@ import com.nimbusds.jose.JWSAlgorithm;
|
||||||
public class JWSAlgorithmEntity {
|
public class JWSAlgorithmEntity {
|
||||||
|
|
||||||
private JWSAlgorithm algorithm;
|
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.
|
* Get the name of this algorithm, return null if no algorithm set.
|
||||||
|
|
Loading…
Reference in New Issue