|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.Encoded
public class Encoded
Encoded encapsulates a serializable object in an encrypted format that requires the same synchronous key for both, encoding and decoding. The key itself is not stored with the object, but a signature identifying the key.
Instances of this class can be used to conveniently send objects over untrusted network connections.
This class just exist for convenience; it has many security flaws for any serious application (even though being so simple). For starters: as the embedded byte array is already known to contain a serialized object, an intelligent attack on the key algorithm can make many useful assumptions based on the fact that the right decryption must lead to a byte array denoting a serialized Java object.
SynchronousKey,
SealedObject,
Serialized Form| Constructor Summary | |
|---|---|
Encoded(Object sourceObject,
SynchronousKey key)
stores the encryped bytes of the given objects (using the key) and the signature of the given key (not the key itself) |
|
| Method Summary | |
|---|---|
Object |
decode(SynchronousKey key)
decodes the embedded encrypted object given the right key |
boolean |
equals(Object obj)
|
int |
hashCode()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Encoded(Object sourceObject,
SynchronousKey key)
throws IOException,
GeneralSecurityException
sourceObject - must be serializable
IOException
GeneralSecurityExceptionSynchronousKey.getKeySignature()| Method Detail |
|---|
public Object decode(SynchronousKey key)
throws IOException,
ClassNotFoundException,
GeneralSecurityException
IOException - if the object could not be deserialized, which may
also be a result of the wrong key
ClassNotFoundException
GeneralSecurityExceptionpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||