OOP Protector Version 1.0

com.oopreserch.mercury.protector
Class Protector

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.oopreserch.mercury.protector.Protector

public class Protector
extends java.rmi.server.UnicastRemoteObject
implements ProtectorInterface

The implementation of ProtectorInterface. This class depends on Mercury API. Based on the KeyPairBox instance, provide the service for signing and encrypting the object and vice versa.

The private key and public key to be used for the service must reside in the KeyPairBox instance, which is specified at the constructor. The object to be signed and encrypted must implement Serializable, Signed and Sealed.

Author:
Jun Inamori
See Also:
Mercury API Documentation, com.oopreserch.mercury.target.Signed, com.oopreserch.mercury.target.Sealed, KeyPairBox, Serialized Form

Constructor Summary
Protector(int port, com.oopreserch.mercury.KeyPairBox key_box)
          Constructor with the KeyPairBox instance.
Protector(int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf, com.oopreserch.mercury.KeyPairBox key_box)
          Constructor with the KeyPairBox instance.
Protector(com.oopreserch.mercury.KeyPairBox key_box)
          Constructor with the KeyPairBox instance.
 
Method Summary
 java.io.Serializable decryptAndVerify(java.io.Serializable obj)
          The implementation of ProtectorInterface.decryptAndVerify().
 java.io.Serializable signAndEncrypt(java.io.Serializable obj, java.lang.String alias)
          The implementation of ProtectorInterface.signAndEncrypt().
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Protector

public Protector(com.oopreserch.mercury.KeyPairBox key_box)
          throws java.rmi.RemoteException
Constructor with the KeyPairBox instance. Based on the given KeyPairBox instance, provide the service for signing and encrypting the object and vice versa.

Create and export a new UnicastRemoteObject object using an anonymous port.
The private key and public key to be used for the service must reside in the KeyPairBox instance, which is specified at the constructor.
Throws:
java.rmi.RemoteException -  
See Also:
KeyPairBox

Protector

public Protector(int port,
                 com.oopreserch.mercury.KeyPairBox key_box)
          throws java.rmi.RemoteException
Constructor with the KeyPairBox instance. Based on the given KeyPairBox instance, provide the service for signing and encrypting the object and vice versa.

Create and export a new UnicastRemoteObject object using the particular supplied port.
The private key and public key to be used for the service must reside in the KeyPairBox instance, which is specified at the constructor.
Throws:
java.rmi.RemoteException -  
See Also:
KeyPairBox

Protector

public Protector(int port,
                 java.rmi.server.RMIClientSocketFactory csf,
                 java.rmi.server.RMIServerSocketFactory ssf,
                 com.oopreserch.mercury.KeyPairBox key_box)
          throws java.rmi.RemoteException
Constructor with the KeyPairBox instance. Based on the given KeyPairBox instance, provide the service for signing and encrypting the object and vice versa.

Create and export a new UnicastRemoteObject object using the particular supplied port and socket factories
The private key and public key to be used for the service must reside in the KeyPairBox instance, which is specified at the constructor.
Throws:
java.rmi.RemoteException -  
See Also:
KeyPairBox
Method Detail

signAndEncrypt

public java.io.Serializable signAndEncrypt(java.io.Serializable obj,
                                           java.lang.String alias)
                                    throws java.rmi.RemoteException,
                                           com.oopreserch.mercury.target.SafeTargetException,
                                           com.oopreserch.util.NestedException
The implementation of ProtectorInterface.signAndEncrypt(). Sign and encrypt the Signed and Sealed instance and return it.

The argument of this method is marked Serializable, but it also must implement both Signed and Sealed. The private key used to sign and encrypt it must resides in the KeyPairBox instance.
Specified by:
signAndEncrypt in interface ProtectorInterface
Parameters:
obj - The object to be signd and encrypted. It must implement Serializable,Signed and Sealed.
alias - The name of the private key to be used for signing and encrypting.
Returns:
Serializable
Throws:
java.rmi.RemoteException -  
com.oopreserch.mercury.target.SafeTargetException -  
com.oopreserch.util.NestedException -  
See Also:
com.oopreserch.mercury.target.Signed, com.oopreserch.mercury.target.Sealed, KeyPairBox

decryptAndVerify

public java.io.Serializable decryptAndVerify(java.io.Serializable obj)
                                      throws java.rmi.RemoteException,
                                             com.oopreserch.mercury.target.SafeTargetException,
                                             com.oopreserch.util.NestedException
The implementation of ProtectorInterface.decryptAndVerify(). Decrypt and verify the Signed and Sealed instance and return it.

The argument of this method is marked Serializable, but it also must implement both Signed and Sealed. The public key used to decrypt and verify it must resides in the KeyPairBox instance.
Specified by:
decryptAndVerify in interface ProtectorInterface
Parameters:
obj - The object to be decrypted and verified. It must implement Serializable,Signed and Sealed.
Returns:
Serializable
Throws:
java.rmi.RemoteException -  
com.oopreserch.mercury.target.SafeTargetException -  
com.oopreserch.util.NestedException -  
See Also:
com.oopreserch.mercury.target.Signed, com.oopreserch.mercury.target.Sealed, KeyPairBox

OOP Protector Version 1.0

ALL CONTENTS COPYRIGHT 2000, Jun Inamori. All rights reserved.
Any questions and comments are welcome to Jun Inamori.