edu.stanford.peer.secrmi
Class SecureClientToolkit

java.lang.Object
  |
  +--edu.stanford.peer.secrmi.SecureRMIToolkit
        |
        +--edu.stanford.peer.secrmi.SecureClientToolkit

public class SecureClientToolkit
extends edu.stanford.peer.secrmi.SecureRMIToolkit

The SecureClientToolkit class is used by the client program to lookup a signed proxy from RMI registry and to verify whether the downloaded proxy is correctly signed by the trusted public keys. The class is instantiated with two trusted public keys: the trusted class key, i.e., the public key trusted for signing the class of the proxy, and the trusted objetc key, i.e., the public key trusted for signing the object of the proxy. These two keys can be the same key or two different keys.


Constructor Summary
SecureClientToolkit(java.security.KeyStore classKS, java.lang.String ckAlias, java.security.KeyStore objectKS, java.lang.String okAlias)
          Creates a SecureClientToolkit object using two KeyStore objects and two aliases, which specify the two trusted public keys.
SecureClientToolkit(java.security.PublicKey classKey, java.security.PublicKey objectKey)
          Create a SecureClientToolkit object using the two trusted public keys.
 
Method Summary
static java.security.KeyStore loadKeyStore(java.lang.String type, java.io.FileInputStream in, char[] icchars)
          Load a key store from an input stream.
static java.security.KeyStore loadKeyStore(java.lang.String type, java.lang.String provider, java.io.FileInputStream in, char[] icchars)
          Load a key store from an input stream.
static java.security.KeyStore loadKeyStore(java.lang.String type, java.lang.String filename, java.lang.String icword)
          Load a key store from file.
static java.security.KeyStore loadKeyStore(java.lang.String type, java.lang.String provider, java.lang.String filename, java.lang.String icword)
          Load a key store from file.
 java.lang.Object lookupSigned(java.lang.String proxyAddress)
          Looks up a signed proxy and verify that it is signed by the two trusted keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureClientToolkit

public SecureClientToolkit(java.security.PublicKey classKey,
                           java.security.PublicKey objectKey)
Create a SecureClientToolkit object using the two trusted public keys.
Parameters:
classKey - the trusted class key
objectKey - the trusted object key

SecureClientToolkit

public SecureClientToolkit(java.security.KeyStore classKS,
                           java.lang.String ckAlias,
                           java.security.KeyStore objectKS,
                           java.lang.String okAlias)
                    throws java.security.KeyStoreException
Creates a SecureClientToolkit object using two KeyStore objects and two aliases, which specify the two trusted public keys.
Parameters:
ks1 - the KeyStore that contains a certificate of the trusted class key
alias1 - the alias of the certificate of the trusted class key in ks1
ks2 - the KeyStore that contains a certificate of the trusted object key
alias2 - the alias of the certificate of the trusted object key in ks2
Method Detail

lookupSigned

public java.lang.Object lookupSigned(java.lang.String proxyAddress)
                              throws java.rmi.NotBoundException,
                                     VerificationFailureException,
                                     java.io.IOException,
                                     java.lang.ClassNotFoundException
Looks up a signed proxy and verify that it is signed by the two trusted keys.
Parameters:
proxyAddress - the address of the signed proxy

loadKeyStore

public static final java.security.KeyStore loadKeyStore(java.lang.String type,
                                                        java.lang.String filename,
                                                        java.lang.String icword)
                                                 throws java.io.FileNotFoundException,
                                                        java.io.IOException,
                                                        java.security.KeyStoreException,
                                                        java.security.cert.CertificateException,
                                                        java.security.NoSuchAlgorithmException
Load a key store from file.
Parameters:
type - the type of the key store to load, e.g., JKS, jceks, etc.
filename - the name of the key store file
icword - the word for checking the integrity of the key store; when it is null, no check is performed

loadKeyStore

public static final java.security.KeyStore loadKeyStore(java.lang.String type,
                                                        java.io.FileInputStream in,
                                                        char[] icchars)
                                                 throws java.io.IOException,
                                                        java.security.KeyStoreException,
                                                        java.security.cert.CertificateException,
                                                        java.security.NoSuchAlgorithmException
Load a key store from an input stream.
Parameters:
type - the type of the key store to load, e.g., JKS, jceks, etc.
in - the input stream of the keystore
icchars - the word for checking the integrity of the key store; when it is null, no check is performed.

loadKeyStore

public static final java.security.KeyStore loadKeyStore(java.lang.String type,
                                                        java.lang.String provider,
                                                        java.lang.String filename,
                                                        java.lang.String icword)
                                                 throws java.io.FileNotFoundException,
                                                        java.io.IOException,
                                                        java.security.KeyStoreException,
                                                        java.security.cert.CertificateException,
                                                        java.security.NoSuchAlgorithmException,
                                                        java.security.NoSuchProviderException
Load a key store from file.
Parameters:
type - the type of the key store to load, e.g., JKS, jceks, etc.
provider - the name of the provider
filename - the name of the key store file
icword - the word for checking the integrity of the key store; when it is null, no check is performed

loadKeyStore

public static final java.security.KeyStore loadKeyStore(java.lang.String type,
                                                        java.lang.String provider,
                                                        java.io.FileInputStream in,
                                                        char[] icchars)
                                                 throws java.io.IOException,
                                                        java.security.KeyStoreException,
                                                        java.security.NoSuchProviderException,
                                                        java.security.cert.CertificateException,
                                                        java.security.NoSuchAlgorithmException
Load a key store from an input stream.
Parameters:
type - the type of the key store to load, e.g., JKS, jceks, etc.
provider - the name of the provider
in - the input stream of the keystore
icchars - the word for checking the integrity of the key store; when it is null, no check is performed