Skip to content

Instantly share code, notes, and snippets.

@msrivastav13
Created January 26, 2014 10:43
Show Gist options
  • Save msrivastav13/8631047 to your computer and use it in GitHub Desktop.
Save msrivastav13/8631047 to your computer and use it in GitHub Desktop.
string xldata='<data>xml sample data</data>';
blob b=blob.valueOf(xldata);
Blob encryptedData = Crypto.encryptWithManagedIV('AES256',blob.valueOf('00000000000000000000000000000000'), b);
//String blobstr=encryptedData.toString();//Not Effective and generates ERROR BLOB is not Valid UTF-8 String
String b64=EncodingUtil.base64Encode(encryptedData);
system.debug('&&&&'+b64);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment