|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
AMETAS.cipher.CipherInputStream
Strom zur Ver- und Entschlüsselung beim Einlesen. In der Regel wird dieser Strom im Entschlüsselungsmodus verwendet, um eintreffende Daten zu entschlüsseln. Dieser Datenstrom kann einfach in eine Stromkette zwischengeschaltet werden und auch außerhalb AMETAS Einsatz finden.
Beispiel:
symCipher = SymmetricCipher.getInstance("AMETASSC");
symCipher.setKey(sMantra);
ois = new ObjectInputStream(new CipherInputStream(cryptedInputStream, symCipher));
| Field Summary | |
static int |
DECRYPTION_MODE
Entschlüsselungsmodus. |
static int |
ENCRYPTION_MODE
Verschlüsselungsmodus. |
protected byte[] |
m_abyBuffer
Puffer, der zur Speicherung von ver- oder entschlüsselten Daten dient. |
protected byte[] |
m_abyEncryptionBuffer
Puffer für die Verschlüsselung. |
boolean |
m_bDebug
Wenn true, werden Detailmeldungen ausgegeben. |
protected Cipher |
m_CipherAlg
Instanz eines symmetrischen Verschlüsselungsalgorithmus. |
protected int |
m_nBufferPointer
Zeiger auf die Stelle im Puffer. |
protected int |
m_nMode
Modus. |
static int |
NEUTRAL_MODE
Neutraler Modus. |
| Constructor Summary | |
CipherInputStream(java.io.InputStream isIn,
Cipher cipher)
Konstruktor. |
|
CipherInputStream(java.io.InputStream isIn,
Cipher cipher,
int nMode)
Konstruktor. |
|
| Method Summary | |
int |
available()
Liefert die Anzahl der Bytes, die ohne Blockierung aus dem Strom gelesen werden können. |
void |
close()
Schließt den Strom. |
void |
mark(int readlimit)
Setzt eine Marke. |
boolean |
markSupported()
Gibt an, ob dieser Strom Marken unterstützt. |
int |
read()
Liefert ein Byte aus dem Strom. |
int |
read(byte[] b)
Liest maximal b.length viele Bytes in das Feld. |
int |
read(byte[] b,
int off,
int len)
Liest maximal len viele Bytes in das Feld ab der Position off. |
void |
reset()
Führt einen Reset auf dem InputStream aus. |
long |
skip(long lSkipBytes)
Überspringt maximal lSkipBytes Bytes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Cipher m_CipherAlg
protected byte[] m_abyBuffer
public static final int ENCRYPTION_MODE
public static final int DECRYPTION_MODE
public static final int NEUTRAL_MODE
protected int m_nMode
protected int m_nBufferPointer
protected byte[] m_abyEncryptionBuffer
public boolean m_bDebug
| Constructor Detail |
public CipherInputStream(java.io.InputStream isIn,
Cipher cipher)
throws java.io.IOException
DECRYPTION_MODE
initialisiert.
isIn - Eigentlicher InputStream, mit dem gearbeitet wird.cipher - Symmetrischer Verschlüsselungsalgorithmus.
java.io.IOException - bei Lesefehlern im unterliegenden Strom oder
Ver-/Entschlüsselungsproblemen.
public CipherInputStream(java.io.InputStream isIn,
Cipher cipher,
int nMode)
throws java.io.IOException
isIn - Eigentlicher InputStream, mit dem gearbeitet wird.cipher - Symmetrischer Verschlüsselungsalgorithmus.nMode - Modus, der folgende Werte annehmen darf:
ENCRYPTION_MODE,
DECRYPTION_MODE oder
NEUTRAL_MODE.
java.io.IOException - bei Lesefehlern im unterliegenden Strom oder
Ver-/Entschlüsselungsproblemen.| Method Detail |
public int read()
throws java.io.IOException
java.io.IOException - bei Leseproblemen oder Ver-/Entschlüsselungsproblemen.
public int read(byte[] b)
throws java.io.IOException
java.io.IOException - bei Leseproblemen oder Ver-/Entschlüsselungsproblemen.
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
java.io.IOException - bei Leseproblemen oder Ver-/Entschlüsselungsproblemen.
public long skip(long lSkipBytes)
throws java.io.IOException
java.io.IOException - bei Leseproblemen oder Ver-/Entschlüsselungsproblemen.
public int available()
throws java.io.IOException
java.io.IOException - bei Leseproblemen oder Ver-/Entschlüsselungsproblemen.
public void close()
throws java.io.IOException
java.io.IOException - wenn das Schließen des Original-Stroms zu einem Fehler führte.public void mark(int readlimit)
public void reset()
throws java.io.IOException
java.io.IOException - wenn das Rücksetzen des Original-Stroms zu einem Fehler führte.public boolean markSupported()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||