setSecret
Description
setSecret( adds a secret with the
specified name to your MATLAB® vault. Your vault and secrets persist across MATLAB sessions. secretname)
Each secret consists of a name, value, and optional metadata.
Secret name – A unique case-sensitive text identifier for the secret. The secret name is stored unencrypted in your vault as a string scalar.
Secret value – A text value associated with the secret. The Secret Prompt dialog box, where you enter the secret value, supports copy-paste functionality. The secret value is stored encrypted in your vault using industry standard AES-256 encryption. The secret value is returned as a string scalar.
Secret metadata – A dictionary containing additional information associated with the secret. The optional secret metadata is stored unencrypted in your vault.
On an installed version of MATLAB, your vault is accessible only from the exact combination of your operating system account and local machine, and your vault and secrets do not leave your local machine. With MATLAB Online™, your vault is accessible with your MathWorks Account, and your vault and secrets are stored on a secure database on MathWorks® servers. For increased security when you use MATLAB Online, enable two-step verification for your MathWorks Account.
setSecret(
specifies whether to overwrite an existing secret value in the vault.secretname,Overwrite=tf)
Examples
Input Arguments
Version History
Introduced in R2024aSee Also
getSecret | isSecret | listSecrets | removeSecret | setSecretMetadata | getSecretMetadata

