Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public PageReference directlogin(){
- Cookie getPasswd = ApexPages.currentPage().getCookies().get('password');
- String decryptedPassword= null;
- if(getPasswd !=null){
- Blob cryptoKey = Crypto.generateAesKey(256);
- Blob datac = EncodingUtil.base64Decode(getPasswd.getValue());
- try{
- Blob decryptedData = Crypto.decryptWithManagedIV('AES256', cryptoKey,datac ); // here error throwing
- decryptedPassword = decryptedData.toString();
- }catch(exception e){
- ex=e;
- }
- }
- return null;
- }
Add Comment
Please, Sign In to add comment