Table of Contents

Class NetSDKCredentialsFile

Namespace
Amazon.Runtime.CredentialManagement
Assembly
AWSSDK.Core.dll

This class allows profiles supporting AWSCredentials to be registered with the SDK so that they can later be reference by a profile name. The credential profiles will be available for use in the AWS Toolkit for Visual Studio and the AWS Tools for Windows PowerShell.

The credentials are stored under the current users AppData folder encrypted using Windows Data Protection API.

This class is not threadsafe.

public class NetSDKCredentialsFile : ICredentialProfileStore, ICredentialProfileSource
Inheritance
NetSDKCredentialsFile
Implements
Inherited Members

Constructors

NetSDKCredentialsFile()

public NetSDKCredentialsFile()

Fields

DefaultProfileName

public const string DefaultProfileName = "Default"

Field Value

string

Methods

CopyProfile(string, string)

Make a copy of the profile with fromProfileName called toProfileName.

public void CopyProfile(string fromProfileName, string toProfileName)

Parameters

fromProfileName string

The name of the profile to copy from.

toProfileName string

The name of the new profile.

CopyProfile(string, string, bool)

Make a copy of the profile with fromProfileName called toProfileName.

public void CopyProfile(string fromProfileName, string toProfileName, bool force)

Parameters

fromProfileName string

The name of the profile to copy from.

toProfileName string

The name of the new profile.

force bool

If true and the destination profile exists it will be overwritten.

ListProfileNames()

public List<string> ListProfileNames()

Returns

List<string>

ListProfiles()

public List<CredentialProfile> ListProfiles()

Returns

List<CredentialProfile>

RegisterProfile(CredentialProfile)

Add the profile to this store, if it's valid.

public void RegisterProfile(CredentialProfile profile)

Parameters

profile CredentialProfile

The profile to add.

RenameProfile(string, string)

Rename the profile with oldProfileName to newProfileName.

public void RenameProfile(string oldProfileName, string newProfileName)

Parameters

oldProfileName string

The profile to rename.

newProfileName string

The new name for the profile.

RenameProfile(string, string, bool)

Rename the profile with oldProfileName to newProfileName.

public void RenameProfile(string oldProfileName, string newProfileName, bool force)

Parameters

oldProfileName string

The profile to rename.

newProfileName string

The new name for the profile.

force bool

If true and the destination profile exists it will be overwritten.

TryGetProfile(string, out CredentialProfile)

Get the profile with the name given, if it exists in this store.

public bool TryGetProfile(string profileName, out CredentialProfile profile)

Parameters

profileName string

The name of the profile to find.

profile CredentialProfile

The profile, if it was found, null otherwise

Returns

bool

True if the profile was found, false otherwise.

UnregisterProfile(string)

If there is a profile in the store with the given name, delete it.

public void UnregisterProfile(string profileName)

Parameters

profileName string

The name of the profile to delete.