Password​Vault Password​Vault Password​Vault 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
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

PasswordVault() PasswordVault() PasswordVault()

Creates and initializes a new instance of the PasswordVault object.

public PasswordVault()public PasswordVault()Public Sub New()
Attributes

Methods

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
Parameters
credential
PasswordCredential PasswordCredential PasswordCredential

The credential to be added.

Attributes

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)

Searches the Credential Locker for credentials matching the resource specified.

public IVectorView<PasswordCredential> FindAllByResource(String resource)public IVectorView<PasswordCredential> FindAllByResource(String resource)Public Function FindAllByResource(resource As String) As IVectorView( Of PasswordCredential )
Parameters
resource
System.String System.String System.String

The resource to be searched for.

Returns

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

Attributes

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)

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

public IVectorView<PasswordCredential> FindAllByUserName(String userName)public IVectorView<PasswordCredential> FindAllByUserName(String userName)Public Function FindAllByUserName(userName As String) As IVectorView( Of PasswordCredential )
Parameters
userName
System.String System.String System.String

The user name to be searched for.

Returns

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

Attributes

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)

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
Parameters
credential
PasswordCredential PasswordCredential PasswordCredential

The credential to be removed.

Attributes

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

Reads a credential from the Credential Locker.

public PasswordCredential Retrieve(String resource, String userName)public PasswordCredential Retrieve(String resource, String userName)Public Function Retrieve(resource As String, userName As String) As PasswordCredential
Parameters
resource
System.String System.String System.String

The resource for which the credential is used.

userName
System.String System.String System.String

The user name that must be present in the credential.

Returns

The returned credential that contains all the data.

Attributes

RetrieveAll() RetrieveAll() RetrieveAll()

Retrieves all of the credentials stored in the Credential Locker.

public IVectorView<PasswordCredential> RetrieveAll()public IVectorView<PasswordCredential> RetrieveAll()Public Function RetrieveAll() As IVectorView( Of PasswordCredential )
Returns

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.

Attributes

See Also