extra constructors for algorithm wrappers
parent
e5732da857
commit
87fc92f97d
|
@ -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 {
|
||||
|
@ -56,4 +68,18 @@ public class JWEAlgorithmEntity {
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,19 @@ 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.
|
||||
* @return
|
||||
|
|
Loading…
Reference in New Issue