Securing Your Data

You can secure your data by using the methods provided by the Crypto class.

The methods in the Crypto class provide standard algorithms for creating digests, message authentication codes, and signatures, as well as encrypting and decrypting information. These alogorithms can be used for securing content in Salesforce or for integrating with external services such as Google or Amazon WebServices (AWS).

The code excerpts on this page are written to highlight the use of the Crypto class. A production-level implementation would incorporate more plaintext key security. Refer to Strengthen Your Data’s Security with Shield Platform Encryption in Salesforce Help.

Note

Example Integrating Amazon WebServices

This example demonstrates an integration of Amazon WebServices with Salesforce.

Example Encrypting and Decrypting

This example uses the encryptWithManagedIV and decryptWithManagedIV methods and the generateAesKey method of the Crypto class.

This example shows how to write a unit test for the encryptWithManagedIV and decryptWithManagedIV Crypto methods.