|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.middleware.connectors.communication.jgroups.util.CryptUtil
public class CryptUtil
A utility class for managing private/public keys and encrypting/decrypting strings
Constructor Summary | |
---|---|
CryptUtil()
|
Method Summary | |
---|---|
static String |
decrypt(String cipher)
decrypt the parameter string with the shared key read during initialization |
static String |
encrypt(String clear)
encrypt the parameter string with the shared key read during initialization |
void |
generateKeyPair()
generate a pair of keys - public and private, and write them to the files with the names "public.key" and "private.key" |
static String |
init(String dir,
Codec codec)
Initialization method - reads the shared key from the file system or generates a new shared key |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CryptUtil()
Method Detail |
---|
public static String init(String dir, Codec codec) throws Exception
String
- dir - the directory where the shared key file residescodec
- the codec to be used for encoding and decoding messages (e.g.
Base64)
Exception
public static String decrypt(String cipher) throws Exception
String
- chiper - the string to decrypt
Exception
public static String encrypt(String clear) throws Exception
String
- clear - the string to encrypt
Exception
public void generateKeyPair() throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |