|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.api.security.CryptoUtils
public class CryptoUtils
This class represents the Server's cryptographic module. It is initialized by the Server at startup.
Field Summary | |
---|---|
static java.lang.String |
ENCRYPTION_PROP_SERVER_KEY_ALIAS
System property that specifies the alias of the Server encryption key. |
static java.lang.String |
ENCRYPTION_PROP_SERVER_KEYSTORE
System property that specifies the path to the keystore which hosts the Server encryption key. |
static java.lang.String |
ENCRYPTION_PROP_SERVER_KEYSTORE_TYPE
System property that specifies the type of the keystore which hosts the Server encryption key. |
static java.lang.String |
ENCRYPTION_PROP_SERVER_TRANSFORMATION
System property that specifies the cryptographic transformation used by the Server for encryption. |
static java.lang.String |
MODE_CDECRYPT
Decrypt a TDI configuration file. |
static java.lang.String |
MODE_CENCRYPT
Encrypt a TDI configuration file. |
static java.lang.String |
MODE_DECRYPT
Decrypt User Registry. |
static java.lang.String |
MODE_ENCRYPT
Encrypt User Registry. |
static java.lang.String |
MODE_PDECRYPT
Decrypt a TDI properties file. |
static java.lang.String |
MODE_PENCRYPT
Encrypt a TDI properties file. |
Constructor Summary | |
---|---|
CryptoUtils()
|
Method Summary | |
---|---|
static byte[] |
decryptSecurityRegistry(byte[] data)
Decrypt User Registry contents with the Server encryption key. |
static byte[] |
decryptWithServerKey(byte[] data)
Decrypt data with the Server encryption key. |
static byte[] |
encryptWithServerKey(byte[] data)
Encrypt data with the Server encryption key. |
static Crypto |
getDefaultCrypto()
Retrieve an object representation of the Server's encryption/decryption functionality. |
static void |
init(java.lang.String keyStorePass,
java.lang.String keyPass)
Initialize this module. |
static void |
main(java.lang.String[] args)
The entry-point of the cryptoutils command-line tool. |
static byte[] |
readFile(java.lang.String fileName)
Read a whole file as binary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MODE_ENCRYPT
public static final java.lang.String MODE_DECRYPT
public static final java.lang.String MODE_CENCRYPT
public static final java.lang.String MODE_CDECRYPT
public static final java.lang.String MODE_PENCRYPT
public static final java.lang.String MODE_PDECRYPT
public static final java.lang.String ENCRYPTION_PROP_SERVER_KEYSTORE
public static final java.lang.String ENCRYPTION_PROP_SERVER_KEYSTORE_TYPE
public static final java.lang.String ENCRYPTION_PROP_SERVER_TRANSFORMATION
javax.crypto.Cipher.getInstance
would accept. For example
"AES/CBC/PKCS5Padding". The transformation must explicitly require a
secret key. Password-based (PBE) transformations are not supported.
public static final java.lang.String ENCRYPTION_PROP_SERVER_KEY_ALIAS
Constructor Detail |
---|
public CryptoUtils()
Method Detail |
---|
public static void init(java.lang.String keyStorePass, java.lang.String keyPass) throws java.lang.Exception
keyStorePass
- a password for the keystore that hosts the Server encryption
keykeyPass
- a password for the key inside the keystore
java.lang.Exception
- the module is already initialized; a required system property
is missing; the key cannot be retrieved; the encryption
transformation is not supported; the key is not suitable for
the encryption transformationpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- command-line arguments
java.lang.Exception
- operation errorpublic static byte[] readFile(java.lang.String fileName) throws java.io.IOException
fileName
- file to read
java.io.IOException
- error while reading the filepublic static byte[] decryptSecurityRegistry(byte[] data) throws java.lang.Exception
data
- User Registry contents
java.lang.Exception
- this module is not initialized or some cryptographic error
occurredpublic static byte[] encryptWithServerKey(byte[] data) throws java.lang.Exception
data
- data to encrypt
java.lang.Exception
- this module is not initialized or some cryptographic error
occurredpublic static byte[] decryptWithServerKey(byte[] data) throws java.lang.Exception
data
- encrypted data
java.lang.Exception
- this module is not initialized or some cryptographic error
occurredpublic static Crypto getDefaultCrypto() throws java.lang.Exception
java.lang.Exception
- this module is not initialized
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |