mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-06 17:08:29 +08:00
Update JWKSetKeyStore.java
This commit is contained in:
parent
c0df0c9d76
commit
6caa5a02f4
@ -142,7 +142,11 @@ public class JWKSetKeyStore {
|
||||
|
||||
public String toString(String mediaType){
|
||||
StringBuffer metaDataString = new StringBuffer("");
|
||||
//RSA Only
|
||||
if(jwkSet.getKeys().get(0).getKeyType().getValue().equalsIgnoreCase("RSA")) {
|
||||
|
||||
if(StringUtils.isNotBlank(mediaType) && mediaType.equalsIgnoreCase("XML")) {
|
||||
|
||||
metaDataString.append("<RSAKeyValue>").append("\n");
|
||||
for(JWK jwk : jwkSet.getKeys()) {
|
||||
RSAKey rsaKey = jwk.toRSAKey();
|
||||
@ -177,11 +181,15 @@ public class JWKSetKeyStore {
|
||||
}
|
||||
}
|
||||
metaDataString.append("</RSAKeyValue>");
|
||||
|
||||
}else {
|
||||
//RSA Only
|
||||
metaDataString.append(PrettyFactory.getJsonPretty().format(
|
||||
jwkSet.toPublicJWKSet().toString()));
|
||||
}
|
||||
|
||||
}else {
|
||||
metaDataString.append("RSA Only");
|
||||
}
|
||||
return metaDataString.toString();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user