Package com.ibm.di.security
Class SecurityCrypto
- java.lang.Object
-
- com.ibm.di.security.SecurityCrypto
-
public class SecurityCrypto extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SecurityCrypto(java.lang.String keyPath)
SecurityCrypto(java.lang.String keyPath, java.lang.String cipherAlg)
SecurityCrypto(java.lang.String keyPath, java.lang.String cipherAlg, java.security.Provider provider)
Creates SecurityCrypto Object with the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
decrypt(byte[] input)
byte[]
encrypt(byte[] input)
java.lang.String
getDecrypted(java.lang.String input)
java.lang.String
getEncrypted(byte[] input)
-
-
-
Constructor Detail
-
SecurityCrypto
public SecurityCrypto(java.lang.String keyPath) throws java.lang.Exception
- Throws:
java.lang.Exception
-
SecurityCrypto
public SecurityCrypto(java.lang.String keyPath, java.lang.String cipherAlg) throws java.lang.Exception
- Throws:
java.lang.Exception
-
SecurityCrypto
public SecurityCrypto(java.lang.String keyPath, java.lang.String cipherAlg, java.security.Provider provider) throws java.lang.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:
java.lang.Exception
- if an error occurs.
-
-
Method Detail
-
getDecrypted
public java.lang.String getDecrypted(java.lang.String input) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getEncrypted
public java.lang.String getEncrypted(byte[] input) throws java.lang.Exception
- Throws:
java.lang.Exception
-
encrypt
public byte[] encrypt(byte[] input) throws java.lang.Exception
- Throws:
java.lang.Exception
-
decrypt
public byte[] decrypt(byte[] input) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-