Table of Contents

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

accessKeyId string

The access key id, for example AKIAIOSFODNN7EXAMPLE.

secretAccessKey string

The secret access key.

sessionToken string

The session token of temporary credentials, or null for long-term keys.

expiration DateTimeOffset?

When temporary credentials expire, or null if they do not.

Exceptions

ArgumentException

accessKeyId or secretAccessKey is null or empty.

Properties

AccessKeyId

Gets the access key id.

public string AccessKeyId { get; }

Property Value

string

Expiration

Gets when the credentials expire, or null if they do not.

public DateTimeOffset? Expiration { get; }

Property Value

DateTimeOffset?

SecretAccessKey

Gets the secret access key.

public string SecretAccessKey { get; }

Property Value

string

SessionToken

Gets the session token, or null for long-term keys. An empty token is normalized to null.

public string? SessionToken { get; }

Property Value

string

Methods

ToString()

Returns a description with the access key id only; secrets are never included.

public override string ToString()

Returns

string

The description.