Merge pull request #925 from GRain-long/patch-1

modify BaseAsymmetric.java
This commit is contained in:
Golden Looly 2020-06-16 15:27:57 +08:00 committed by GitHub
commit 039ff77621
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,8 @@ public class BaseAsymmetric<T extends BaseAsymmetric<T>> {
* @return 获得私钥
*/
public String getPrivateKeyBase64() {
return Base64.encode(getPrivateKey().getEncoded());
final PrivateKey privateKey = getPrivateKey();
return (null == privateKey) ? null : Base64.encode(privateKey.getEncoded());
}
/**