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:

Wolfram Research (2020), SystemCredential, Wolfram Language function, https://reference.wolfram.com/language/ref/SystemCredential.html.

Text

Wolfram Research (2020), SystemCredential, Wolfram Language function, https://reference.wolfram.com/language/ref/SystemCredential.html.

CMS

Wolfram Language. 2020. "SystemCredential." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SystemCredential.html.

APA

Wolfram Language. (2020). SystemCredential. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SystemCredential.html

BibTeX

@misc{reference.wolfram_2023_systemcredential, author="Wolfram Research", title="{SystemCredential}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/SystemCredential.html}", note=[Accessed: 29-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_systemcredential, organization={Wolfram Research}, title={SystemCredential}, year={2020}, url={https://reference.wolfram.com/language/ref/SystemCredential.html}, note=[Accessed: 29-March-2024 ]}