|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.common.util.crypto.cipher.BasicCryptor
public class BasicCryptor
Implementation of Cryptor interface that can perform both
encryption and decryption. Instances of this class can be cast to any
of the following interfaces: Cryptor, Encryptor,
or Decryptor.
Public methods in this class throw only CryptoExceptions.
Encryptor,
Decryptor| Field Summary | |
|---|---|
protected java.lang.String |
cipherAlgorithm
|
protected java.security.Key |
decryptKey
The key to be used for decryption. |
protected javax.crypto.Cipher |
encryptCipher
The Cipher to use for encryption. |
| Constructor Summary | |
|---|---|
BasicCryptor(java.security.Key encryptKey,
java.security.Key decryptKey,
java.lang.String algorithm)
|
|
| Method Summary | |
|---|---|
byte[] |
decrypt(byte[] ciphertext)
Decrypt the ciphertext to yield the original cleartext. |
java.lang.String |
decrypt(java.lang.String ciphertext)
Decrypt the ciphertext to yield the original cleartext. |
byte[] |
encrypt(byte[] cleartext)
Encrypt the cleartext in byte array format. |
java.lang.String |
encrypt(java.lang.String cleartext)
Encrypt the cleartext |
protected void |
initDecryptCipher()
Initialize the ciphers used for encryption and decryption. |
protected void |
initEncryptCipher()
Initialize the cipher used for encryption. |
java.io.Serializable |
sealObject(java.io.Serializable object)
|
static java.lang.String |
stripEncryptionPrefix(java.lang.String ciphertext)
|
java.io.Serializable |
unsealObject(java.io.Serializable object)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.security.Key decryptKey
protected javax.crypto.Cipher encryptCipher
Cipher to use for encryption.
protected java.lang.String cipherAlgorithm
| Constructor Detail |
|---|
public BasicCryptor(java.security.Key encryptKey,
java.security.Key decryptKey,
java.lang.String algorithm)
throws CryptoException
CryptoException| Method Detail |
|---|
public byte[] decrypt(byte[] ciphertext)
throws CryptoException
decrypt in interface Decryptorciphertext - The text to be encrypted, in byte formThe - decrypted cleartext, in byte form
CryptoException
public java.lang.String decrypt(java.lang.String ciphertext)
throws CryptoException
Decryptor
decrypt in interface Decryptorciphertext - The text to be encrypted
CryptoExceptionpublic static java.lang.String stripEncryptionPrefix(java.lang.String ciphertext)
protected void initDecryptCipher()
throws CryptoException
CryptoException
public java.io.Serializable unsealObject(java.io.Serializable object)
throws CryptoException
unsealObject in interface DecryptorCryptoException
public byte[] encrypt(byte[] cleartext)
throws CryptoException
encrypt in interface Encryptorcleartext - The text to be encrypted, in byte formThe - encrypted ciphertext, in byte form
CryptoException
public java.lang.String encrypt(java.lang.String cleartext)
throws CryptoException
Encryptor
encrypt in interface Encryptorcleartext - The text to be encrypted
CryptoException
protected void initEncryptCipher()
throws CryptoException
CryptoException
public java.io.Serializable sealObject(java.io.Serializable object)
throws CryptoException
sealObject in interface EncryptorCryptoException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||