edu.stanford.peer.secrmi
Class SecureServerToolkit

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

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

The SecureServerToolkit class is used by a server program that provide secure and trusted RMI proxies. It is used to export RMI servers using SSL and to create signed proxies for the servers. The way to use this class is first to create a SecureServerToolkit object, then use it to export objects and register both the remote object and the signed proxy with a registry.


Constructor Summary
SecureServerToolkit(java.security.KeyStore serviceKS, java.lang.String sksPwd, java.security.KeyStore proxyKS)
          Creates a SecureServerToolkit object.
SecureServerToolkit(java.security.KeyStore serviceKS, java.lang.String sksPwd, java.security.KeyStore proxyKS, java.lang.String signingKeyAlias, java.lang.String signingAlg)
          Creates a SecureServerToolkit object.
SecureServerToolkit(java.security.KeyStore serviceKS, java.lang.String sksPwd, java.security.KeyStore proxyKS, java.lang.String signingKeyAlias, java.lang.String signingAlg, java.lang.String provider)
           
 
Method Summary
 java.rmi.Remote exportObject(java.rmi.Remote object)
          Exports a remote object so that proxies of the remote object communicate with the object through SSL.
 SignedRemoteObject exportSignedObject(java.rmi.Remote object)
          Exports a remote object so that proxies of the remote object communicate with the object through SSL and creates a signed proxy.
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.
 void setSignature(java.security.PrivateKey signingKey, java.lang.String signingAlg)
           
 void setSignature(java.security.PrivateKey signingKey, java.lang.String signingAlg, java.lang.String provider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecureServerToolkit

public SecureServerToolkit(java.security.KeyStore serviceKS,
                           java.lang.String sksPwd,
                           java.security.KeyStore proxyKS)
                    throws java.security.NoSuchAlgorithmException,
                           java.security.KeyStoreException,
                           java.security.NoSuchAlgorithmException,
                           java.security.NoSuchProviderException,
                           java.security.UnrecoverableKeyException,
                           java.security.cert.CertificateException,
                           java.security.KeyManagementException,
                           java.security.InvalidKeyException
Creates a SecureServerToolkit object.
Parameters:
serviceKS - the key store that holds the private key for services to communicate act as SSL servers
sksPwd - the password to access the private key in the key store
proxyKS - the key store that holds certificates of that the proxy

SecureServerToolkit

public SecureServerToolkit(java.security.KeyStore serviceKS,
                           java.lang.String sksPwd,
                           java.security.KeyStore proxyKS,
                           java.lang.String signingKeyAlias,
                           java.lang.String signingAlg)
                    throws java.security.NoSuchAlgorithmException,
                           java.security.KeyStoreException,
                           java.security.NoSuchAlgorithmException,
                           java.security.NoSuchProviderException,
                           java.security.UnrecoverableKeyException,
                           java.security.cert.CertificateException,
                           java.security.KeyManagementException,
                           java.security.InvalidKeyException
Creates a SecureServerToolkit object.
Parameters:
serviceKS - the key store services use to communicate with proxies through SSL
sksPwd - the password to access the service key store
proxyKS - the key store that the proxy uses as a trust store

SecureServerToolkit

public SecureServerToolkit(java.security.KeyStore serviceKS,
                           java.lang.String sksPwd,
                           java.security.KeyStore proxyKS,
                           java.lang.String signingKeyAlias,
                           java.lang.String signingAlg,
                           java.lang.String provider)
                    throws java.security.NoSuchAlgorithmException,
                           java.security.KeyStoreException,
                           java.security.NoSuchAlgorithmException,
                           java.security.NoSuchProviderException,
                           java.security.UnrecoverableKeyException,
                           java.security.cert.CertificateException,
                           java.security.KeyManagementException,
                           java.security.InvalidKeyException
Method Detail

setSignature

public void setSignature(java.security.PrivateKey signingKey,
                         java.lang.String signingAlg)
                  throws java.security.InvalidKeyException,
                         java.security.NoSuchAlgorithmException

setSignature

public void setSignature(java.security.PrivateKey signingKey,
                         java.lang.String signingAlg,
                         java.lang.String provider)
                  throws java.security.NoSuchAlgorithmException,
                         java.security.NoSuchProviderException,
                         java.security.InvalidKeyException

exportSignedObject

public final SignedRemoteObject exportSignedObject(java.rmi.Remote object)
                                            throws java.rmi.RemoteException,
                                                   java.io.IOException,
                                                   java.security.InvalidKeyException
Exports a remote object so that proxies of the remote object communicate with the object through SSL and creates a signed proxy.
Parameters:
object - the object to be exported

exportObject

public final java.rmi.Remote exportObject(java.rmi.Remote object)
                                   throws java.rmi.RemoteException
Exports a remote object so that proxies of the remote object communicate with the object through SSL.
Parameters:
object - the object to be exported

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