ostore.mac
Class MacHandler
java.lang.Object
|
+--ostore.mac.MacHandler
- All Implemented Interfaces:
- EventHandlerIF, ProfilableIF
- Direct Known Subclasses:
- HMACDHHandler, StubHandler
- public abstract class MacHandler
- extends Object
- implements EventHandlerIF, ProfilableIF
MacHandler. Responsible for checking message authenticity and
initializing 'first contact' with another OceanStore instance. The result
being
(1) a MAC relationship established between both parties,
(2) a GUID exchange, and
(3) the source of your machine's GUID.
Additional details are implementation specific.
Note:There is to be only one MacHandler per instance of sandstorm.
Field Summary |
static boolean |
DEBUG
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
public static final boolean DEBUG
MacHandler
public MacHandler()
handleEvent
public abstract void handleEvent(QueueElementIF item)
throws EventHandlerException
- Specified by:
handleEvent
in interface EventHandlerIF
handleEvents
public void handleEvents(QueueElementIF[] item)
throws EventHandlerException
- Specified by:
handleEvents
in interface EventHandlerIF
idString
public abstract String idString()
- Id String
myGuid
public abstract SecureHash myGuid()
- My GUID
establish
public abstract void establish(SecureHash guid)
- Establish a connection between the guid and this instance of sandstorm
Once a connection is established, the MacHandler will broadcast
a MacHandler.KeyEstablished
announcement. If a connection is pending
this will be ignored. If a connection to this guid is already
established, a MacHandler.KeyEstablished
will be broadcasted.
authenticate
public abstract boolean authenticate(QuickSerializable user_data,
QSByteArray mac,
SecureHash guid)
throws MacHandler.GuidNotEstablished
- Returns:
true
iff this message is authentic, i.e.
verified by the internal MAC
doMAC
public abstract QSByteArray doMAC(QuickSerializable user_data,
SecureHash guid)
throws MacHandler.GuidNotEstablished
- Computes the MAC code for the this message
- Returns:
true
iff the MAC was computed successfully.
init
public abstract void init(ConfigDataIF config)
throws Exception
- Specified by:
init
in interface EventHandlerIF
destroy
public abstract void destroy()
throws Exception
- Specified by:
destroy
in interface EventHandlerIF
profileSize
public abstract int profileSize()
- Specified by:
profileSize
in interface ProfilableIF