C# Класс Amazon.Runtime.Internal.Auth.SharedCredentialsFile

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 AddOrUpdateSection() and DeleteSection() methods. Those changes can be persisted to disk using the Persist() method. This class is not threadsafe.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddOrUpdateCredentials ( string profileName, string accessKey, string secretAccessKey ) : void

Add credentials for the profile given. If credentials for the profile already exist, update them. Changes are not written to disk until the Persist() method is called.

AddOrUpdateCredentials ( string profileName, string accessKey, string secretAccessKey, string token ) : void

Add credentials for the profile given. If credentials for the profile already exist, update them. Changes are not written to disk until the Persist() method is called.

DeleteProfile ( string profileName ) : void

Deletes the section with the given ProfileName from the SharedCredentialsFile, if one exists. Changes are not written to disk until the Persist() method is called.

GetCredentials ( string profileName ) : ImmutableCredentials

Get credentials for the given profile.

ListProfileNames ( ) : List
Persist ( ) : void

Persist any changes to disk.

SharedCredentialsFile ( string filePath ) : Amazon.Runtime.Internal.Util

Construct a new SharedCredentialsFile.

TryGetCredentials ( string profileName, ImmutableCredentials &credentials ) : bool

Return the credentials for the profile if valid credentials can be found.

Приватные методы

Метод Описание
GetCredentials ( string profileName, bool throwIfInvalid ) : ImmutableCredentials

Описание методов

AddOrUpdateCredentials() публичный Метод

Add credentials for the profile given. If credentials for the profile already exist, update them. Changes are not written to disk until the Persist() method is called.
public AddOrUpdateCredentials ( string profileName, string accessKey, string secretAccessKey ) : void
profileName string name of profile
accessKey string access key for the credentials
secretAccessKey string secret access key for the credentials
Результат void

AddOrUpdateCredentials() публичный Метод

Add credentials for the profile given. If credentials for the profile already exist, update them. Changes are not written to disk until the Persist() method is called.
public AddOrUpdateCredentials ( string profileName, string accessKey, string secretAccessKey, string token ) : void
profileName string name of profile
accessKey string access key for the credentials
secretAccessKey string secret access key for the credentials
token string token for the credentials
Результат void

DeleteProfile() публичный Метод

Deletes the section with the given ProfileName from the SharedCredentialsFile, if one exists. Changes are not written to disk until the Persist() method is called.
public DeleteProfile ( string profileName ) : void
profileName string ProfileName of section to delete
Результат void

GetCredentials() публичный Метод

Get credentials for the given profile.
public GetCredentials ( string profileName ) : ImmutableCredentials
profileName string name of profile to find credentials for
Результат ImmutableCredentials

ListProfileNames() публичный Метод

public ListProfileNames ( ) : List
Результат List

Persist() публичный Метод

Persist any changes to disk.
public Persist ( ) : void
Результат void

SharedCredentialsFile() публичный Метод

Construct a new SharedCredentialsFile.
public SharedCredentialsFile ( string filePath ) : Amazon.Runtime.Internal.Util
filePath string path of the shared credentials file
Результат Amazon.Runtime.Internal.Util

TryGetCredentials() публичный Метод

Return the credentials for the profile if valid credentials can be found.
public TryGetCredentials ( string profileName, ImmutableCredentials &credentials ) : bool
profileName string name of profile to find credentials for
credentials ImmutableCredentials the credentials for the profile
Результат bool