C# Class ACMESharp.AcmeClient

The ACME client encapsulates all the protocol rules to interact with an ACME client as specified by the ACME specficication.
Inheritance: IDisposable
Show file Open project: ebekker/ACMESharp Class Usage Examples

Public Methods

Method Description
AcmeClient ( Uri rootUrl = null, AcmeServerDirectory dir = null, ISigner signer = null, ACMESharp.AcmeRegistration reg = null ) : System
AuthorizeIdentifier ( string dnsIdentifier ) : AuthorizationState
DecodeChallenge ( AuthorizationState authzState, string challengeType ) : AuthorizeChallenge
Dispose ( ) : void
GetDirectory ( bool saveRelative = false ) : AcmeServerDirectory
HandleChallenge ( AuthorizationState authzState, string challengeType, string handlerName, object>.IReadOnlyDictionary handlerParams, bool cleanUp = false ) : AuthorizeChallenge
Init ( ) : void
RefreshAuthorizeChallenge ( AuthorizationState authzState, string type, bool useRootUrl = false ) : void
RefreshCertificateRequest ( ACMESharp.CertificateRequest certRequ, bool useRootUrl = false ) : void
RefreshIdentifierAuthorization ( AuthorizationState authzState, bool useRootUrl = false ) : AuthorizationState
Register ( string contacts ) : ACMESharp.AcmeRegistration
RequestCertificate ( string csrContent ) : ACMESharp.CertificateRequest
SubmitChallengeAnswer ( AuthorizationState authzState, string type, bool useRootUrl = false ) : AuthorizeChallenge
UpdateRegistration ( bool useRootUrl = false, bool agreeToTos = false, string contacts = null ) : ACMESharp.AcmeRegistration

Protected Methods

Method Description
AssertInit ( ) : void
AssertRegistration ( ) : void

Private Methods

Method Description
ComputeAcmeSigned ( object message, ISigner signer ) : string

Computes the JWS-signed ACME request body for the given message object and signer instance.

ExtractNonce ( WebResponse resp ) : void

Extracts the next ACME protocol nonce from the argument Web response and remembers it for the next protocol request.

GenerateAuthorizeChallengeAnswer ( AuthorizationState authzState, string type ) : AuthorizeChallenge
RequestHttpGet ( Uri uri ) : AcmeHttpResponse
RequestHttpPost ( Uri uri, object message ) : AcmeHttpResponse

Submits an ACME protocol request via an HTTP POST with the necessary semantics and protocol details. The result is a simplified and canonicalized response object capturing the error state, HTTP response headers and content of the response body.

SubmitAuthorizeChallengeAnswer ( AuthorizationState authzState, string challengeType, bool useRootUrl = false ) : AuthorizeChallenge

Method Details

AcmeClient() public method

public AcmeClient ( Uri rootUrl = null, AcmeServerDirectory dir = null, ISigner signer = null, ACMESharp.AcmeRegistration reg = null ) : System
rootUrl System.Uri
dir AcmeServerDirectory
signer ISigner
reg ACMESharp.AcmeRegistration
return System

AssertInit() protected method

protected AssertInit ( ) : void
return void

AssertRegistration() protected method

protected AssertRegistration ( ) : void
return void

AuthorizeIdentifier() public method

public AuthorizeIdentifier ( string dnsIdentifier ) : AuthorizationState
dnsIdentifier string
return AuthorizationState

DecodeChallenge() public method

public DecodeChallenge ( AuthorizationState authzState, string challengeType ) : AuthorizeChallenge
authzState AuthorizationState
challengeType string
return AuthorizeChallenge

Dispose() public method

public Dispose ( ) : void
return void

GetDirectory() public method

public GetDirectory ( bool saveRelative = false ) : AcmeServerDirectory
saveRelative bool
return AcmeServerDirectory

HandleChallenge() public method

public HandleChallenge ( AuthorizationState authzState, string challengeType, string handlerName, object>.IReadOnlyDictionary handlerParams, bool cleanUp = false ) : AuthorizeChallenge
authzState AuthorizationState
challengeType string
handlerName string
handlerParams object>.IReadOnlyDictionary
cleanUp bool
return AuthorizeChallenge

Init() public method

public Init ( ) : void
return void

RefreshAuthorizeChallenge() public method

public RefreshAuthorizeChallenge ( AuthorizationState authzState, string type, bool useRootUrl = false ) : void
authzState AuthorizationState
type string
useRootUrl bool
return void

RefreshCertificateRequest() public method

public RefreshCertificateRequest ( ACMESharp.CertificateRequest certRequ, bool useRootUrl = false ) : void
certRequ ACMESharp.CertificateRequest
useRootUrl bool
return void

RefreshIdentifierAuthorization() public method

public RefreshIdentifierAuthorization ( AuthorizationState authzState, bool useRootUrl = false ) : AuthorizationState
authzState AuthorizationState
useRootUrl bool
return AuthorizationState

Register() public method

public Register ( string contacts ) : ACMESharp.AcmeRegistration
contacts string
return ACMESharp.AcmeRegistration

RequestCertificate() public method

public RequestCertificate ( string csrContent ) : ACMESharp.CertificateRequest
csrContent string
return ACMESharp.CertificateRequest

SubmitChallengeAnswer() public method

public SubmitChallengeAnswer ( AuthorizationState authzState, string type, bool useRootUrl = false ) : AuthorizeChallenge
authzState AuthorizationState
type string
useRootUrl bool
return AuthorizeChallenge

UpdateRegistration() public method

public UpdateRegistration ( bool useRootUrl = false, bool agreeToTos = false, string contacts = null ) : ACMESharp.AcmeRegistration
useRootUrl bool
agreeToTos bool
contacts string
return ACMESharp.AcmeRegistration