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
Methods
CopyProfile(string, string)
Make a copy of the profile with fromProfileName called toProfileName.
public void CopyProfile(string fromProfileName, string toProfileName)
Parameters
fromProfileName
stringThe name of the profile to copy from.
toProfileName
stringThe 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
stringThe name of the profile to copy from.
toProfileName
stringThe name of the new profile.
force
boolIf true and the destination profile exists it will be overwritten.
ListProfileNames()
public List<string> ListProfileNames()
Returns
ListProfiles()
public List<CredentialProfile> ListProfiles()
Returns
RegisterProfile(CredentialProfile)
Add the profile to this store, if it's valid.
public void RegisterProfile(CredentialProfile profile)
Parameters
profile
CredentialProfileThe profile to add.
RenameProfile(string, string)
Rename the profile with oldProfileName to newProfileName.
public void RenameProfile(string oldProfileName, string newProfileName)
Parameters
RenameProfile(string, string, bool)
Rename the profile with oldProfileName to newProfileName.
public void RenameProfile(string oldProfileName, string newProfileName, bool force)
Parameters
oldProfileName
stringThe profile to rename.
newProfileName
stringThe new name for the profile.
force
boolIf 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
stringThe name of the profile to find.
profile
CredentialProfileThe 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
stringThe name of the profile to delete.