|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.SAWS.LogFileReader
public class LogFileReader
This is the log file reading class
Constructor Summary | |
---|---|
LogFileReader(int debugLevel)
This method is the constructor of LogFileReader. |
|
LogFileReader(int debugLevel,
byte userID)
|
|
LogFileReader(int debugLevel,
byte userID,
javax.security.auth.callback.CallbackHandler ch)
|
|
LogFileReader(int debugLevel,
javax.security.auth.callback.CallbackHandler ch)
|
Method Summary | |
---|---|
byte[] |
ADecryptRecordBodyByPrivateKey(byte[] body,
java.security.PrivateKey privateKey)
This method is to asymmetric-decrypt a Record block |
int |
checkLogFile()
|
int |
checkLogFile(byte[] secureRandomBytes)
This method is for checking a log file. |
int |
checkSignature(java.security.PublicKey sawsCAPublicKey)
This method is to verify the signature of the log file |
java.lang.String |
findPreviousLogfileName(byte[] secureRandomBytes)
This method is to find the previous log file name stored in this log file. |
byte[] |
getAccumulatedHash(java.io.File CurrentLogFile)
This method is to read the AccumulatedHash (byte[]) from the log file |
java.lang.String |
getAccumulatedHashAlgorithm(java.io.File CurrentLogFile)
This method is to read the hash algorithm from the log file |
byte[] |
getAccumulatedHashByCalc()
This method is to return accumulated hash got by calculation during verification. |
byte[] |
getAccumulatedHashFromLog()
This method is to return accumulated hash stored in the log file |
java.lang.String |
getAllCheckingResult()
|
java.security.cert.Certificate |
getCert(java.io.File CurrentLogFile)
This method is to return the SAWS certificate stored in the log file. |
java.security.cert.Certificate |
getCertFromLog()
This method is to return the certificate in the log file |
int |
getCurrentSN()
This method is to return the current SN |
byte |
getEncryptionFlagFromRecordHeader(byte[] recordHeader)
This method is to get encryption flag from a Record header. |
byte[] |
getHeaderSignature(java.io.File CurrentLogFile)
This method is to read the signature of the log file's header (byte[]) from the log file. |
int |
getLastRecordLengthFromRecordHeader(byte[] recordHeader)
This method is to get LastRecordLength from a Record header. |
byte[] |
getLogFileSignature(java.io.File CurrentLogFile)
This method is to read the signature of the complete log (byte[]) from the log file |
LogRecordInfo |
getOneRecordInfoFromRAF(java.io.RandomAccessFile raf1,
byte[] secureRandomBytes)
This method is to read one complete log record from a RAF. |
java.lang.String |
getPreviousLogfileName()
|
java.util.Vector |
getRecordBlockList()
|
byte |
getRecordTypeFromRecordHeader(byte[] recordHeader)
This method is to get record type from a Record header. |
byte[] |
getSecureRandomNumber(java.security.PrivateKey privateKey)
This method is to read the secure random number from the log file with the given private key. |
byte[] |
getSignatureFromLog()
This method is to return signature from the log file |
java.lang.String |
getSigningAlgorithm(java.io.File CurrentLogFile)
This method is to read the signing algorithm from the log file. |
java.lang.String |
getSigningAlgorithmFromLog()
This method returns the signing algorithm from the log file. |
int |
getSNFromRecordHeader(byte[] recordHeader)
This method is to get SN from a Record header. |
javax.crypto.SecretKey |
getSymmetricKey()
|
byte[] |
getSymmetricKey(java.io.File CurrentLogFile,
java.security.PrivateKey privateKey)
This method is to read the symmetric key (byte[]) from the log file with the given private key. |
int |
getThisRecordLengthFromRecordHeader(byte[] recordHeader)
This method is to get this record length from a Record header. |
long |
getTimestampFromRecordHeader(byte[] recordHeader)
This method is to get timestamp from a Record header. |
byte |
getUserIDFromRecordHeader(byte[] recordHeader)
This method is to get the user ID from a Record header. |
java.lang.String |
getXMLClientLogData(byte[] secureRandomBytes)
|
java.lang.String |
readOneRecordFromRAF(java.io.RandomAccessFile raf1)
This method is to read one complete log record from a RAF. |
java.lang.String |
readOneRecordFromRAF(java.io.RandomAccessFile raf1,
byte[] secureRandomBytes)
This method is to read one complete log record from a RAF. |
byte[] |
readRecordBodyFromRAF(java.io.RandomAccessFile raf,
int offset,
int len)
This method is to read a Record block (only body): log message . |
byte[] |
readRecordHashFromRAF(java.io.RandomAccessFile raf)
This method is to read a Record Hash: 20 bytes |
byte[] |
readRecordHeaderFromRAF(java.io.RandomAccessFile raf1)
This method is to read a Record header from a random access file. |
void |
resetAccMD()
This method is to reset the MessageDigest for accumulated hash computation. |
byte[] |
SDecryptRecordBody(byte[] body)
This method is to symmetric-decrypt a Record block: log message . |
void |
setCallbackHandler(javax.security.auth.callback.CallbackHandler ch)
Method that sets the callback handler for the class. |
void |
setLogFilename(java.lang.String logRoot,
java.lang.String logFilename)
This method is to initialise the MessageDigest for accumulated hash computation. |
void |
setSAWSPrivateKey(java.security.PrivateKey pk)
This method is to set saws private key. |
void |
setUserPrivateKey(java.security.PrivateKey pk)
This method is to set VT private key. |
void |
shiftRAFPointer(java.io.RandomAccessFile raf,
int offset)
This method is to move the RAF pointer by a distance of len |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogFileReader(int debugLevel)
public LogFileReader(int debugLevel, byte userID)
public LogFileReader(int debugLevel, javax.security.auth.callback.CallbackHandler ch)
public LogFileReader(int debugLevel, byte userID, javax.security.auth.callback.CallbackHandler ch)
Method Detail |
---|
public java.util.Vector getRecordBlockList()
public java.lang.String getAllCheckingResult()
public java.lang.String getPreviousLogfileName()
public void setCallbackHandler(javax.security.auth.callback.CallbackHandler ch)
ch
- The callback handler.public void setLogFilename(java.lang.String logRoot, java.lang.String logFilename) throws logReadingException
null
-
logReadingException
public void resetAccMD()
public byte[] ADecryptRecordBodyByPrivateKey(byte[] body, java.security.PrivateKey privateKey) throws logReadingException
body
- is the log record blockprivateKey
- is the private key
logReadingException
public byte[] SDecryptRecordBody(byte[] body)
body
- is the encrypted log record block with the symmetric key
public byte[] readRecordBodyFromRAF(java.io.RandomAccessFile raf, int offset, int len) throws logReadingException
raf
- is the random access file to be readoffset
- is offsetlen
- is the length to be read
logReadingException
public void shiftRAFPointer(java.io.RandomAccessFile raf, int offset)
raf
- is the RAF fileoffset
- is the offsetpublic byte[] readRecordHashFromRAF(java.io.RandomAccessFile raf) throws logReadingException
raf
- is the random access file
logReadingException
public int getSNFromRecordHeader(byte[] recordHeader)
recordHeader
- record header
public byte getRecordTypeFromRecordHeader(byte[] recordHeader)
recordHeader
- record header
public byte getUserIDFromRecordHeader(byte[] recordHeader)
recordHeader
- record header
public byte getEncryptionFlagFromRecordHeader(byte[] recordHeader)
recordHeader
- record header
public long getTimestampFromRecordHeader(byte[] recordHeader)
recordHeader
- record header
public int getLastRecordLengthFromRecordHeader(byte[] recordHeader)
recordHeader
- record header
public int getThisRecordLengthFromRecordHeader(byte[] recordHeader)
recordHeader
- record header
public java.lang.String readOneRecordFromRAF(java.io.RandomAccessFile raf1) throws logReadingException
raf1
- is the RAF file
logReadingException
public java.lang.String readOneRecordFromRAF(java.io.RandomAccessFile raf1, byte[] secureRandomBytes) throws logReadingException
raf1
- is the RAF filesecureRandomBytes
- is the secure number used for secure hash
logReadingException
public byte[] readRecordHeaderFromRAF(java.io.RandomAccessFile raf1) throws logReadingException
raf1
- is the RAF file
logReadingException
public void setUserPrivateKey(java.security.PrivateKey pk)
pk
- is the VT private keypublic void setSAWSPrivateKey(java.security.PrivateKey pk)
pk
- is the saws private keypublic byte[] getAccumulatedHashByCalc()
public byte[] getAccumulatedHashFromLog()
public byte[] getSignatureFromLog()
public java.lang.String getSigningAlgorithmFromLog()
public java.security.cert.Certificate getCertFromLog()
public int checkSignature(java.security.PublicKey sawsCAPublicKey) throws logReadingException
sawsCAPublicKey
- is the saws public key.
logReadingException
public int checkLogFile() throws logReadingException
logReadingException
public int checkLogFile(byte[] secureRandomBytes) throws logReadingException
logFile
- is File to be checked.secureRandomBytes
- is the secure number used for checking secure hashes
logReadingException
public java.lang.String findPreviousLogfileName(byte[] secureRandomBytes) throws logReadingException
secureRandomBytes
- is secure random bytes.
logReadingException
public int getCurrentSN()
public java.security.cert.Certificate getCert(java.io.File CurrentLogFile) throws logReadingException
CurrentLogFile
- is the current log file
logReadingException
public byte[] getSecureRandomNumber(java.security.PrivateKey privateKey) throws logReadingException
CurrentLogFile
- is the log fileis
- the private key
logReadingException
public javax.crypto.SecretKey getSymmetricKey()
public byte[] getSymmetricKey(java.io.File CurrentLogFile, java.security.PrivateKey privateKey) throws logReadingException
CurrentLogFile
- is the log fileis
- the private key
logReadingException
public byte[] getAccumulatedHash(java.io.File CurrentLogFile) throws logReadingException
CurrentLogFile
- is the log fileis
- the private key
logReadingException
public java.lang.String getAccumulatedHashAlgorithm(java.io.File CurrentLogFile) throws logReadingException
CurrentLogFile
- is the log file
logReadingException
public java.lang.String getSigningAlgorithm(java.io.File CurrentLogFile) throws logReadingException
CurrentLogFile
- is the log file
logReadingException
public byte[] getLogFileSignature(java.io.File CurrentLogFile) throws logReadingException
CurrentLogFile
- is the log fileis
- the private key
logReadingException
public byte[] getHeaderSignature(java.io.File CurrentLogFile) throws logReadingException
CurrentLogFile
- is the log fileis
- the private key
logReadingException
public LogRecordInfo getOneRecordInfoFromRAF(java.io.RandomAccessFile raf1, byte[] secureRandomBytes) throws logReadingException
raf1
- is the RAF filesecureRandomBytes
- is the secure number used for secure hash
logReadingException
public java.lang.String getXMLClientLogData(byte[] secureRandomBytes) throws logReadingException
logReadingException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |