@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class Cipher extends Object
Constructor and Description |
---|
Cipher(CipherProvider provider) |
Modifier and Type | Method and Description |
---|---|
abstract InputStream |
createDecryptionStream(InputStream in,
Context context,
byte[] iv)
Create a decrypting input stream given a context and IV
|
abstract InputStream |
createDecryptionStream(InputStream in,
Decryptor decryptor)
Create a decrypting output stream given an initialized decryptor
|
abstract OutputStream |
createEncryptionStream(OutputStream out,
Context context,
byte[] iv)
Create an encrypting output stream given a context and IV
|
abstract OutputStream |
createEncryptionStream(OutputStream out,
Encryptor encryptor)
Create an encrypting output stream given an initialized encryptor
|
abstract Decryptor |
getDecryptor()
Return a decryptor for decrypting data.
|
abstract Encryptor |
getEncryptor()
Get an encryptor for encrypting data.
|
abstract int |
getIvLength()
Return the expected initialization vector length, in bytes, or 0 if not applicable
|
abstract int |
getKeyLength()
Return the key length required by this cipher, in bytes
|
abstract String |
getName()
Return this Cipher's name
|
CipherProvider |
getProvider()
Return the provider for this Cipher
|
abstract Key |
getRandomKey()
Create a random symmetric key
|
public Cipher(CipherProvider provider)
public CipherProvider getProvider()
public abstract String getName()
public abstract int getKeyLength()
public abstract int getIvLength()
public abstract Key getRandomKey()
public abstract Encryptor getEncryptor()
public abstract Decryptor getDecryptor()
public abstract OutputStream createEncryptionStream(OutputStream out, Context context, byte[] iv) throws IOException
out
- the output stream to wrapcontext
- the encryption contextiv
- initialization vectorIOException
public abstract OutputStream createEncryptionStream(OutputStream out, Encryptor encryptor) throws IOException
out
- the output stream to wrapencryptor
- the encryptorIOException
public abstract InputStream createDecryptionStream(InputStream in, Context context, byte[] iv) throws IOException
in
- the input stream to wrapcontext
- the encryption contextiv
- initialization vectorIOException
public abstract InputStream createDecryptionStream(InputStream in, Decryptor decryptor) throws IOException
in
- the input stream to wrapdecryptor
- the decryptorIOException
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.