+ 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