Main Content

isSecret

Determine if secret exists in MATLAB vault

Since R2024a

Description

tf = isSecret(secretname) returns logical 1 (true) if the specified secret exists in your MATLAB® vault. Otherwise, it returns logical 0 (false). Your MATLAB vault is accessible only from the exact combination of your operating system account and local machine.

example

Examples

collapse all

Determine if a secret exists in your vault.

tf = isSecret("SFTPpassword")
tf =

  logical

   1

Connect to an SFTP server if the password exists as a secret value in your MATLAB vault.

if (isSecret("SFTPpassword"))
    s = sftp("sftp.example.net","adam", ...
        Password=getSecret("SFTPpassword"));
end

Input Arguments

collapse all

Unique case-sensitive text identifier for the secret, specified as a string scalar or character vector. You can use a secret to hold sensitive information, such as passwords, certificates, credentials, OAuth tokens, and other configuration data for:

  • SFTP and FTP servers

  • Password-protected files, such as PDFs

  • Password-protected archives, such as zip files

  • Cloud providers, such as Amazon S3™ and Windows Azure® Blob Storage

  • API keys, SSH keys, and encryption keys

  • Databases and applications

Output Arguments

collapse all

True or false result, returned as a 1 or 0 of data type logical.

More About

collapse all

Extended Capabilities

expand all

Version History

Introduced in R2024a

expand all