public interface AsymmetricKeyCodec extends AsymmetricCodec
| 限定符和类型 | 方法和说明 |
|---|---|
int |
defaultKeySize() |
default AlgorithmParameterSpec |
getAlgorithmParameterSpec() |
default byte[] |
getPKCS8FromPrivateKey(PrivateKey privateKey) |
default byte[] |
getPrivateKey(KeyPair keyPair)
keyPair : 获取私钥
|
default PrivateKey |
getPrivateKeyFromPKCS8(byte[] privateKey)
获取pkcs#8格式 私钥 - 私钥没有密码
|
default PrivateKey |
getPrivateKeyFromPKCS8(byte[] privateKey,
char[] keyPassword)
根据带有密码的私钥进行解密
|
default PrivateKey |
getPrivateKeyFromPKCS8(byte[] privateKey,
String keyPass)
获取pkcs#8格式 私钥 - 私钥有密码
|
default byte[] |
getPublicKey(KeyPair keyPair)
keyPair : 获取公钥
|
default byte[] |
getX509FromPublicKey(PublicKey x509Key) |
default PublicKey |
getX509PublicKey(byte[] publicKey)
获取x509格式公钥
|
default KeyPair |
keyPair() |
default KeyPair |
keyPair(int keySize) |
alg, decrypt, encrypt, keyAlg, keyCodec, provider, signAlg, signatureCodecint defaultKeySize()
default AlgorithmParameterSpec getAlgorithmParameterSpec()
default KeyPair keyPair() throws NoSuchProviderException, NoSuchAlgorithmException
default KeyPair keyPair(int keySize) throws NoSuchProviderException, NoSuchAlgorithmException
default byte[] getPublicKey(KeyPair keyPair)
keyPair - default byte[] getPrivateKey(KeyPair keyPair)
keyPair - default PublicKey getX509PublicKey(byte[] publicKey) throws NoSuchProviderException, NoSuchAlgorithmException, InvalidKeySpecException
default PrivateKey getPrivateKeyFromPKCS8(byte[] privateKey) throws NoSuchProviderException, NoSuchAlgorithmException, InvalidKeySpecException
default PrivateKey getPrivateKeyFromPKCS8(byte[] privateKey, String keyPass) throws Exception
Exceptiondefault PrivateKey getPrivateKeyFromPKCS8(byte[] privateKey, char[] keyPassword) throws Exception
privateKey - : 带有密码的私钥keyPassword - : 私钥密码Exceptiondefault byte[] getX509FromPublicKey(PublicKey x509Key) throws NoSuchProviderException, NoSuchAlgorithmException, InvalidKeySpecException
default byte[] getPKCS8FromPrivateKey(PrivateKey privateKey) throws IOException
IOExceptionCopyright © 2023 Pivotal Software, Inc.. All rights reserved.