|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.security.SymmetricCipherCrypto
public class SymmetricCipherCrypto
Secret key encryption/decryption.
This class can work with secret key JCE transformations like the one that
javax.crypto.Cipher.getInstance
accepts. It supports block
ciphers (e.g. AES) in various feedback modes (ECB, CBC, CFB, ...) as well as
stream ciphers (e.g. RC4).
Objects of this class are thread-safe.
Constructor Summary | |
---|---|
SymmetricCipherCrypto(String transformation,
SecretKey secretKey,
Provider cryptoProvider)
Initializes the object with the specified parameters. |
Method Summary | |
---|---|
byte[] |
decrypt(byte[] encryptedData)
Decrypt data. |
byte[] |
encrypt(byte[] data)
Encrypt data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SymmetricCipherCrypto(String transformation, SecretKey secretKey, Provider cryptoProvider) throws Exception
transformation
- the name of a secret key transformationsecretKey
- a secret key, suitable for the cipher of the transformationcryptoProvider
- a Java security provider
Exception
- error by the underlying JCE providerMethod Detail |
---|
public byte[] encrypt(byte[] data) throws Exception
encrypt
in interface Crypto
data
- plaintext
Exception
- problem with encryptionpublic byte[] decrypt(byte[] encryptedData) throws Exception
decrypt
in interface Crypto
encryptedData
- ciphertext
Exception
- problem with decryption
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |