com.ibm.di.security
Class SecurityCrypto

java.lang.Object
  extended by com.ibm.di.security.SecurityCrypto

public class SecurityCrypto
extends Object


Constructor Summary
SecurityCrypto(String keyPath)
           
SecurityCrypto(String keyPath, String cipherAlg)
           
SecurityCrypto(String keyPath, String cipherAlg, Provider provider)
          Creates SecurityCrypto Object with the provided parameters.
 
Method Summary
 byte[] decrypt(byte[] input)
           
 byte[] encrypt(byte[] input)
           
 String getDecrypted(String input)
           
 String getEncrypted(byte[] input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityCrypto

public SecurityCrypto(String keyPath)
               throws Exception
Throws:
Exception

SecurityCrypto

public SecurityCrypto(String keyPath,
                      String cipherAlg)
               throws Exception
Throws:
Exception

SecurityCrypto

public SecurityCrypto(String keyPath,
                      String cipherAlg,
                      Provider provider)
               throws Exception
Creates SecurityCrypto Object with the provided parameters. The object contains the key, cipher and algorithm used.

Parameters:
keyPath - this parameter contains the secret key.
cipherAlg - this is the cipher algorithm which will be used to create the cipher. If this parameter is null then the value of the property "com.ibm.di.securityTransformation" will be used. If the property has no value then a default value for the algorithm will be used - DES/ECB/NoPadding.
provider - this is the security provider which will be used to create the cipher. If the parameter is null then the "com.ibm.di.cryptoProviderName" property will be checked for the name of an already registered security provider and if not found then the cipher will be created without an explicit security provider.
Throws:
Exception - if an error occurs.
Method Detail

getDecrypted

public String getDecrypted(String input)
                    throws Exception
Throws:
Exception

getEncrypted

public String getEncrypted(byte[] input)
                    throws Exception
Throws:
Exception

encrypt

public byte[] encrypt(byte[] input)
               throws Exception
Throws:
Exception

decrypt

public byte[] decrypt(byte[] input)
               throws Exception
Throws:
Exception