Guest User

Untitled

a guest
Dec 14th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public PageReference directlogin(){
  2. Cookie getPasswd = ApexPages.currentPage().getCookies().get('password');
  3. String decryptedPassword= null;
  4. if(getPasswd !=null){
  5. Blob cryptoKey = Crypto.generateAesKey(256);
  6. Blob datac = EncodingUtil.base64Decode(getPasswd.getValue());
  7. try{
  8. Blob decryptedData = Crypto.decryptWithManagedIV('AES256', cryptoKey,datac ); // here error throwing
  9. decryptedPassword = decryptedData.toString();
  10. }catch(exception e){
  11. ex=e;
  12. }
  13. }
  14. return null;
  15. }
Add Comment
Please, Sign In to add comment