Decrypting the password data type Global Variables in TIBCO ActiveMatrix BusinessWorks


We can Decrypt the password directly with value like if we have the value like below

"#!oe2FVz/rcjokKW2hIDGE7nSX1U+VKRjA"

then by using the Java Code below mentioned we can get the decrypted value as string .

import com.tibco.security.ObfuscationEngine;
String var = new String(ObfuscationEngine.decrypt(Input));
Output=var;


Use the below code in Java Code Activity

first create the Output Parameter and Input Parameter on Configuration tab of the Java Code.

package ProcessDefinition;
import java.util.*;
import java.io.*;
import com.tibco.security.ObfuscationEngine;
public class ProcessDefinitionJavaCode{
/****** START SET/GET METHOD, DO NOT MODIFY *****/
 protected String Input = "";
 protected String Output = "";
 public String getInput() {
  return Input;
 }
 public void setInput(String val) {
  Input = val;
 }
 public String getOutput() {
  return Output;
 }
 public void setOutput(String val) {
  Output = val;
 }
/****** END SET/GET METHOD, DO NOT MODIFY *****/
 public ProcessDefinitionJavaCode() {
 }
 public void invoke() throws Exception {
/* Available Variables: DO NOT MODIFY
 In  : String Input
 Out : String Output
* Available Variables: DO NOT MODIFY *****/
String var = new String(ObfuscationEngine.decrypt(Input));
 Output=var;

}
}


For Example the GV is like below

#!oe2FVz/rcjokKW2hIDGE7nSX1U+VKRjA
 
Then use the GV value as input for the JavaCode input i.e. "#!oe2FVz/rcjokKW2hIDGE7nSX1U+VKRjA"  then will get the Decrypt value in Output Parameter.


 

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP