C# Class 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.
Afficher le fichier Open project: aws/aws-sdk-net Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
GetCredentials ( string profileName, bool throwIfInvalid ) : ImmutableCredentials

Method Details

AddOrUpdateCredentials() public méthode

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
Résultat void

AddOrUpdateCredentials() public méthode

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
Résultat void

DeleteProfile() public méthode

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
Résultat void

GetCredentials() public méthode

Get credentials for the given profile.
public GetCredentials ( string profileName ) : ImmutableCredentials
profileName string name of profile to find credentials for
Résultat ImmutableCredentials

ListProfileNames() public méthode

public ListProfileNames ( ) : List
Résultat List

Persist() public méthode

Persist any changes to disk.
public Persist ( ) : void
Résultat void

SharedCredentialsFile() public méthode

Construct a new SharedCredentialsFile.
public SharedCredentialsFile ( string filePath ) : Amazon.Runtime.Internal.Util
filePath string path of the shared credentials file
Résultat Amazon.Runtime.Internal.Util

TryGetCredentials() public méthode

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
Résultat bool