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

Variable Index

 o out
File used for debugging reasons
 o pathSeparator
The OS-dependended path separator
 o tmplong
Value used to create unique file names

Method Index

 o batchStore(Vector, Hashtable, long)
Stores the new/updated VMFs and downloaded files in the appropriated disk position
 o buildCertIdentifier(Certificate)
Method used to built a identifier for a given certificate
 o buildDesKey()
Method used to create a new symmetric key
 o buildDirectoryCreadentials(Vector, Hashtable)
Built a list of owned, by the user, directories
 o buildFileCredentials(Vector, Hashtable)
Built a list of owned, by the user, files
 o buildFileRights(Vector, Hashtable)
Method used to store all the certificate blocks which can be accessed from a given client
 o buildSystemDir(String)
Transforms a path string in a system's depended form
 o cleanTmp()
Removes all the files located in the download temporary directory
 o clientRole()
This method launches a thread that executes the client part of the download protocol
 o compareVmfs(Hashtable, Vector)
Compares the contents of a list of VMFs with the contents of a list of certificate blocks
 o decryptFile(String, String, CryptoKeyInfo, boolean)
Method used to decrypt a file and to store the decrypted data into another
 o deleteFiles(Vector)
Removes a list of files from the local storage device
 o displayMsg(String, TinguinSession)
Method used to display a message in the tinguin window
 o displayYesNo(String, String, String, TinguinSession)
Method used to display a message in the tinguin window and waits for the user confirmation
 o encryptFile(String, CryptoKeyInfo)
Method used for file encryption
 o generateHash(byte[])
This method calls the crypto block in order to genarate a hash for the passed sequence of bytes
 o getAccess(CertificateBlock)
Return the list of all the client which have access to the passed certificate block
 o getAllCerts()
Method used to retrieve all the certificates stored in the archive
 o getCADN()
Method used to retrieve the domain name of the CA
 o getCRADN()
Method used to retrieve the domain name for the CRA/News Server
 o getCRAHost()
Method used to retrieve the CRA/News Server's host address
 o getdiffs(Vector)
Compares a list of remote certificate blocks with these stored in the local storage device
 o getNewsHost()
Method for retieving News Server's host address
 o getRootPath()
Retieves the root directory in which the download modules works
 o getTmp()
Returns the temporary directory name for the download module
 o getUnnotifiedNames(String)
Retrieves from the DCF all these certificate blocks that are updated/new for a specific client
 o getYesNoAccess(String, String)
Returns true if the passed certificate block identifier can be accessed at least from one client
 o hasServerPK()
Method used to ensure if the CRA/News Server's trusted key is stored in the archive database
 o init()
The init method is called while bootstrapping semper.
 o insertNewVmfIds(String, String, long)
Inserts a new entry in the DCF
 o insertNewVmfIds(VmfClass)
Inserts all the certificate blocks contained in a single VMF into the DCF
 o insertNotification(String)
Inserts in the DCF the client identifier which has been informed about the new/updated modules
 o insertNotification(String, Vector)
Inserts in the DCF, all the offered certificate blocks which have been downloaded and installed from a particular client
 o isInit()
Returns the initiatialization status
 o launchCRAConfiguration()
Method used to update/change the location of the CRA/News Server host
 o launchCRAConnection()
Method used to get the uninstalled CRS/News Server's trusted key.
 o launchCredentialDisplay()
Display the owned download credentials in the tinguin window
 o launchDirectoryIncorporation()
Incorporates code from a choosen local disk directory.
 o launchDownloadFromHosts()
Connect directly a host and download new/updated files
 o launchSetupDownloadManager()
This method gives the ability to the user to change the working directory for the download module.
 o loadFileBytes(File)
Loads file data in a byte-array
 o loadVmf(String)
Loads a VMF from the local storage device
 o loadVmfs(Vector)
Loads all the local stored VMFs according to the passed certificate block list
 o main(String[])
Method used to start the Download Module from the shell
 o parseCredentials(String)
Method used to split in groups the passed credentials
 o println(String)
 o produceDes(CryptoKeyInfo, Certificate)
