public class OpensslKeyUtil extends Object
| Constructor and Description |
|---|
OpensslKeyUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.bouncycastle.openssl.PEMKeyPair |
decrypt(org.bouncycastle.openssl.PEMEncryptedKeyPair pemEncryptedKeyPair,
char[] password)
解密
PEMEncryptedKeyPair为PEMKeyPair |
static org.bouncycastle.asn1.pkcs.PrivateKeyInfo |
decrypt(org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo pkcs8Info,
char[] password)
解密
PKCS8EncryptedPrivateKeyInfo为PrivateKeyInfo |
static KeyPair |
getKeyPair(org.bouncycastle.openssl.PEMKeyPair keyPair)
转换
PEMKeyPair为KeyPair |
static PrivateKey |
getPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo)
转换
PrivateKeyInfo为PrivateKey |
static PublicKey |
getPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo)
转换
SubjectPublicKeyInfo为PublicKey |
static Key |
readPemKey(InputStream keyStream,
char[] password)
|
static KeyPair |
readPemKeyPair(InputStream keyStream,
char[] password)
|
public static PrivateKey getPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privateKeyInfo) throws CryptoException
PrivateKeyInfo为PrivateKeyprivateKeyInfo - PrivateKeyInfoPrivateKeyCryptoException - PEMException包装public static PublicKey getPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo) throws CryptoException
SubjectPublicKeyInfo为PublicKeypublicKeyInfo - SubjectPublicKeyInfoPublicKeyCryptoException - PEMException包装public static KeyPair getKeyPair(org.bouncycastle.openssl.PEMKeyPair keyPair) throws CryptoException
PEMKeyPair为KeyPairkeyPair - PEMKeyPairKeyPairCryptoException - PEMException包装public static org.bouncycastle.asn1.pkcs.PrivateKeyInfo decrypt(org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo pkcs8Info,
char[] password)
throws CryptoException
PKCS8EncryptedPrivateKeyInfo为PrivateKeyInfopkcs8Info - PKCS8EncryptedPrivateKeyInfopassword - 密码PrivateKeyInfoCryptoException - OperatorCreationException和PKCSException包装public static org.bouncycastle.openssl.PEMKeyPair decrypt(org.bouncycastle.openssl.PEMEncryptedKeyPair pemEncryptedKeyPair,
char[] password)
throws IORuntimeException
PEMEncryptedKeyPair为PEMKeyPairpemEncryptedKeyPair - PKCS8EncryptedPrivateKeyInfopassword - 密码PEMKeyPairIORuntimeException - IOException包装public static Key readPemKey(InputStream keyStream, char[] password)
keyStream - pem 流password - 私钥密码Key,null 表示无法识别的密钥类型public static KeyPair readPemKeyPair(InputStream keyStream, char[] password)
keyStream - pem 流password - 私钥密码Key,null 表示无法识别的密钥类型Copyright © 2025. All rights reserved.