i3mclient.i3m
Class Encrypt

java.lang.Object
  |
  +--i3mclient.i3m.Encrypt

public class Encrypt
extends Object

Encrypt strings with public key from i3m-server (and add the current session-id for strong security)

Author:
Dirk Plate

Constructor Summary
Encrypt()
          Constructor.
 
Method Summary
 byte[] encrypt(String plainText)
          Encrypt a string with public key from I3M-Server (call init() first!)
static Encrypt getInstance()
          Returns an instance of this class (singleton construction)
 void init()
          Init the encryption engine.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encrypt

public Encrypt()
Constructor.

Method Detail

getInstance

public static Encrypt getInstance()
Returns an instance of this class (singleton construction)

Returns:
The unique instance of this class

init

public void init()
Init the encryption engine. Receive public key and sessionID from I3M-Server.


encrypt

public byte[] encrypt(String plainText)
Encrypt a string with public key from I3M-Server (call init() first!)

Parameters:
plainText - The text to encrypt
Returns:
The encrypted text. null if there was an error.