Show / Hide Table of Contents

# Interface ICredentialStore

An ICredentialStore support securely saving and retrieving passwords

###### Namespace:Microsoft.SqlTools.ServiceLayer.Credentials

###### Assembly:Microsoft.SqlTools.ServiceLayer.dll

##### Syntax

    public interface ICredentialStore

### Methods

| Improve this Doc View Source

#### DeletePassword(String)

Deletes a password linked to a given credential

##### Declaration

    bool DeletePassword(string credentialId)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | credentialId | The name of the credential to find the password for. This is required

##### Returns

Type | Description
--- | ---
System.Boolean | True if password existed and was deleted, false otherwise

| Improve this Doc View Source

#### Save(Credential)

Saves a Password linked to a given Credential

##### Declaration

    bool Save(Credential credential)

##### Parameters

Type | Name | Description
--- | --- | ---
Credential | credential | A Credential to be saved. CredentialId and Password are required

##### Returns

Type | Description
--- | ---
System.Boolean | True if successful, false otherwise

| Improve this Doc View Source

#### TryGetPassword(String, out String)

Gets a Password and sets it into a Credential object

##### Declaration

    bool TryGetPassword(string credentialId, out string password)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | credentialId | The name of the credential to find the password for. This is required
System.String | password | Out value

##### Returns

Type | Description
--- | ---
System.Boolean | true if password was found, false otherwise