|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--java.io.FilterOutputStream | +--javax.crypto.CipherOutputStream
Class for en/decrypting data to be written to an output stream.
Attention: This is not a SUN implementation!
This class has been developed by IAIK according to the documentation publically available.
For SUNīs documentation of this class see
http://java.sun.com/security/JCE1.2/spec/apidoc/index.html
This class extends the java.io.FilterOutputStream class for combining the functionality
of a OutputStream and a Cipher.
According to the operation mode the Cipher has been initialized with, data is
en/decrypted before writing it to the underlying stream when calling one of the
write()
methods.
An application may use this class for encrypting and writing data to a file.
OutputStream
,
FilterOutputStream
,
Cipher
,
CipherInputStream
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary | |
CipherOutputStream(OutputStream os)
Creates a CipherOutputStream only from an OutputStream. |
|
CipherOutputStream(OutputStream os,
Cipher cipher)
Creates a CipherOutputStream using an OutputStream and a Cipher initialized either for encryption or decryption. |
Method Summary | |
void |
close()
Calls the cipher for the last time and closes the output stream. |
void |
write(byte[] b)
Writes the bytes from the given byte array to this output stream. |
void |
write(byte[] b,
int off,
int len)
Writes a specified number of bytes from a given position of the given byte array to this output stream. |
void |
write(int b)
Writes a byte to the underlying output stream. |
Methods inherited from class java.io.FilterOutputStream |
flush |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CipherOutputStream(OutputStream os, Cipher cipher)
os
- the output stream.cipher
- an initialized cipher.public CipherOutputStream(OutputStream os)
os
- the output streamMethod Detail |
public void write(int b) throws IOException
write
in class FilterOutputStream
b
- the byte to be written to this streamIOException
- if an I/O error occurspublic void write(byte[] b) throws IOException
write
in class FilterOutputStream
b
- the byte array containing the data to be written to this streamIOException
- if an I/O error occurs.public void write(byte[] b, int off, int len) throws IOException
write
in class FilterOutputStream
b
- the byte array containing the data to be written to this streamoff
- the start offset indicating the position within the given byte array b
from which the data is to be taken for en/decrypting and writing it to the streamlen
- the number of bytes to write this streamIOException
- if an I/O error occurspublic void close() throws IOException
close
in class FilterOutputStream
IOException
- if an I/O error occurs
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |