类 CTRCipherGenerator
java.lang.Object
cn.warpin.thirdPart.huawei.obs.obs.services.crypto.CTRCipherGenerator
- 直接已知子类:
CtrRSACipherGenerator
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明protected static final Stringstatic final intstatic final intprivate byte[]private byte[]static final Stringstatic final Stringstatic final Stringstatic final Stringprivate static final ILoggerstatic final Stringprivate Stringprivate booleanstatic final Stringstatic final Stringprivate SecureRandom(专用程序包) static int -
构造器概要
构造器构造器说明CTRCipherGenerator(String masterKeyInfo, byte[] cryptoKeyBytes, boolean needSha256, SecureRandom secureRandom) CTRCipherGenerator(String masterKeyInfo, byte[] cryptoIvBytes, byte[] cryptoKeyBytes, boolean needSha256, SecureRandom secureRandom) -
方法概要
修饰符和类型方法说明computeSHA256HashAES(InputStream plainTextStream, byte[] object_CryptoIvBytes, byte[] object_CryptoKeyBytes, boolean needPlainTextSha256) getAES256DecryptedStream(InputStream ciphertextInput, byte[] object_CryptoIvBytes, byte[] object_CryptoKeyBytes) getAES256EncryptedStream(InputStream plaintextInput, byte[] object_CryptoIvBytes, byte[] object_CryptoKeyBytes) static byte[]getAESEncryptedBytes(byte[] plainText, int plainTextOffset, int plainTextLength, byte[] aesKeyBytes, byte[] aesIvBytes) static StringgetBase64Info(byte[] cryptoInfo) static byte[]getBytesFromBase64(String cryptoInfo) byte[]byte[]static byte[]getFileSha256Bytes(String filePath) byte[]getRandomBytes(int randomBytesLen) byte[]byte[]static intbooleanvoidsetBase64AES256Iv(String cryptoIvBase64) voidsetBase64AES256Key(String cryptoKeyBase64) voidsetCryptoIvBytes(byte[] cryptoIvBytes) voidsetCryptoKeyBytes(byte[] cryptoKeyBytes) voidsetMasterKeyInfo(String masterKeyInfo) voidsetNeedSha256(boolean needSha256) voidsetSecureRandom(SecureRandom secureRandom) static voidsetSha256BufferLen(int sha256BufferLen)
-
字段详细资料
-
ENCRYPTED_ALGORITHM
- 另请参阅:
-
CRYPTO_KEY_BYTES_LEN
public static final int CRYPTO_KEY_BYTES_LEN- 另请参阅:
-
CRYPTO_IV_BYTES_LEN
public static final int CRYPTO_IV_BYTES_LEN- 另请参阅:
-
masterKeyInfo
-
cryptoIvBytes
private byte[] cryptoIvBytes -
cryptoKeyBytes
private byte[] cryptoKeyBytes -
needSha256
private boolean needSha256 -
secureRandom
-
AES_ALGORITHM
- 另请参阅:
-
sha256BufferLen
static int sha256BufferLen -
ENCRYPTED_ALGORITHM_META_NAME
- 另请参阅:
-
ENCRYPTED_START_META_NAME
- 另请参阅:
-
MASTER_KEY_INFO_META_NAME
- 另请参阅:
-
PLAINTEXT_SHA_256_META_NAME
- 另请参阅:
-
PLAINTEXT_CONTENT_LENGTH_META_NAME
- 另请参阅:
-
ENCRYPTED_SHA_256_META_NAME
- 另请参阅:
-
log
-
-
构造器详细资料
-
CTRCipherGenerator
public CTRCipherGenerator(String masterKeyInfo, byte[] cryptoIvBytes, byte[] cryptoKeyBytes, boolean needSha256, SecureRandom secureRandom) -
CTRCipherGenerator
public CTRCipherGenerator(String masterKeyInfo, byte[] cryptoKeyBytes, boolean needSha256, SecureRandom secureRandom)
-
-
方法详细资料
-
getSecureRandom
-
setSecureRandom
-
getMasterKeyInfo
-
setMasterKeyInfo
-
getCryptoIvBytes
public byte[] getCryptoIvBytes() -
getRandomCryptoIvBytes
public byte[] getRandomCryptoIvBytes() -
setCryptoIvBytes
public void setCryptoIvBytes(byte[] cryptoIvBytes) -
getCryptoKeyBytes
public byte[] getCryptoKeyBytes() -
getRandomCryptoKeyBytes
public byte[] getRandomCryptoKeyBytes() -
getRandomBytes
public byte[] getRandomBytes(int randomBytesLen) -
setCryptoKeyBytes
public void setCryptoKeyBytes(byte[] cryptoKeyBytes) -
isNeedSha256
public boolean isNeedSha256() -
setNeedSha256
public void setNeedSha256(boolean needSha256) -
getAES256DecryptedStream
public CipherInputStream getAES256DecryptedStream(InputStream ciphertextInput, byte[] object_CryptoIvBytes, byte[] object_CryptoKeyBytes) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException -
getAES256EncryptedStream
public CipherInputStream getAES256EncryptedStream(InputStream plaintextInput, byte[] object_CryptoIvBytes, byte[] object_CryptoKeyBytes) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException -
getBase64Info
-
getBytesFromBase64
-
getAESEncryptedBytes
public static byte[] getAESEncryptedBytes(byte[] plainText, int plainTextOffset, int plainTextLength, byte[] aesKeyBytes, byte[] aesIvBytes) throws IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, NoSuchPaddingException, NoSuchAlgorithmException -
setBase64AES256Key
public void setBase64AES256Key(String cryptoKeyBase64) throws UnsupportedEncodingException, ObsException -
setBase64AES256Iv
public void setBase64AES256Iv(String cryptoIvBase64) throws UnsupportedEncodingException, ObsException -
getFileSha256Bytes
public static byte[] getFileSha256Bytes(String filePath) throws IOException, NoSuchAlgorithmException -
computeSHA256HashAES
public CTRCipherGenerator.SHA256Info computeSHA256HashAES(InputStream plainTextStream, byte[] object_CryptoIvBytes, byte[] object_CryptoKeyBytes, boolean needPlainTextSha256) throws NoSuchAlgorithmException, IOException, ObsException -
getSha256BufferLen
public static int getSha256BufferLen() -
setSha256BufferLen
public static void setSha256BufferLen(int sha256BufferLen)
-