function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sakhisakhi 

Routing secure data from visual force page to external web page (jsp)

Hi All,

 

I am new to salesforce. I have a requirement to send some data from visual force page to external Jsp securely.

We have tried encryption using crypto class with following test code ..

 

public class ProceedForpin{
// Use generateAesKey to generate the private key     
Blob cryptoKey = Crypto.generateAesKey(256);
// Generate the data to be encrypted.  
//Blob data = Blob.valueOf(testit);    
 Blob data = Blob.valueOf('test data to encrypt');
// Encrypt the data and have Salesforce.com generate the initialization vector   
 Blob encryptedData = Crypto.encryptWithManagedIV('AES256', cryptoKey, data);    
    

//method invoked from command button in my vsp.


    public PageReference redirect() {
   string  res= EncodingUtil.base64Encode(data);
    PageReference Iform = new PageReference('https://sites.google.com/site/testeformstest/'+'?ABC='+res); 
    Iform.setRedirect(true); 
    return Iform ;
    } 
}

 

 

above code is passing encrypted value of test data in URL as highlighted.

We need to pass it to another page (jsp) without making them visible in url string as it is secure data.

 

I think we need to pass it using hidden parameters but there I am facing issues for maintaining session between pages .

Or I think We need to use http post method, But, in this I think it is more used when web services are in picture which we do not require here.

 

May be I am wrong ,Please help me in correct direction and approach..

 

Any help with examples is much appreciated.

 

Thanks in advance ...