|
||||||||||
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(java.lang.String transformation,
javax.crypto.SecretKey secretKey,
java.security.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(java.lang.String transformation, javax.crypto.SecretKey secretKey, java.security.Provider cryptoProvider) throws java.lang.Exception
transformation
- the name of a secret key transformationsecretKey
- a secret key, suitable for the cipher of the transformationcryptoProvider
- a Java security provider
java.lang.Exception
- error by the underlying JCE providerMethod Detail |
---|
public byte[] encrypt(byte[] data) throws java.lang.Exception
encrypt
in interface Crypto
data
- plaintext
java.lang.Exception
- problem with encryptionpublic byte[] decrypt(byte[] encryptedData) throws java.lang.Exception
decrypt
in interface Crypto
encryptedData
- ciphertext
java.lang.Exception
- problem with decryption
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |