Thursday 24 October 2019

SOA Java Snippet to Decode and Encode


Decode: 

XMLElement EncodedData = (XMLElement)getVariableData("VariableName","VariablePart","PathOfTheElementHoldingData");         
String EncodedReportData=EncodedData.getTextContent();                         
oracle.soa.common.util.Base64Decoder B64Decoder = new oracle.soa.common.util.Base64Decoder();                                         
  try                                         
   {                                         
      String DecodedReportData = B64Decoder.decode(EncodedReportData);         
      setVariableData("DecodedString",DecodedReportData);                                           
   }                           
  catch(Exception e)                                             
   {                                         
      addAuditTrailEntry("Exception During Decode "+e.getMessage());       
      e.printStackTrace();                                         
   }


Encode: 

XMLElement DecodedData = (XMLElement)getVariableData("VariableName","VariablePart","PathOfTheElementHoldingData");          
String DecodedReportData=DecodedData.getTextContent();                          
oracle.soa.common.util.Base64Decoder B64Decoder = new oracle.soa.common.util.Base64Decoder();                                          
  try                                          
   {                                          
      String EncodedReportData = B64Encoder.encode(DecodedReportData);          
      setVariableData("EncodedString",EncodedReportData);                                            
   }                            
  catch(Exception e)                                              
   {                                          
      addAuditTrailEntry("Exception During Encode "+e.getMessage());        
      e.printStackTrace();                                          
   }

PGP Encrypt and Decrypt Script


#!/bin/bash

SourceFilePath=$1
OutFilePath=$2
PublicKeyUser=$3

echo "Running GPG Encrypt Command"

gpg --batch --yes --trust-model always -r $PublicKeyUser -o $OutFilePath -e $SourceFilePath


--------------------------------------------

#!/bin/bash


SourceFilePath=$1
OutputFileName=$2
PassPhrase=$3

echo "Running GPG Decrypt Command"

cat $PassPhrase | gpg --output $OutputFileName --batch --yes --passphrase-fd 0 $SourceFilePath

IDCS - Identity Federation with Azure and Google (SAML IDP & Social IDP)

  Collect IDCS Meta Data Enable "Access Signing Certificate" option to get the IDCS metadata.   Default Domain Settings ->  Sel...