|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectissrg.SAWS.LogFileWriter
Field Summary | |
byte[] |
accumulatedHash
|
int |
currentRecordWriteCount
|
byte[] |
finalSignature
|
Constructor Summary | |
LogFileWriter()
This method is the constructor of LogFileWriter. |
|
LogFileWriter(java.lang.String root,
java.lang.String cLogFilename,
java.security.PublicKey vt,
java.security.PublicKey sawsEncPK,
java.security.PrivateKey sawsSignPIK,
byte[] ba,
java.lang.String sAlgName,
byte[] secureBytes,
java.util.Map UserIDPKMap)
This method is the constructor of LogFileWriter. |
Method Summary | |
void |
createLastFileRecord(java.lang.String lastFilename,
byte[] lastAccHash,
byte[] lastSignature)
This method is to generate the record body of a last log file record. |
void |
createSAWSRecord(byte[] messageBlock,
byte recordType,
byte encryptionFlag)
This method is to create a SAWS Record . |
void |
createSAWSRecord(byte[] messageBlock,
byte recordType,
byte userID,
byte encryptionFlag)
This method is to create a SAWS Record . |
void |
createSAWSRecord(byte[] messageBlock,
byte recordType,
byte userID,
byte encryptionFlag,
java.security.PublicKey encryptionPublicKey)
This method is to create a SAWS Record . |
void |
finalizeLogFile()
This method is called to finalize the log file, i.e. write the accumulated hash and the signature to the log file. |
byte[] |
getAccHash()
This method is to get the final accumualted hash |
int |
getCurrentRecordWriteCount()
This method is to get the current writing record number in the current log file |
byte[] |
getSignature()
This method is to get the final signature |
int |
prepareNewLog()
This method creates a new log file, prepares this file for adding new log records to it in the future. |
int |
repairLog(java.lang.String logRoot,
java.lang.String logFilename,
byte[] secureRandomB,
logReadingException e)
This method is to repair a log file. |
void |
setDebugLevel(int debugLevel)
|
void |
writeSignatureRecord()
This method is called to write a signature record to the log file after initialisation is finished. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int currentRecordWriteCount
public byte[] accumulatedHash
public byte[] finalSignature
Constructor Detail |
public LogFileWriter()
public LogFileWriter(java.lang.String root, java.lang.String cLogFilename, java.security.PublicKey vt, java.security.PublicKey sawsEncPK, java.security.PrivateKey sawsSignPIK, byte[] ba, java.lang.String sAlgName, byte[] secureBytes, java.util.Map UserIDPKMap)
root
- String is the log rootcLogFilename
- is the log file name to be writtenvt
- is the SAWS VT public keysawsEncPK
- is the SAWS encryption public keysawsSignPIK
- is the SAWS signing private keyba
- is the binary array of the SAWS signing public key certificate to be written into
the log filesAlgName
- is the signing algorithem namesecureBytes
- is the secure random number used for secure hashingMethod Detail |
public void setDebugLevel(int debugLevel)
public byte[] getSignature()
public byte[] getAccHash()
public int getCurrentRecordWriteCount()
public int prepareNewLog()
public void createLastFileRecord(java.lang.String lastFilename, byte[] lastAccHash, byte[] lastSignature)
lastFilename
- the file name of the previous log filelastAccHash
- the accumulated hash of the previous log filelastSignature
- the signature of the previous log file
public void createSAWSRecord(byte[] messageBlock, byte recordType, byte encryptionFlag)
public void createSAWSRecord(byte[] messageBlock, byte recordType, byte userID, byte encryptionFlag)
public void createSAWSRecord(byte[] messageBlock, byte recordType, byte userID, byte encryptionFlag, java.security.PublicKey encryptionPublicKey)
messageBlock
- log data block (here it is the secret random number to be wrapped into a record.recordType
- record typeuserID
- user IDencryptionFlag
- encryption flag to indicate the encryption requirement.encryptionPublicKey
- the encryption public key used for assymmetric encryption.
This could be the VT enc public key, or the SAWS enc public key
public int repairLog(java.lang.String logRoot, java.lang.String logFilename, byte[] secureRandomB, logReadingException e)
logRoot
- the log rootlogFilename
- the log filename to be repaired.secureRandomB
- byte[] is the secure random bytes for this log file
public void finalizeLogFile()
public void writeSignatureRecord()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |