Package com.wechat.pay.java.core.util
Class PemUtil
java.lang.Object
com.wechat.pay.java.core.util.PemUtil
PEM工具
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getSerialNumber
(X509Certificate certificate) static PrivateKey
loadPrivateKeyFromPath
(String keyPath) 从文件路径加载RSA私钥static PrivateKey
loadPrivateKeyFromPath
(String keyPath, String algorithm, String provider) 从文件路径加载指定算法的私钥static PrivateKey
loadPrivateKeyFromString
(String keyString) 从字符串中加载RSA私钥。static PrivateKey
loadPrivateKeyFromString
(String keyString, String algorithm, String provider) 从字符串中加载指定算法的私钥static PublicKey
loadPublicKeyFromPath
(String keyPath) 从文件路径加载RSA公钥static PublicKey
loadPublicKeyFromString
(String keyString) 从字符串中加载RSA公钥。static X509Certificate
loadX509FromPath
(String certificatePath) 从文件路径加载X.509证书static X509Certificate
loadX509FromPath
(String certificatePath, String provider) 从文件路径加载X.509证书static X509Certificate
loadX509FromStream
(InputStream inputStream) 从输入流加载X.509证书static X509Certificate
loadX509FromStream
(InputStream inputStream, String provider) 从输入流加载X.509证书static X509Certificate
loadX509FromString
(String certificateString) 从字符串加载X.509证书static X509Certificate
loadX509FromString
(String certificateString, String provider) 从字符串加载X.509证书
-
Method Details
-
loadPrivateKeyFromString
从字符串中加载RSA私钥。- Parameters:
keyString
- 私钥字符串- Returns:
- RSA私钥
-
loadPrivateKeyFromString
public static PrivateKey loadPrivateKeyFromString(String keyString, String algorithm, String provider) 从字符串中加载指定算法的私钥- Parameters:
keyString
- 私钥字符串algorithm
- 私钥算法provider
- the provider- Returns:
- 私钥
-
loadPublicKeyFromString
从字符串中加载RSA公钥。- Parameters:
keyString
- 公钥字符串- Returns:
- RSA公钥
-
loadPrivateKeyFromPath
从文件路径加载RSA私钥- Parameters:
keyPath
- 私钥路径- Returns:
- RSA私钥
-
loadPrivateKeyFromPath
从文件路径加载指定算法的私钥- Parameters:
keyPath
- 私钥路径algorithm
- 私钥算法provider
- the provider- Returns:
- 私钥
-
loadPublicKeyFromPath
从文件路径加载RSA公钥- Parameters:
keyPath
- 公钥路径- Returns:
- RSA公钥
-
loadX509FromStream
从输入流加载X.509证书- Parameters:
inputStream
- 私钥输入流- Returns:
- X.509证书
-
loadX509FromStream
从输入流加载X.509证书- Parameters:
inputStream
- 私钥输入流provider
- the provider- Returns:
- X.509证书
-
loadX509FromPath
从文件路径加载X.509证书- Parameters:
certificatePath
- 证书文件路径- Returns:
- X.509证书
-
loadX509FromPath
从文件路径加载X.509证书- Parameters:
certificatePath
- 证书文件路径provider
- the provider- Returns:
- X.509证书
-
loadX509FromString
从字符串加载X.509证书- Parameters:
certificateString
- 证书字符串- Returns:
- X.509证书
-
loadX509FromString
从字符串加载X.509证书- Parameters:
certificateString
- 证书字符串provider
- the provider- Returns:
- X.509证书
-
getSerialNumber
-