rice.post.log
Class EncryptedLog
java.lang.Object
rice.post.log.Log
rice.post.log.EncryptedLog
-
All Implemented Interfaces:
- java.io.Serializable, PostData
-
Direct Known Subclasses:
- CoalescedLog
-
public class EncryptedLog
- extends Log
Class which represents an encrypted log in the POST system. This
class is designed so that applications can simply use this as the
log head, instead of the Log class, and the contents of the log will
automatically be encrypted (using a randomly-generated DES key).
- Version:
- $Id: EncryptedLog.java 3201 2006-04-14 13:55:54Z jstewart $
- See Also:
- Serialized Form
Field Summary |
protected byte[] |
cipherKey
|
protected byte[] |
key
|
Fields inherited from class rice.post.log.Log |
buffer, children, childrenCache, location, logger, N_TOP_ENTRIES, name, post, topEntry, topEntryReference, topEntryReferences |
Constructor Summary |
EncryptedLog(java.lang.Object name,
Id location,
Post post,
java.security.KeyPair keyPair)
Constructs a Log for use in POST |
EncryptedLog(java.lang.Object name,
Id location,
Post post,
java.security.KeyPair keyPair,
byte[] cipherKey)
|
Method Summary |
void |
addLogEntry(LogEntry entry,
Continuation command)
This method appends an entry into the user's log, and updates the pointer
to the top of the log to reflect the new object. |
void |
getTopEntry(Continuation command)
This method returns a reference to the most recent entry in the log,
which can then be used to walk down the log. |
void |
setKeyPair(java.security.KeyPair keyPair)
Sets the local key pair, which allows this log to begin reading it's log entries |
java.lang.String |
toString()
|
Methods inherited from class rice.post.log.Log |
addChildLog, buildContentHashReference, buildSecureReference, buildSignedReference, cache, getChildLog, getChildLogNames, getLocation, getLogEntryReferences, getName, getRealTopEntry, getTopEntryReference, removeChildLog, setName, setPost, sync |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
key
protected transient byte[] key
cipherKey
protected transient byte[] cipherKey
EncryptedLog
public EncryptedLog(java.lang.Object name,
Id location,
Post post,
java.security.KeyPair keyPair)
- Constructs a Log for use in POST
- Parameters:
-
name
- Some unique identifier for this log-
location
- The location of this log in PAST
EncryptedLog
public EncryptedLog(java.lang.Object name,
Id location,
Post post,
java.security.KeyPair keyPair,
byte[] cipherKey)
setKeyPair
public void setKeyPair(java.security.KeyPair keyPair)
- Sets the local key pair, which allows this log to begin reading it's log entries
-
- Parameters:
-
keyPair
- The keypair used to decrypt this log's key
addLogEntry
public void addLogEntry(LogEntry entry,
Continuation command)
- This method appends an entry into the user's log, and updates the pointer
to the top of the log to reflect the new object. This method returns a
LogEntryReference which is a pointer to the LogEntry in PAST. Note that
this method reinserts this Log into PAST in order to reflect the addition.
Once this method is finished, it will call the command.receiveResult()
method with a LogEntryReference for the new entry, or it may call
receiveExcception if an exception occurred.
-
- Overrides:
-
addLogEntry
in class Log
-
- Parameters:
-
entry
- The log entry to append to the log.-
command
- The command to run once done
getTopEntry
public void getTopEntry(Continuation command)
- This method returns a reference to the most recent entry in the log,
which can then be used to walk down the log.
-
- Overrides:
-
getTopEntry
in class Log
-
toString
public java.lang.String toString()
-
- Overrides:
-
toString
in class Log
-
Copyright © 2001-2005 - Rice Pastry.