Method used to encrypt a symmetric key using public key encryption
 o produceDesMsg(byte[], CryptoKeyInfo)
Encrypts a message with a symmetric key
 o produceDesVerification(CryptoKeyInfo, Vector, int)
Method used to encrypt a symetric key using the private key from the owned certificate list
 o randomBytes(int)
This method calls the underlying crypto block in order to create a random sequence of bytes
 o retieveDesMsg(byte[], Certificate)
Return the symmetric key, which is encrypted with a public key algorithm
 o retrieveVersion(String, String)
 o runAsServer()
Method used to check if the download module acts as a server or as a client
 o 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
 o serverRole()
Method that launches the server part of the download protocol
 o storeNewsClientDB(NewsClientClass)
Stored all the information contained in a NewsClientClass object in a predefined files.
 o toHex(byte[])
Method used only for debugging purpose.
 o unixDir(String)
Transformes a path name in the appropriated unix form
 o 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
 o user_init()
The init method initialise the enviroment in which the whole download modules will work in.
 o validationChecking()
Checks all the stored VMFs and displays the result on the screen
 o validCredentials(CertificateBlock, boolean)
Checks if the remote obtained certificate block is valid
 o verifyCertificateMsg(Vector, Vector, CryptoKeyInfo, int)
Method used to verify if the priviously sended certificates are owned from the sended party
 o verifyDes(byte[], byte[], byte[], CryptoKeyInfo)
Checks if the encrypted message is correct
 o writeDCF()
Method used for debugging reasons

Variables

 o pathSeparator
 public static String pathSeparator
The OS-dependended path separator

 o out
 public static PrintWriter out
File used for debugging reasons

 o tmplong
 public static long tmplong
Value used to create unique file names

Methods

 o 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
 o isInit
 public boolean isInit()
Returns the initiatialization status

Returns:
value true if the Download module has been initialised
 o 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

 o getTmp
 public static String getTmp()
Returns the temporary directory name for the download module

Returns:
value Download module's tmp directory name
 o 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
 o init
 public static void init()
The init method is called while bootstrapping semper. It registers the "Download" option in tinguin's Application menu

 o writeDCF
 public static boolean writeDCF()
Method used for debugging reasons

 o getRootPath
 public static String getRootPath()
Retieves the root directory in which the download modules works

Returns:
value the root directory
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o serverRole
 public Administrative serverRole()
Method that launches the server part of the download protocol

Returns:
value a interface which administrate the download server
 o 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
 o launchCRAConfiguration
 public void launchCRAConfiguration()
Method used to update/change the location of the CRA/News Server host

 o 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

 o launchCredentialDisplay
 public void launchCredentialDisplay()
Display the owned download credentials in the tinguin window

 o 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.

 o 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.

 o validationChecking
 public void validationChecking()
Checks all the stored VMFs and displays the result on the screen

 o 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

 o 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
 o 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
 o 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
 o toHex
 public static String toHex(byte inBuf[])
Method used only for debugging purpose. Transforms a byte array of hex diggits to a string object

 o 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
 o cleanTmp
 public void cleanTmp()
Removes all the files located in the download temporary directory

 o 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
 o deleteFiles
 public void deleteFiles(Vector v)
Removes a list of files from the local storage device

Parameters:
v - a list of full file names
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o buildDesKey
 public CryptoKeyInfo buildDesKey()
Method used to create a new symmetric key

Returns:
value the symmetric key
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o getCRADN
 public static String getCRADN()
Method used to retrieve the domain name for the CRA/News Server

 o getCADN
 public static String getCADN()
Method used to retrieve the domain name of the CA

 o getCRAHost
 public static String getCRAHost()
Method used to retrieve the CRA/News Server's host address

 o getNewsHost
 public static String getNewsHost()
Method for retieving News Server's host address

 o hasServerPK
 public boolean hasServerPK()
Method used to ensure if the CRA/News Server's trusted key is stored in the archive database

 o retrieveVersion
 public static long retrieveVersion(String path,
                                    String id)
 o println
 public static void println(String msg)

All Packages  Class Hierarchy  This Package  Previous  Next  Index