类 CtrRSACipherGenerator
java.lang.Object
com.obs.services.crypto.CTRCipherGenerator
com.obs.services.crypto.CtrRSACipherGenerator
-
字段概要
字段 -
构造器概要
构造器构造器说明CtrRSACipherGenerator(String masterKeyInfo, boolean needSha256, SecureRandom secureRandom, PrivateKey privateKey, PublicKey publicKey) -
方法概要
修饰符和类型方法说明static voidcheckKeyLength(Key key) static Cipherstatic Stringstatic PrivateKeyimportPKCS8PrivateKey(String filePath) static PublicKeyimportPublicKey(String filename) byte[]RSADecrypted(byte[] cipherInfo) byte[]RSAEncrypted(byte[] plaintext) voidsetPrivateKey(PrivateKey privateKey) voidsetPublicKey(PublicKey publicKey) static voidsetRsaCipherProvider(String rsaCipherProvider) 从类继承的方法 com.obs.services.crypto.CTRCipherGenerator
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, setSha256BufferLen
-
字段详细资料
-
ENCRYPTED_AES_KEY_META_NAME
- 另请参阅:
-
CIPHER_RSA_ALGORITHM
- 另请参阅:
-
KEY_FACTORY_RSA_ALGORITHM
- 另请参阅:
-
ENCRYPTED_ALGORITHM
- 另请参阅:
-
MIN_RSA_KEY_LENGTH
public static final int MIN_RSA_KEY_LENGTH- 另请参阅:
-
-
构造器详细资料
-
CtrRSACipherGenerator
public CtrRSACipherGenerator(String masterKeyInfo, boolean needSha256, SecureRandom secureRandom, PrivateKey privateKey, PublicKey publicKey) throws NoSuchAlgorithmException, InvalidKeySpecException, ObsException
-
-
方法详细资料
-
checkKeyLength
- 抛出:
ObsException
-
importPKCS8PrivateKey
public static PrivateKey importPKCS8PrivateKey(String filePath) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException -
importPublicKey
public static PublicKey importPublicKey(String filename) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException -
RSAEncrypted
public byte[] RSAEncrypted(byte[] plaintext) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, NoSuchProviderException -
RSADecrypted
public byte[] RSADecrypted(byte[] cipherInfo) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, NoSuchProviderException -
getRsaCipher
public static Cipher getRsaCipher() throws NoSuchPaddingException, NoSuchAlgorithmException, NoSuchProviderException -
setPrivateKey
-
setPublicKey
-
getRsaCipherProvider
-
setRsaCipherProvider
-