fix JSONUtil.isJson

This commit is contained in:
Looly
2021-02-03 12:57:14 +08:00
parent f126ded53a
commit 1a7812a281
6 changed files with 30 additions and 8 deletions

View File

@@ -63,8 +63,16 @@ public class PemUtil {
final PemObject object = readPemObject(keyStream);
final String type = object.getType();
if (StrUtil.isNotBlank(type)) {
if (type.endsWith("PRIVATE KEY")) {
//private
if (type.endsWith("EC PRIVATE KEY")) {
return KeyUtil.generatePrivateKey("EC", object.getContent());
}if (type.endsWith("PRIVATE KEY")) {
return KeyUtil.generateRSAPrivateKey(object.getContent());
}
// public
if (type.endsWith("EC PUBLIC KEY")) {
return KeyUtil.generatePublicKey("EC", object.getContent());
} else if (type.endsWith("PUBLIC KEY")) {
return KeyUtil.generateRSAPublicKey(object.getContent());
} else if (type.endsWith("CERTIFICATE")) {