Package com.ibm.di.plugin.security.pki
Class IDIPasswordCrypto
- java.lang.Object
-
- com.ibm.di.plugin.security.pki.IDIPasswordCrypto
-
public class IDIPasswordCrypto extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description IDIPasswordCrypto()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
decrypt(java.lang.String cipherText, java.lang.String ksPath, java.lang.String ksPassword, java.lang.String certificateAlias)
decrypt: Obtain plain ascii text for encrypted ciphertext specified.static java.lang.String
decrypt(java.lang.String cipherText, java.lang.String ksPath, java.lang.String ksPassword, java.lang.String certificateAlias, java.lang.String certificatePassword)
decrypt: Obtain plain ascii text for encrypted ciphertext specified.static java.lang.String
encrypt(java.lang.String plainText, java.lang.String ksPath, java.lang.String ksPassword, java.lang.String certificateAlias)
encrypt: Obtain encrypted (and ascii-encoded) value for plaintext specified, null strings are not processed and will be returned as null.
-
-
-
Method Detail
-
encrypt
public static java.lang.String encrypt(java.lang.String plainText, java.lang.String ksPath, java.lang.String ksPassword, java.lang.String certificateAlias) throws java.lang.Exception
encrypt: Obtain encrypted (and ascii-encoded) value for plaintext specified, null strings are not processed and will be returned as null.- Parameters:
plainText
- String representing value to be encryptedksPath
- String representing file path to jks fileksPassword
- String representing password for jks file as specified by pathcertificateAlias
- String naming the alias of certificate in keystore file- Returns:
- String representing encrypted format, null is returned if a null is passed in.
- Throws:
java.lang.Exception
- when underlying funtion fails
-
decrypt
public static java.lang.String decrypt(java.lang.String cipherText, java.lang.String ksPath, java.lang.String ksPassword, java.lang.String certificateAlias, java.lang.String certificatePassword) throws java.lang.Exception
decrypt: Obtain plain ascii text for encrypted ciphertext specified. Null strings are not processed and will be returned as received. Empty strings will be encoded/encrypted.- Parameters:
cipherText
- String representing value to be decryptedksPath
- String representing file path to jks fileksPassword
- String representing password for jks file as specified by pathcertificateAlias
- String naming the alias of certificate in keystore filecertificatePassword
- String representing password for the certificate's private key- Returns:
- String representing the decrypted format of the received string. Null is returned when a null is received.
- Throws:
java.lang.Exception
- when underlying funtion fails
-
decrypt
public static java.lang.String decrypt(java.lang.String cipherText, java.lang.String ksPath, java.lang.String ksPassword, java.lang.String certificateAlias) throws java.lang.Exception
decrypt: Obtain plain ascii text for encrypted ciphertext specified. This method uses the same password for the keystore file and for accessing the private key. Null strings are not processed and will be returned as received. Empty strings will be encoded/encrypted.- Parameters:
cipherText
- String representing value to be decryptedksPath
- String representing file path to jks fileksPassword
- String representing password for jks file as specified by pathcertificateAlias
- String naming the alias of certificate in keystore file- Returns:
- String representing the decrypted format of the received string. Null is returned when a null is received.
- Throws:
java.lang.Exception
- when underlying funtion fails
-
-