Class AwsCredentials
- Namespace
- DynaSharp.Credentials
- Assembly
- DynaSharp.dll
AWS credentials used to sign requests: an access key pair and, for temporary credentials, a session token.
public sealed class AwsCredentials
- Inheritance
-
AwsCredentials
- Inherited Members
Remarks
ToString() never includes the secret access key or the session token, so instances are safe to log. Instances are immutable; a provider that refreshes credentials returns a new instance.
Constructors
AwsCredentials(string, string, string?, DateTimeOffset?)
Initializes a new instance of the AwsCredentials class.
public AwsCredentials(string accessKeyId, string secretAccessKey, string? sessionToken = null, DateTimeOffset? expiration = null)
Parameters
accessKeyIdstringThe access key id, for example
AKIAIOSFODNN7EXAMPLE.secretAccessKeystringThe secret access key.
sessionTokenstringThe session token of temporary credentials, or null for long-term keys.
expirationDateTimeOffset?When temporary credentials expire, or null if they do not.
Exceptions
- ArgumentException
accessKeyIdorsecretAccessKeyis null or empty.
Properties
AccessKeyId
Gets the access key id.
public string AccessKeyId { get; }
Property Value
Expiration
Gets when the credentials expire, or null if they do not.
public DateTimeOffset? Expiration { get; }
Property Value
SecretAccessKey
Gets the secret access key.
public string SecretAccessKey { get; }
Property Value
SessionToken
public string? SessionToken { get; }
Property Value
Methods
ToString()
Returns a description with the access key id only; secrets are never included.
public override string ToString()
Returns
- string
The description.