All Packages Class Hierarchy This Package Previous Next Index
Class semper.download.Download
java.lang.Object
|
+----semper.download.Download
- public class Download
- extends Object
The Download module offers the functunality in order to serve
request from other modules contained in the download package.
- Version:
- $Revision: 1.6 $ $Date: 1998/08/20 09:28:52 $
- Author:
- Petros Pantis, Kostas Tzelepis
-
out
- File used for debugging reasons
-
pathSeparator
- The OS-dependended path separator
-
tmplong
- Value used to create unique file names
-
batchStore(Vector, Hashtable, long)
- Stores the new/updated VMFs and downloaded files in the appropriated disk
position
-
buildCertIdentifier(Certificate)
- Method used to built a identifier for a given certificate
-
buildDesKey()
- Method used to create a new symmetric key
-
buildDirectoryCreadentials(Vector, Hashtable)
- Built a list of owned, by the user, directories
-
buildFileCredentials(Vector, Hashtable)
- Built a list of owned, by the user, files
-
buildFileRights(Vector, Hashtable)
- Method used to store all the certificate blocks which can be accessed from a given
client
-
buildSystemDir(String)
- Transforms a path string in a system's depended form
-
cleanTmp()
- Removes all the files located in the download temporary directory
-
clientRole()
- This method launches a thread that executes the client part of the download protocol
-
compareVmfs(Hashtable, Vector)
- Compares the contents of a list of VMFs with the contents of a list of certificate blocks
-
decryptFile(String, String, CryptoKeyInfo, boolean)
- Method used to decrypt a file and to store the decrypted data into another
-
deleteFiles(Vector)
- Removes a list of files from the local storage device
-
displayMsg(String, TinguinSession)
- Method used to display a message in the tinguin window
-
displayYesNo(String, String, String, TinguinSession)
- Method used to display a message in the tinguin window and waits for the user
confirmation
-
encryptFile(String, CryptoKeyInfo)
- Method used for file encryption
-
generateHash(byte[])
- This method calls the crypto block in order to genarate a hash for the
passed sequence of bytes
-
getAccess(CertificateBlock)
- Return the list of all the client which have access to the passed certificate block
-
getAllCerts()
- Method used to retrieve all the certificates stored in the archive
-
getCADN()
- Method used to retrieve the domain name of the CA
-
getCRADN()
- Method used to retrieve the domain name for the CRA/News Server
-
getCRAHost()
- Method used to retrieve the CRA/News Server's host address
-
getdiffs(Vector)
- Compares a list of remote certificate blocks with these stored in the
local storage device
-
getNewsHost()
- Method for retieving News Server's host address
-
getRootPath()
- Retieves the root directory in which the download modules works
-
getTmp()
- Returns the temporary directory name for the download module
-
getUnnotifiedNames(String)
- Retrieves from the DCF all these certificate blocks that are updated/new
for a specific client
-
getYesNoAccess(String, String)
- Returns true if the passed certificate block identifier can be accessed at least from one client
-
hasServerPK()
- Method used to ensure if the CRA/News Server's trusted key is stored in the archive database
-
init()
- The init method is called while bootstrapping semper.
-
insertNewVmfIds(String, String, long)
- Inserts a new entry in the DCF
-
insertNewVmfIds(VmfClass)
- Inserts all the certificate blocks contained in a single VMF into the DCF
-
insertNotification(String)
- Inserts in the DCF the client identifier which has been informed about
the new/updated modules
-
insertNotification(String, Vector)
- Inserts in the DCF, all the offered certificate blocks which have
been downloaded and installed from a particular client
-
isInit()
- Returns the initiatialization status
-
launchCRAConfiguration()
- Method used to update/change the location of the CRA/News Server host
-
launchCRAConnection()
- Method used to get the uninstalled CRS/News Server's trusted key.
-
launchCredentialDisplay()
- Display the owned download credentials in the tinguin window
-
launchDirectoryIncorporation()
- Incorporates code from a choosen local disk directory.
-
launchDownloadFromHosts()
- Connect directly a host and download new/updated files
-
launchSetupDownloadManager()
- This method gives the ability to the user to change the working
directory for the download module.
-
loadFileBytes(File)
- Loads file data in a byte-array
-
loadVmf(String)
- Loads a VMF from the local storage device
-
loadVmfs(Vector)
- Loads all the local stored VMFs according to the passed certificate block list
-
main(String[])
- Method used to start the Download Module from the shell
-
parseCredentials(String)
- Method used to split in groups the passed credentials
-
println(String)
-
-
produceDes(CryptoKeyInfo, Certificate)
- Method used to encrypt a symmetric key using public key encryption
-
produceDesMsg(byte[], CryptoKeyInfo)
- Encrypts a message with a symmetric key
-
produceDesVerification(CryptoKeyInfo, Vector, int)
- Method used to encrypt a symetric key using the private key from
the owned certificate list
-
randomBytes(int)
- This method calls the underlying crypto block in order to create a random sequence
of bytes
-
retieveDesMsg(byte[], Certificate)
- Return the symmetric key, which is encrypted with a public key algorithm
-
retrieveVersion(String, String)
-
-
runAsServer()
- Method used to check if the download module acts as a server or as a client
-
sameHashValues(long, Vector, CryptoKeyInfo)
- Compares the hash value of the downloaded files, stored in the tmp direcory,
with these contained in the remote obtained certificate block list
-
serverRole()
- Method that launches the server part of the download protocol
-
storeNewsClientDB(NewsClientClass)
- Stored all the information contained in a NewsClientClass object in a
predefined files.
-
toHex(byte[])
- Method used only for debugging purpose.
-
unixDir(String)
- Transformes a path name in the appropriated unix form
-
updateOwnedDirectories()
- This method is used from a mobile code issuer in order to recreate all the
VMFs which are contained in these packages that have been modified
-
user_init()
- The init method initialise the enviroment in which the whole download
modules will work in.
-
validationChecking()
- Checks all the stored VMFs and displays the result on the screen
-
validCredentials(CertificateBlock, boolean)
- Checks if the remote obtained certificate block is valid
-
verifyCertificateMsg(Vector, Vector, CryptoKeyInfo, int)
- Method used to verify if the priviously sended certificates are owned
from the sended party
-
verifyDes(byte[], byte[], byte[], CryptoKeyInfo)
- Checks if the encrypted message is correct
-
writeDCF()
- Method used for debugging reasons
pathSeparator
public static String pathSeparator
- The OS-dependended path separator
out
public static PrintWriter out
- File used for debugging reasons
tmplong
public static long tmplong
- Value used to create unique file names
main
public static void main(String args[])
- Method used to start the Download Module from the shell
- Parameters:
- args - the list of arguments passed to the Download Module
isInit
public boolean isInit()
- Returns the initiatialization status
- Returns:
- value true if the Download module has been initialised
user_init
public void user_init()
- The init method initialise the enviroment in which the whole download
modules will work in.
-- Initialise/checks the DCF structure
-- Updates the Application menu, register the "Download Manager" in the tinguin's Application menu
-- Checks the VMF structures
getTmp
public static String getTmp()
- Returns the temporary directory name for the download module
- Returns:
- value Download module's tmp directory name
runAsServer
public boolean runAsServer()
- Method used to check if the download module acts as a server or as a client
- Returns:
- value true if the download module acts as a server
init
public static void init()
- The init method is called while bootstrapping semper. It registers
the "Download" option in tinguin's Application menu
writeDCF
public static boolean writeDCF()
- Method used for debugging reasons
getRootPath
public static String getRootPath()
- Retieves the root directory in which the download modules works
- Returns:
- value the root directory
buildSystemDir
public static String buildSystemDir(String path)
- Transforms a path string in a system's depended form
- Parameters:
- path - the path name that should be transformed in a system's depended format
- Returns:
- value the transformed path
unixDir
public static String unixDir(String dir)
- Transformes a path name in the appropriated unix form
- Parameters:
- dir - the path string that will be transformed
- Returns:
- value the associated unix path
getUnnotifiedNames
public Vector getUnnotifiedNames(String client_Id)
- Retrieves from the DCF all these certificate blocks that are updated/new
for a specific client
- Parameters:
- client_Id - client's unique identifier
- Returns:
- value changed certificate blocks
insertNotification
public void insertNotification(String client_id)
- Inserts in the DCF the client identifier which has been informed about
the new/updated modules
- Parameters:
- client_id - client's unique identifier
insertNotification
public void insertNotification(String client_id,
Vector certIds)
- Inserts in the DCF, all the offered certificate blocks which have
been downloaded and installed from a particular client
- Parameters:
- client_Id - client's unique identifier
- certIds - the list of downloaded and acknowleged certificate blocks
loadVmf
public VmfClass loadVmf(String path)
- Loads a VMF from the local storage device
- Parameters:
- path - the VMF path name
- Returns:
- value the VMF data structure
getdiffs
public Vector getdiffs(Vector diffs)
- Compares a list of remote certificate blocks with these stored in the
local storage device
- Parameters:
- diffs - a list of remote certificate blocks
- Returns:
- value a list of differences
insertNewVmfIds
public boolean insertNewVmfIds(String dirn,
String certID,
long vers)
- Inserts a new entry in the DCF
- Parameters:
- dirn - the directory name in unix format
- certID - a unique certicate block identifier
- vers - the version number of the above certificate block
- Returns:
- value true on success
insertNewVmfIds
public boolean insertNewVmfIds(VmfClass vmf)
- Inserts all the certificate blocks contained in a single VMF into the DCF
- Parameters:
- vmf - the VMF structure
- Returns:
- value true on success
loadVmfs
public Hashtable loadVmfs(Vector certblockelements)
- Loads all the local stored VMFs according to the passed certificate block list
- Parameters:
- certblockelements - the list of certificate blocks
- Returns:
- value returns a hashtable of the local VMFs
storeNewsClientDB
public void storeNewsClientDB(NewsClientClass ncc)
- Stored all the information contained in a NewsClientClass object in a
predefined files. This method is called after news have been downloaded
from the News Server
- Parameters:
- ncc - the news storage object
launchDownloadFromHosts
public Administrative launchDownloadFromHosts()
- Connect directly a host and download new/updated files
- Returns:
- value returns an interface in order to administrate the whole download procedure
clientRole
public Administrative clientRole()
- This method launches a thread that executes the client part of the download protocol
- Returns:
- value a interface that allows to stop the execution of the above thread
serverRole
public Administrative serverRole()
- Method that launches the server part of the download protocol
- Returns:
- value a interface which administrate the download server
parseCredentials
public static Vector[] parseCredentials(String creds)
- Method used to split in groups the passed credentials
- Parameters:
- creds - the passed credentials
- Returns:
- value the groups of credentials
launchCRAConfiguration
public void launchCRAConfiguration()
- Method used to update/change the location of the CRA/News Server host
launchCRAConnection
public void launchCRAConnection()
- Method used to get the uninstalled CRS/News Server's trusted key. Furthermore
by calling this method the user is abled to request the owned download credentials
or to download/upload news to the News Server
launchCredentialDisplay
public void launchCredentialDisplay()
- Display the owned download credentials in the tinguin window
launchSetupDownloadManager
public void launchSetupDownloadManager()
- This method gives the ability to the user to change the working
directory for the download module. Additional, the user is able to
modify the download constrains.
launchDirectoryIncorporation
public void launchDirectoryIncorporation()
- Incorporates code from a choosen local disk directory. This method is used
each time the user downloads new/updated code via ftp from a server.
validationChecking
public void validationChecking()
- Checks all the stored VMFs and displays the result on the screen
updateOwnedDirectories
public void updateOwnedDirectories()
- This method is used from a mobile code issuer in order to recreate all the
VMFs which are contained in these packages that have been modified
buildFileCredentials
public static boolean buildFileCredentials(Vector files,
Hashtable ht)
- Built a list of owned, by the user, files
- Parameters:
- files - the file list stored in the credentials
- ht - a hashtable contained directory name-file name pairs
- Returns:
- value true on success
buildDirectoryCreadentials
public static void buildDirectoryCreadentials(Vector dirs,
Hashtable ht)
- Built a list of owned, by the user, directories
- Parameters:
- dirs - the directory list stored in the credentials
- ht - a hashtable contained directory name-file name pairs
- Returns:
- value true on success
validCredentials
public boolean validCredentials(CertificateBlock cb,
boolean checkall)
- Checks if the remote obtained certificate block is valid
- Parameters:
- cb - the certificate block
- checkall - if true checks also the file list of the above certificate block
- Returns:
- value true if the remote certificate block is valid
toHex
public static String toHex(byte inBuf[])
- Method used only for debugging purpose. Transforms a byte array of hex diggits
to a string object
batchStore
public boolean batchStore(Vector fileVec,
Hashtable vmfs,
long lname)
- Stores the new/updated VMFs and downloaded files in the appropriated disk
position
- Parameters:
- fileVec - the list of downloaded files
- vmfs - the list of updated/new VMFs
- lname - storage identifier (all the downloaded files are first stored in the tmp direcory)
- Returns:
- value true on success
cleanTmp
public void cleanTmp()
- Removes all the files located in the download temporary directory
compareVmfs
public Vector[] compareVmfs(Hashtable vmfhash,
Vector remoteCertVec)
- Compares the contents of a list of VMFs with the contents of a list of certificate blocks
- Parameters:
- vmfhash - list of VMFs (local stored)
- remoteCertVec - the list of remote obtained certificate blocks
- Returns:
- value a array of lists of changes
deleteFiles
public void deleteFiles(Vector v)
- Removes a list of files from the local storage device
- Parameters:
- v - a list of full file names
sameHashValues
public boolean sameHashValues(long l,
Vector fclasses,
CryptoKeyInfo key)
- Compares the hash value of the downloaded files, stored in the tmp direcory,
with these contained in the remote obtained certificate block list
- Parameters:
- l - the storage index
- fclasses - a list of files contained in the remote obtained certificate blocks
- Returns:
- value true, if the local and remote hash values have the same value
displayMsg
public static void displayMsg(String msg,
TinguinSession display)
- Method used to display a message in the tinguin window
- Parameters:
- msg - the message String object
- display - the TinguinSession object
getAllCerts
public Hashtable getAllCerts()
- Method used to retrieve all the certificates stored in the archive
- Returns:
- value a hashtable of all the certificates contained in the archive db
randomBytes
public byte[] randomBytes(int len)
- This method calls the underlying crypto block in order to create a random sequence
of bytes
- Parameters:
- len - the length of the returned byte array
- Returns:
- value the list of random bytes
generateHash
public byte[] generateHash(byte data[])
- This method calls the crypto block in order to genarate a hash for the
passed sequence of bytes
- Parameters:
- data - the byte-array
- Returns:
- value the associated hash value
displayYesNo
public static boolean displayYesNo(String msg,
String yes,
String no,
TinguinSession display)
- Method used to display a message in the tinguin window and waits for the user
confirmation
- Parameters:
- msg - the message String object
- yes - the button label to confirm
- no - the button label for abort
- display - the TinguinSession object
- Returns:
- value true if user has pressed the confirm button
retieveDesMsg
public CryptoKeyInfo retieveDesMsg(byte data[],
Certificate cert)
- Return the symmetric key, which is encrypted with a public key algorithm
- Parameters:
- data - byte-array contained the encrypted symmetric key
- cert - used to decrypt the encrypted symmetric key
- Returns:
- value the symmetric key or null on error
verifyDes
public byte[] verifyDes(byte data[],
byte mynonce[],
byte rnonce[],
CryptoKeyInfo key)
- Checks if the encrypted message is correct
- Parameters:
- data - the byte-array that contains the encrypted message
- mynonce - the byte-array that contains the previous sended nonce
- rnonce - the byte-array that contains the previous sended nonce from the other party
- key - the previously negotiated symmetric key
- Returns:
- value the decrypted message
produceDesMsg
public byte[] produceDesMsg(byte msg[],
CryptoKeyInfo key)
- Encrypts a message with a symmetric key
- Parameters:
- msg - the message that will be encrypted
- key - the symmetric key
- Returns:
- value null on error else the encrypted message
produceDes
public byte[] produceDes(CryptoKeyInfo key,
Certificate cert)
- Method used to encrypt a symmetric key using public key encryption
- Parameters:
- key - the symmetric key
- cert - the certificate used to encrypt the above symmetric key
- Returns:
- value null on error else the encrypted key
buildDesKey
public CryptoKeyInfo buildDesKey()
- Method used to create a new symmetric key
- Returns:
- value the symmetric key
produceDesVerification
public Vector produceDesVerification(CryptoKeyInfo key,
Vector certificates,
int offset)
- Method used to encrypt a symetric key using the private key from
the owned certificate list
- Parameters:
- key - the symetric key
- certificates - the certificate list
- offset - the certificate list index
- Returns:
- value a list of encrypted messages containing the symetric key
verifyCertificateMsg
public boolean verifyCertificateMsg(Vector encryptVec,
Vector certificates,
CryptoKeyInfo key,
int offset)
- Method used to verify if the priviously sended certificates are owned
from the sended party
- Parameters:
- encryptVec - a list containing the encryptions of the symetric key
- certificates - the list of the certificate used to encrypt the sym. key
- key - the symetric key
- offset - defines the starting certificate list index
- Returns:
- value true if verification succeeded
buildCertIdentifier
public static String buildCertIdentifier(Certificate cert)
- Method used to built a identifier for a given certificate
- Parameters:
- cert - the certificate object
- Returns:
- value the certificate identifier
buildFileRights
public boolean buildFileRights(Vector certs,
Hashtable cbs)
- Method used to store all the certificate blocks which can be accessed from a given
client
- Parameters:
- certs - a certificate list (owned by the client)
- cbs - access rights for a given certificate block
- Returns:
- value true on success
encryptFile
public String encryptFile(String fname,
CryptoKeyInfo key)
- Method used for file encryption
- Parameters:
- fname - the file name
- key - the symmetric key
- Returns:
- value the new file name contained the encrypted file-data
loadFileBytes
public static byte[] loadFileBytes(File f)
- Loads file data in a byte-array
- Parameters:
- f - the file structure
- Returns:
- value array of bytes contained the file contents
decryptFile
public boolean decryptFile(String srcname,
String dstname,
CryptoKeyInfo key,
boolean rem)
- Method used to decrypt a file and to store the decrypted data into another
- Parameters:
- srcname - the source file name contained the encrypted data
- dstname - the destination file contained the decrypted data
- key - the symmetric key used for decryption
- rem - if true the source file will be removed after decryption
- Returns:
- value true on success
getAccess
public static Vector getAccess(CertificateBlock cb)
- Return the list of all the client which have access to the passed certificate block
- Parameters:
- cb - the certificate block
- Returns:
- value the list of all the client having access to the above certificate block
getYesNoAccess
public static boolean getYesNoAccess(String path,
String certblid)
- Returns true if the passed certificate block identifier can be accessed at least from one client
- Parameters:
- path - the directory name
- certblid - the certificate block identifier
getCRADN
public static String getCRADN()
- Method used to retrieve the domain name for the CRA/News Server
getCADN
public static String getCADN()
- Method used to retrieve the domain name of the CA
getCRAHost
public static String getCRAHost()
- Method used to retrieve the CRA/News Server's host address
getNewsHost
public static String getNewsHost()
- Method for retieving News Server's host address
hasServerPK
public boolean hasServerPK()
- Method used to ensure if the CRA/News Server's trusted key is stored in the archive database
retrieveVersion
public static long retrieveVersion(String path,
String id)
println
public static void println(String msg)
All Packages Class Hierarchy This Package Previous Next Index