public class CtrRSACipherGenerator extends CTRCipherGenerator
| 限定符和类型 | 字段和说明 |
|---|---|
protected static String |
CIPHER_RSA_ALGORITHM |
static String |
ENCRYPTED_AES_KEY_META_NAME |
static String |
ENCRYPTED_ALGORITHM |
protected static String |
KEY_FACTORY_RSA_ALGORITHM |
static int |
MIN_RSA_KEY_LENGTH |
| 构造器和说明 |
|---|
CtrRSACipherGenerator(String masterKeyInfo,
boolean needSha256,
SecureRandom secureRandom,
PrivateKey privateKey,
PublicKey publicKey) |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
checkKeyLength(Key key) |
static Cipher |
getRsaCipher() |
static String |
getRsaCipherProvider() |
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) |
static void |
setRsaCipherProvider(String rsaCipherProvider) |
computeSHA256HashAES, getAES256DecryptedStream, getAES256EncryptedStream, getAesCipher, getAesCipherProvider, getAESEncryptedBytes, getBase64Info, getBytesFromBase64, getCryptoIvBytes, getCryptoKeyBytes, getFileSha256Bytes, getMasterKeyInfo, getRandomBytes, getRandomCryptoIvBytes, getRandomCryptoKeyBytes, getSecureRandom, getSha256BufferLen, isNeedSha256, setAesCipherProvider, setBase64AES256Iv, setBase64AES256Key, setCryptoIvBytes, setCryptoKeyBytes, setMasterKeyInfo, setNeedSha256, setSecureRandom, setSha256BufferLenpublic static final int MIN_RSA_KEY_LENGTH
public CtrRSACipherGenerator(String masterKeyInfo, boolean needSha256, SecureRandom secureRandom, PrivateKey privateKey, PublicKey publicKey) throws NoSuchAlgorithmException, InvalidKeySpecException, ObsException
public static void checkKeyLength(Key key) throws ObsException
ObsExceptionpublic 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,
NoSuchProviderException
public byte[] RSADecrypted(byte[] cipherInfo)
throws NoSuchPaddingException,
NoSuchAlgorithmException,
InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException,
NoSuchProviderException
public static Cipher getRsaCipher() throws NoSuchPaddingException, NoSuchAlgorithmException, NoSuchProviderException
public void setPrivateKey(PrivateKey privateKey)
public void setPublicKey(PublicKey publicKey)
public static String getRsaCipherProvider()
public static void setRsaCipherProvider(String rsaCipherProvider)
Copyright © 2024. All rights reserved.