Can I encrypt the credentials.json file for AWS authentication using MATLAB Compiler?

I have some MATLAB code that accesses an AWS S3 bucket, and I'm compiling it to distribute to end users. I would like to encrypt the credentials.json file which provides authentication so that the user does not have access to this information. I noticed that in the MCR cache, this file is not encrypted like MATLAB files are.
Is there any way I can encrypt this file?

 采纳的回答

Only MATLAB code will be encrypted into the MCR cache, so unfortunately you cannot encrypt this JSON file. However, you can use the authentication approach which involves setting environment variables using the "setenv" function in MATLAB. This will allow the environment variable values (i.e. your AWS secrets) to be encrypted in the MCR cache because the values are stored in the MATLAB file.
For more information about this approach, please see the following documentation page:

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 MATLAB Compiler 的更多信息

产品

版本

R2021a

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by