I want to send an Email to my salesforce
Account and the update
Account informations given in the Email.
My problem now: The Email is Encrypted. So i wrote an Apex class and now I'm trying to implement the decryption.
Before, it already worked sending an Email an creating an test-Task, but now, while trying to decode the Email, i get an Email back with the following
Error: System.SecurityException: update() failed.
(System Code) Class.UpdateLeadsWithHomeReporting.Decrypt: line 27, column 1 Class.UpdateLeadsWithHomeReporting.handleInboundEmail: line 13, column 1 11:42:04.102 (102347358)|FATAL_ERROR|System.SecurityException: update() failed
String encodedAesKey = 'mySecretAESKey'; Blob key = EncodingUtil.base64Decode(encodedAesKey); Blob input = Blob.valueof('MyEncryptedString'); Blob ivBlob = EncodingUtil.convertFromHex('myIVInHex'); Blob output = Crypto.decrypt('AES256', key, ivBlob , input);
What am I doing wrong? Does anyone know?