Premise
We're currently storing the following parameters used for integration with a home grown web service:
- username
- password
- tokenKey
- initVector
The below code is used to generate an authentication token:
HttpToken token = new HttpToken();
Blob key = Blob.valueOf(tokenKey);
Blob vector = Blob.valueOf(initVector);
String strToken = token.encryptToken(userName, passwd, key, vector);
Map<String, String> headerMap = new Map<String, String>();
headerMap.put('X-Auth-Token', strToken);
headerMap.put('Content-Type', 'application/json;charset=UTF-8');
HttpToken
is a custom class that tokenizes the username, password and uses the Salesforce Crypto
methods to perform an AES128 encryption.
Question How can I store the key and vector along with the username, password in a secure manner instead of relying on custom settings?