SystemCredential

SystemCredential["keyname"]

gives the expression stored under "keyname" in secure storage.

Details

  • Expressions can be stored with SystemCredential["keyname"]=expr.
  • Expressions that can be stored in SystemCredential include:
  • "string"secret string such as password
    SystemCredentialDatageneral-purpose key-value pairs
    SecuredAuthenticationKeycredentials for an external service
  • Expressions stored under "keyname" can be removed with Unset[SystemCredential["keyname"]].
  • SystemCredential uses the operating system's keychain, if possible. If no secure storage is available, it stores its secrets in an encrypted local file.
  • Under Windows and macOS, the data is by default stored in the default keychain provided.
  • Under Linux, one of the supported wallet systems can be used.

Examples

open allclose all

Basic Examples  (3)

Store a secret string under the key name "mykey":

Read the string from secure storage:

Remove the stored data:

Securely store an authentication key:

Securely store a record of key-value pairs, with the "Password" field being encrypted:

Retrieve the stored information:

Applications  (1)

Create a SecuredAuthenticationKey with credentials from an external service, using two-legged OAuth:

Store the key in secure storage:

Use the stored key to send signed requests to the service:

Properties & Relations  (3)

List all names of securely stored data:

Remove stored data for a given key name:

Remove all stored data:

Use SystemCredentialKey"keyname" to securely store authentication dialog fields between sessions:

The data is remembered in secure storage under the given name:

Possible Issues  (1)

Numbers are not accepted by SystemCredential:

Key names must be strings:

Introduced in 2020
 (12.1)