C# Class Minio.V4Authenticator

Inheritance: IAuthenticator
Afficher le fichier Open project: minio/minio-dotnet Class Usage Examples

Méthodes publiques

Méthode Description
Authenticate ( IRestClient client, IRestRequest request ) : void

Implements Authenticate interface method for IAuthenticator.

GetCredentialString ( System.DateTime signingDate, string region ) : string

Get credential string of form /date/region/s3/aws4_request.

PresignPostSignature ( string region, System.DateTime signingDate, string policyBase64 ) : string

Generate signature for post policy.

PresignURL ( IRestClient client, IRestRequest request, int expires ) : string

Presigns any input client object with a requested expiry.

V4Authenticator ( string accessKey, string secretKey ) : System

Authenticator constructor.

Private Methods

Méthode Description
BytesToHex ( byte checkSum ) : string

Convert bytes to hexadecimal string.

ComputeSha256 ( byte body ) : byte[]

Compute sha256 checksum.

GenerateSigningKey ( string region, System.DateTime signingDate ) : byte[]

Generates signing key based on the region and date.

GetAuthorizationHeader ( string signedHeaders, string signature, System.DateTime signingDate, string region ) : string

Constructs an authorization header.

GetCanonicalRequest ( IRestClient client, IRestRequest request, string>.SortedDictionary headersToSign ) : string

Get canonical request.

GetHeadersToSign ( IRestRequest request ) : string>.SortedDictionary

Get headers to be signed.

GetPresignCanonicalRequest ( IRestClient client, IRestRequest request, string requestQuery ) : string

Get presign canonical request.

GetScope ( string region, System.DateTime signingDate ) : string

Get scope.

GetSignedHeaders ( string>.SortedDictionary headersToSign ) : string

Concatenates sorted list of signed http headers.

GetStringToSign ( string region, System.DateTime signingDate, string canonicalRequestHash ) : string

Get string to sign.

SetContentMd5 ( IRestRequest request ) : void

Set 'Content-MD5' http header.

SetContentSha256 ( IRestRequest request ) : void

Set 'x-amz-content-sha256' http header.

SetDateHeader ( IRestRequest request, System.DateTime signingDate ) : void

Sets 'x-amz-date' http header.

SetHostHeader ( IRestRequest request, IRestClient client ) : void

Set 'Host' http header.

SignHmac ( byte key, byte content ) : byte[]

Compute hmac of input content with key.

Method Details

Authenticate() public méthode

Implements Authenticate interface method for IAuthenticator.
public Authenticate ( IRestClient client, IRestRequest request ) : void
client IRestClient Instantiated IRestClient object
request IRestRequest Instantiated IRestRequest object
Résultat void

GetCredentialString() public méthode

Get credential string of form /date/region/s3/aws4_request.
public GetCredentialString ( System.DateTime signingDate, string region ) : string
signingDate System.DateTime Signature initated date
region string Region for the credential string
Résultat string

PresignPostSignature() public méthode

Generate signature for post policy.
public PresignPostSignature ( string region, System.DateTime signingDate, string policyBase64 ) : string
region string Requested region
signingDate System.DateTime Date for signature to be signed
policyBase64 string Base64 encoded policy JSON
Résultat string

PresignURL() public méthode

Presigns any input client object with a requested expiry.
public PresignURL ( IRestClient client, IRestRequest request, int expires ) : string
client IRestClient Instantiated client
request IRestRequest Instantiated request
expires int Expiration in seconds
Résultat string

V4Authenticator() public méthode

Authenticator constructor.
public V4Authenticator ( string accessKey, string secretKey ) : System
accessKey string Access key id
secretKey string Secret access key
Résultat System