C# Class Microsoft.Alm.Authentication.SecretStore

Interface to secure secrets storage which indexes values by target and utilizes the operating system keychain / secrets vault.
Inheritance: BaseSecureStore, ICredentialStore, ITokenStore
Mostra file Open project: Microsoft/Git-Credential-Manager-for-Windows Class Usage Examples

Public Methods

Method Description
DeleteCredentials ( TargetUri targetUri ) : void

Deletes credentials for target URI from the credential store

DeleteToken ( TargetUri targetUri ) : void

Deletes the token for target URI from the token store

PurgeCredentials ( ) : void

Purges all credentials from the store.

ReadCredentials ( TargetUri targetUri ) : Credential

Reads credentials for a target URI from the credential store

ReadToken ( TargetUri targetUri ) : Token

Reads a token for a target URI from the token store

SecretStore ( string @namespace, ICredentialStore credentialCache = null, ITokenStore tokenCache = null, Secret getTargetName = null ) : System

Creates a new SecretStore backed by the operating system keychain / secrets vault.

WriteCredentials ( TargetUri targetUri, Credential credentials ) : void

Writes credentials for a target URI to the credential store

WriteToken ( TargetUri targetUri, Token token ) : void

Writes a token for a target URI to the token store

Protected Methods

Method Description
GetTargetName ( TargetUri targetUri ) : string

Formats a TargetName string based on the TargetUri base on the format started by git-credential-winstore

Method Details

DeleteCredentials() public method

Deletes credentials for target URI from the credential store
public DeleteCredentials ( TargetUri targetUri ) : void
targetUri TargetUri The URI of the target for which credentials are being deleted
return void

DeleteToken() public method

Deletes the token for target URI from the token store
public DeleteToken ( TargetUri targetUri ) : void
targetUri TargetUri The URI of the target for which the token is being deleted
return void

GetTargetName() protected method

Formats a TargetName string based on the TargetUri base on the format started by git-credential-winstore
protected GetTargetName ( TargetUri targetUri ) : string
targetUri TargetUri Uri of the target
return string

PurgeCredentials() public method

Purges all credentials from the store.
public PurgeCredentials ( ) : void
return void

ReadCredentials() public method

Reads credentials for a target URI from the credential store
public ReadCredentials ( TargetUri targetUri ) : Credential
targetUri TargetUri The URI of the target for which credentials are being read
return Credential

ReadToken() public method

Reads a token for a target URI from the token store
public ReadToken ( TargetUri targetUri ) : Token
targetUri TargetUri The URI of the target for which a token is being read
return Token

SecretStore() public method

Creates a new SecretStore backed by the operating system keychain / secrets vault.
public SecretStore ( string @namespace, ICredentialStore credentialCache = null, ITokenStore tokenCache = null, Secret getTargetName = null ) : System
@namespace string
credentialCache ICredentialStore /// (optional) Write-through, read-first cache. Default cache is used if a custom cache is /// not provided. ///
tokenCache ITokenStore /// (optional) Write-through, read-first cache. Default cache is used if a custom cache is /// not provided. ///
getTargetName Secret
return System

WriteCredentials() public method

Writes credentials for a target URI to the credential store
public WriteCredentials ( TargetUri targetUri, Credential credentials ) : void
targetUri TargetUri The URI of the target for which credentials are being stored
credentials Credential The credentials to be stored
return void

WriteToken() public method

Writes a token for a target URI to the token store
public WriteToken ( TargetUri targetUri, Token token ) : void
targetUri TargetUri The URI of the target for which a token is being stored
token Token The token to be stored
return void