mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-22 21:00:51 +08:00
🐛 修复x509代码
This commit is contained in:
parent
0cfcc8d4a0
commit
5a2607787f
@ -47,7 +47,7 @@ public class PemUtils {
|
|||||||
|
|
||||||
public static X509Certificate loadCertificate(InputStream inputStream) {
|
public static X509Certificate loadCertificate(InputStream inputStream) {
|
||||||
try {
|
try {
|
||||||
CertificateFactory cf = CertificateFactory.getInstance("X509");
|
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
||||||
X509Certificate cert = (X509Certificate) cf.generateCertificate(inputStream);
|
X509Certificate cert = (X509Certificate) cf.generateCertificate(inputStream);
|
||||||
cert.checkValidity();
|
cert.checkValidity();
|
||||||
return cert;
|
return cert;
|
||||||
|
@ -47,7 +47,7 @@ public class RsaCryptoUtil {
|
|||||||
Object oldValue = field.get(encryptObject);
|
Object oldValue = field.get(encryptObject);
|
||||||
if (oldValue != null) {
|
if (oldValue != null) {
|
||||||
String oldStr = (String) oldValue;
|
String oldStr = (String) oldValue;
|
||||||
if (!oldStr.trim().equals("'")) {
|
if (!"".equals(oldStr.trim())) {
|
||||||
field.set(encryptObject, encryptOAEP(oldStr, certificate));
|
field.set(encryptObject, encryptOAEP(oldStr, certificate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user