public class CtrRSACipherGenerator extends CTRCipherGenerator
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ENCRYPTED_AES_KEY_META_NAME |
static String |
ENCRYPTED_ALGORITHM |
protected static String |
RSA_ALGORITHM |
| 构造器和说明 |
|---|
CtrRSACipherGenerator(String masterKeyInfo,
boolean needSha256,
SecureRandom secureRandom,
PrivateKey privateKey,
PublicKey publicKey) |
| 限定符和类型 | 方法和说明 |
|---|---|
static PrivateKey |
importPKCS8PrivateKey(String filePath) |
static PublicKey |
importPublicKey(String filename) |
byte[] |
RSADecrypted(byte[] cipherInfo) |
byte[] |
RSAEncrypted(byte[] plaintext) |
void |
setPrivateKey(PrivateKey privateKey) |
void |
setPublicKey(PublicKey publicKey) |
computeSHA256HashAES, getAES256DecryptedStream, getAES256EncryptedStream, getAESEncryptedBytes, getBase64Info, getBytesFromBase64, getCryptoIvBytes, getCryptoKeyBytes, getFileSha256Bytes, getMasterKeyInfo, getRandomBytes, getRandomCryptoIvBytes, getRandomCryptoKeyBytes, getSecureRandom, getSha256BufferLen, isNeedSha256, setBase64AES256Iv, setBase64AES256Key, setCryptoIvBytes, setCryptoKeyBytes, setMasterKeyInfo, setNeedSha256, setSecureRandom, setSha256BufferLenpublic CtrRSACipherGenerator(String masterKeyInfo, boolean needSha256, SecureRandom secureRandom, PrivateKey privateKey, PublicKey publicKey) throws NoSuchAlgorithmException, InvalidKeySpecException
public static PrivateKey importPKCS8PrivateKey(String filePath) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException
public static PublicKey importPublicKey(String filename) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException
public byte[] RSAEncrypted(byte[] plaintext)
throws NoSuchPaddingException,
NoSuchAlgorithmException,
InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
public byte[] RSADecrypted(byte[] cipherInfo)
throws NoSuchPaddingException,
NoSuchAlgorithmException,
InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
public void setPrivateKey(PrivateKey privateKey)
public void setPublicKey(PublicKey publicKey)
Copyright © 2023. All rights reserved.