CryptoServiceClientOptions¶
Namespace CryptoService.Sdk.
Where crypto-server is, how to authenticate to it, and how long and how often to try. The client copies these values when it is constructed; changing the options afterwards does not affect it.
Methods¶
ToString()¶
Describes the options with the credentials redacted: the API key and token appear as set or unset, never their value, and user info in the base URL (which the client refuses) is redacted.
Returns: A description safe to log.
Properties¶
ApiKey¶
The static API key, sent as the x-api-key header. Leave it null to authenticate with CryptoServiceClientOptions.Token.
BaseUrl¶
The server's absolute base URL, for example https://crypto.internal.example. A path prefix is kept, so a server mounted under /crypto works too. Required.
Deadline¶
The budget for a whole call, every attempt and every retry wait included, or null (the default) for none. A retry whose wait would end after the deadline is not made.
GenerateTraceparent¶
Whether to generate a fresh W3C traceparent (version 00, random trace and parent IDs, sampled) for every request.
Retry¶
The retry policy. The default makes no retry (RetryOptions.MaxRetries is 0).
TimeProvider¶
The clock that measures retry waits, Retry-After dates and the CryptoServiceClientOptions.Deadline. Defaults to System; a test can pass a fake one.
| Exception | When |
|---|---|
ArgumentNullException |
The value is null. |
Timeout¶
How long one attempt may take, from sending the request to the last byte of the answer. Defaults to 30 seconds; InfiniteTimeSpan disables it.
Token¶
A bearer token (an HS256 JWT the server verifies), sent as Authorization: Bearer <token>. The server tries it before the API key.
Traceparent¶
A W3C traceparent value sent with every request, or null. Ignored when CryptoServiceClientOptions.GenerateTraceparent is set.