public class CredentialStoreCipher
extends java.lang.Object
The SecretKey is a vital private key used for encrypting and decrypting the cipher text produced by this class. If you lose the secret key, then the data is lost.
See Appendix A in the Java Cryptography Extension Reference Guide for more information.
SecretKey,
Cipher,
CredentialStoreImpl| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALGORITHM
The RC4 encryption algorithm is supplied by the JVM.
|
| Constructor and Description |
|---|
CredentialStoreCipher(javax.crypto.SecretKey secretKey) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] input) |
byte[] |
encrypt(byte[] input)
Uses the RC4 Encrypt and Decrypt routines found in the javax.crypto package.
|
static javax.crypto.SecretKey |
generateSecretKey()
This helper method will generate a fresh secret key for you to use.
|
public static final java.lang.String ALGORITHM
See Appendix A in the Java Cryptography Extension Reference Guide for more information.
public CredentialStoreCipher(javax.crypto.SecretKey secretKey)
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException
java.security.NoSuchAlgorithmExceptionjavax.crypto.NoSuchPaddingExceptionjava.security.InvalidKeyExceptionpublic static javax.crypto.SecretKey generateSecretKey()
throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmException - - thrown if your JVM does not support RC4 encryptionpublic byte[] encrypt(byte[] input)
public byte[] decrypt(byte[] input)