public class EasyCiphers
extends java.lang.Object
Constructor | Description |
---|---|
EasyCiphers() |
Modifier and Type | Method | Description |
---|---|---|
static void |
crypt(java.io.InputStream in,
java.io.OutputStream out,
javax.crypto.Cipher cipher) |
Encrypt a stream.
|
static byte[] |
decrypt(java.lang.String pubKey,
byte[] toDecrypt) |
Decrypt a byte array
|
static byte[] |
encrypt(java.lang.String privKey,
byte[] toEncrypt) |
Encrypt a byte array
|
static void |
genRSAKeyPair(java.lang.String pubName,
java.lang.String privName) |
Generate an RSA Key Pair - Default is 2048 which will fail unless
you have unlimited encryption installed.
|
static void |
genRSAKeyPair(java.lang.String pubName,
java.lang.String privName,
int KEYSIZE) |
Generate an RSA Key Pair
|
public static byte[] decrypt(java.lang.String pubKey, byte[] toDecrypt)
pubKey
- toDecrypt
- public static byte[] encrypt(java.lang.String privKey, byte[] toEncrypt)
privKey
- toEncrypt
- public static void genRSAKeyPair(java.lang.String pubName, java.lang.String privName)
pubName
- privName
- public static void genRSAKeyPair(java.lang.String pubName, java.lang.String privName, int KEYSIZE)
pubName
- privName
- KEYSIZE
- public static void crypt(java.io.InputStream in, java.io.OutputStream out, javax.crypto.Cipher cipher)
in
- out
- cipher
-