PasswordVault PasswordVault PasswordVault PasswordVault Class

Definition

Represents a Credential Locker of credentials. The contents of the locker are specific to the app or service. Apps and services don't have access to credentials associated with other apps or services.

public : sealed class PasswordVault : IPasswordVaultpublic sealed class PasswordVault : IPasswordVaultPublic NotInheritable Class PasswordVault Implements IPasswordVault// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

PasswordVault() PasswordVault() PasswordVault() PasswordVault()

Creates and initializes a new instance of the PasswordVault object.

public : PasswordVault()public PasswordVault()Public Sub New()// You can use this method in JavaScript.

Methods

Add(PasswordCredential) Add(PasswordCredential) Add(PasswordCredential) Add(PasswordCredential)

Adds a credential to the Credential Locker.

public : void Add(PasswordCredential credential)public void Add(PasswordCredential credential)Public Function Add(credential As PasswordCredential) As void// You can use this method in JavaScript.
Parameters

Remarks

You can only store up to ten credentials per app in the Credential Locker. If you try to store more than ten credentials, you will encounter an Exception.

FindAllByResource(String) FindAllByResource(String) FindAllByResource(String) FindAllByResource(String)

Searches the Credential Locker for credentials matching the resource specified.

public : IVectorView<PasswordCredential> FindAllByResource(PlatForm::String resource)public IReadOnlyList<PasswordCredential> FindAllByResource(String resource)Public Function FindAllByResource(resource As String) As IReadOnlyList( Of PasswordCredential )// You can use this method in JavaScript.
Parameters
resource
PlatForm::String String String String

The resource to be searched for. If a match does not exist, an exception will throw.

Returns
IVectorView<PasswordCredential> IReadOnlyList<PasswordCredential> IReadOnlyList<PasswordCredential> IReadOnlyList<PasswordCredential>

When this method returns, contains an IVectorView of credential objects that match the search criteria.

Remarks

Each object returned will have the proper resource and user name, but it will not include the password.

FindAllByUserName(String) FindAllByUserName(String) FindAllByUserName(String) FindAllByUserName(String)

Searches the Credential Locker for credentials that match the user name specified.

public : IVectorView<PasswordCredential> FindAllByUserName(PlatForm::String userName)public IReadOnlyList<PasswordCredential> FindAllByUserName(String userName)Public Function FindAllByUserName(userName As String) As IReadOnlyList( Of PasswordCredential )// You can use this method in JavaScript.
Parameters
userName
PlatForm::String String String String

The user name to be searched for. If a match does not exist, an exception will throw.

Returns
IVectorView<PasswordCredential> IReadOnlyList<PasswordCredential> IReadOnlyList<PasswordCredential> IReadOnlyList<PasswordCredential>

When this method returns, contains an IVectorView of credential objects that match the search criteria.

Remarks

Each object returned will have the proper resource and user name, but it will not include the password.

Remove(PasswordCredential) Remove(PasswordCredential) Remove(PasswordCredential) Remove(PasswordCredential)

Removes a credential from the Credential Locker.

public : void Remove(PasswordCredential credential)public void Remove(PasswordCredential credential)Public Function Remove(credential As PasswordCredential) As void// You can use this method in JavaScript.
Parameters

Retrieve(String, String) Retrieve(String, String) Retrieve(String, String) Retrieve(String, String)

Reads a credential from the Credential Locker.

public : PasswordCredential Retrieve(PlatForm::String resource, PlatForm::String userName)public PasswordCredential Retrieve(String resource, String userName)Public Function Retrieve(resource As String, userName As String) As PasswordCredential// You can use this method in JavaScript.
Parameters
resource
PlatForm::String String String String

The resource for which the credential is used.

userName
PlatForm::String String String String

The user name that must be present in the credential.

Returns

The returned credential that contains all the data.

Remarks

If a match does not exist, an exception will throw.

RetrieveAll() RetrieveAll() RetrieveAll() RetrieveAll()

Retrieves all of the credentials stored in the Credential Locker.

public : IVectorView<PasswordCredential> RetrieveAll()public IReadOnlyList<PasswordCredential> RetrieveAll()Public Function RetrieveAll() As IReadOnlyList( Of PasswordCredential )// You can use this method in JavaScript.
Returns
IVectorView<PasswordCredential> IReadOnlyList<PasswordCredential> IReadOnlyList<PasswordCredential> IReadOnlyList<PasswordCredential>

When this method returns, contains an IVectorView output of credential objects that match the search criteria. This output is a snapshot and not dynamic. If the results are used for updating or deleting credentials, those changes won't be reflected in the previous output.

See Also