mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-07 01:18:27 +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){
|
public String toString(String mediaType){
|
||||||
StringBuffer metaDataString = new StringBuffer("");
|
StringBuffer metaDataString = new StringBuffer("");
|
||||||
|
//RSA Only
|
||||||
|
if(jwkSet.getKeys().get(0).getKeyType().getValue().equalsIgnoreCase("RSA")) {
|
||||||
|
|
||||||
if(StringUtils.isNotBlank(mediaType) && mediaType.equalsIgnoreCase("XML")) {
|
if(StringUtils.isNotBlank(mediaType) && mediaType.equalsIgnoreCase("XML")) {
|
||||||
|
|
||||||
metaDataString.append("<RSAKeyValue>").append("\n");
|
metaDataString.append("<RSAKeyValue>").append("\n");
|
||||||
for(JWK jwk : jwkSet.getKeys()) {
|
for(JWK jwk : jwkSet.getKeys()) {
|
||||||
RSAKey rsaKey = jwk.toRSAKey();
|
RSAKey rsaKey = jwk.toRSAKey();
|
||||||
@ -177,11 +181,15 @@ public class JWKSetKeyStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
metaDataString.append("</RSAKeyValue>");
|
metaDataString.append("</RSAKeyValue>");
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
|
//RSA Only
|
||||||
metaDataString.append(PrettyFactory.getJsonPretty().format(
|
metaDataString.append(PrettyFactory.getJsonPretty().format(
|
||||||
jwkSet.toPublicJWKSet().toString()));
|
jwkSet.toPublicJWKSet().toString()));
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
metaDataString.append("RSA Only");
|
||||||
|
}
|
||||||
return metaDataString.toString();
|
return metaDataString.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user