public class CryptUtil extends Object
Constructor and Description |
---|
CryptUtil() |
Modifier and Type | Method and Description |
---|---|
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
|
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 decryptException
public static String encrypt(String clear) throws Exception
String
- clear - the string to encryptException
Copyright © 2018 universAAL Consortium. All rights reserved.