AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Provides access to read and write to the shared credentials INI file. The file is read, parsed, and validated at construction time. Changes can be made using the RegisterProfile() and UnregisterProfile() methods. This class is not threadsafe.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.CredentialManagement.SharedCredentialsFile

Namespace: Amazon.Runtime.CredentialManagement
Assembly: AWSSDK.Core.dll
Version: 3.x.y.z

Syntax

C#
public class SharedCredentialsFile
         ICredentialProfileSource, ICredentialProfileStore

The SharedCredentialsFile type exposes the following members

Constructors

NameDescription
Public Method SharedCredentialsFile()

Construct a new SharedCredentialsFile in the default location.

Public Method SharedCredentialsFile(string)

Construct a new SharedCredentialsFile.

Properties

NameTypeDescription
Public Property FilePath System.String

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method CopyProfile(string, string)

Make a copy of the profile with fromProfileName called toProfileName.

Public Method CopyProfile(string, string, bool)

Make a copy of the profile with fromProfileName called toProfileName.

Public Method ListProfileNames()
Public Method ListProfiles()
Public Method RegisterProfile(CredentialProfile)

Add the profile given. If the profile already exists, update it.

Public Method RenameProfile(string, string)

Rename the profile with oldProfileName to newProfileName.

Public Method RenameProfile(string, string, bool)

Rename the profile with oldProfileName to newProfileName.

Public Method TryGetProfile(string, out CredentialProfile)
Public Method UnregisterProfile(string)

Deletes the section with the given ProfileName from the SharedCredentialsFile, if one exists.

Fields

NameTypeDescription
Field Static Field DefaultDirectory System.String
Field Static Field DefaultFilePath System.String
Field Static Field DefaultProfileName System.String

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5