|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.CipherKey
public class CipherKey
CipherKey provides a very easy-to-use, yet effective encryption mechanism. The key (including the password) is transient.
| Field Summary | |
|---|---|
static String |
defaultAlgorithm
|
static int |
defaultIterationCount
|
| Constructor Summary | |
|---|---|
CipherKey(char[] password)
|
|
CipherKey(String pwd)
|
|
CipherKey(String algorithm,
byte[] salt,
int iterationCount,
char[] password)
|
|
| Method Summary | |
|---|---|
byte[] |
decode(byte[] encrypted)
decodes the given byte array |
void |
decode(InputStream in,
OutputStream out)
|
String |
decode(String s)
convenience method; requires a base64 string |
byte[] |
encode(byte[] plainSource)
encodes the given byte array |
void |
encode(InputStream in,
OutputStream out)
|
String |
encode(String s)
convenience method; returns a base64 string |
Cipher |
getDecoder()
fully initializes the Cipher for decoding and returns it. |
Cipher |
getEncoder()
fully initializes the Cipher for encoding and returns it. |
String |
getKeySignature()
returns a signature that is used to identify the key that needs to be known for both, encoding and decoding |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int defaultIterationCount
public static final String defaultAlgorithm
| Constructor Detail |
|---|
public CipherKey(String pwd)
throws GeneralSecurityException
GeneralSecurityException
public CipherKey(char[] password)
throws GeneralSecurityException
GeneralSecurityException
public CipherKey(String algorithm,
byte[] salt,
int iterationCount,
char[] password)
throws GeneralSecurityException
GeneralSecurityException| Method Detail |
|---|
public Cipher getEncoder()
public Cipher getDecoder()
public void encode(InputStream in,
OutputStream out)
throws IOException
IOException
public void decode(InputStream in,
OutputStream out)
throws IOException
IOExceptionpublic byte[] decode(byte[] encrypted)
SynchronousKey
decode in interface SynchronousKeypublic byte[] encode(byte[] plainSource)
SynchronousKey
encode in interface SynchronousKeypublic String encode(String s)
public String decode(String s)
throws RuntimeException
RuntimeExceptionpublic String getKeySignature()
SynchronousKey
getKeySignature in interface SynchronousKey
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||