@InterfaceAudience.Private @InterfaceStability.Evolving public class AES extends Cipher
Algorithm instances are pooled for reuse, so the cipher provider and mode are configurable but fixed at instantiation.
限定符和类型 | 字段和说明 |
---|---|
static String |
CIPHER_MODE_KEY |
static String |
CIPHER_PROVIDER_KEY |
BLOCK_SIZE, IV_LENGTH, KEY_LENGTH, KEY_LENGTH_BITS, RNG_ALGORITHM_KEY, RNG_PROVIDER_KEY
构造器和说明 |
---|
AES(CipherProvider provider) |
限定符和类型 | 方法和说明 |
---|---|
InputStream |
createDecryptionStream(InputStream in,
Context context,
byte[] iv)
Create a decrypting input stream given a context and IV
|
InputStream |
createDecryptionStream(InputStream in,
Decryptor d)
Create a decrypting output stream given an initialized decryptor
|
OutputStream |
createEncryptionStream(OutputStream out,
Context context,
byte[] iv)
Create an encrypting output stream given a context and IV
|
OutputStream |
createEncryptionStream(OutputStream out,
Encryptor e)
Create an encrypting output stream given an initialized encryptor
|
Decryptor |
getDecryptor()
Return a decryptor for decrypting data.
|
Encryptor |
getEncryptor()
Get an encryptor for encrypting data.
|
int |
getIvLength()
Return the expected initialization vector length, in bytes, or 0 if not applicable
|
int |
getKeyLength()
Return the key length required by this cipher, in bytes
|
String |
getName()
Return this Cipher's name
|
Key |
getRandomKey()
Create a random symmetric key
|
getProvider
public AES(CipherProvider provider)
public int getKeyLength()
Cipher
getKeyLength
在类中 Cipher
public int getIvLength()
Cipher
getIvLength
在类中 Cipher
public Key getRandomKey()
Cipher
getRandomKey
在类中 Cipher
public Encryptor getEncryptor()
Cipher
getEncryptor
在类中 Cipher
public Decryptor getDecryptor()
Cipher
getDecryptor
在类中 Cipher
public OutputStream createEncryptionStream(OutputStream out, Context context, byte[] iv) throws IOException
Cipher
createEncryptionStream
在类中 Cipher
out
- the output stream to wrapcontext
- the encryption contextiv
- initialization vectorIOException
public OutputStream createEncryptionStream(OutputStream out, Encryptor e) throws IOException
Cipher
createEncryptionStream
在类中 Cipher
out
- the output stream to wrape
- the encryptorIOException
public InputStream createDecryptionStream(InputStream in, Context context, byte[] iv) throws IOException
Cipher
createDecryptionStream
在类中 Cipher
in
- the input stream to wrapcontext
- the encryption contextiv
- initialization vectorIOException
public InputStream createDecryptionStream(InputStream in, Decryptor d) throws IOException
Cipher
createDecryptionStream
在类中 Cipher
in
- the input stream to wrapd
- the decryptorIOException
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.