In Einstein Playground app developed by the Salesforce Lab, I have uploaded the einstein platform service private key file named einstein_platform.pem to complete my einstein platform service setup. And the account has been setup successfully and the app is working properly.
Now I am trying to get access token of einstein platform service through Apex code provided by the Metamind. And when I am trying to get the VersionData of the 'einstein_platform' titled file which I haved uploaded earlier, I got a base64 formed blob data. But when I am going to convert this blob data into original string, I am getting this error :
BLOB is not a valid UTF-8 string
ContentVersion base64Content = [SELECT Title, VersionData
FROM ContentVersion
where Title='einstein_platform'
LIMIT 1];
String keyContents = base64Content.VersionData.tostring(); //this line is generating error
Later I have uploaded the einstein_platform.pem file with a different name named einstein_platform2.pem then checked and find out that the VersionData of the *'*einstein_platform'** titled file uploaded through the Einstein Playground app is different from the VersionData data of 'einstein_platform2' titled file.
einstein_platform.pem file uploaded by me through the Einstein Playground app and giving the error while converting into original string
einstein_platform2.pem file uploaded by me through Files tab and the version data is fine and okay to convert into original string