mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
modify BaseAsymmetric.java
修改了getPrivateKeyBase64()方法,防止因未传入私钥而带来的空指针异常。
This commit is contained in:
parent
165b915506
commit
422ce00478
@ -143,7 +143,8 @@ public class BaseAsymmetric<T extends BaseAsymmetric<T>> {
|
|||||||
* @return 获得私钥
|
* @return 获得私钥
|
||||||
*/
|
*/
|
||||||
public String getPrivateKeyBase64() {
|
public String getPrivateKeyBase64() {
|
||||||
return Base64.encode(getPrivateKey().getEncoded());
|
final PrivateKey privateKey = getPrivateKey();
|
||||||
|
return (null == privateKey) ? null : Base64.encode(privateKey.getEncoded());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user