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
davidwatdavidwat 

How to use a byte array in encrypt function as a key?

i have a key as a byte array like this

 

byte[] key={1,45,12,74,52,....upto 32 bytes values}

 

can someone tell me how to use the above array in encrypt (algo_name,key,IV,data) function?

 

The function parameter key require a 32 byte blob value. I have no idea how to convert the above key array to the valid blob format of 32 bytes.

navneetnavneet

use the data type blob..to do any further operations on byte array..

 

refer following link for more reference

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_encodingUtil.htm

 

let me know incase any issues...

 

 

Regards,

 

Navneet