# CertificateRevocationFetcher

Fetches OCSP responses (RFC 6960) and CRLs (RFC 5280) from the access locations named in a certificate's authority information access and CRL distribution…

Class 

`OfficeIMO.Security`

**Namespace**

`OfficeIMO.Security`

**Assembly**

`OfficeIMO.Security`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[CertificateRevocationFetcher.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Security/CertificateRevocationFetcher.cs#L49)

**Implements**

`ICertificateRevocationFetcher` `IDisposable`

**Modifiers**

sealed

Fetches OCSP responses (RFC 6960) and CRLs (RFC 5280) from the access locations named in a certificate's authority information access and CRL distribution points extensions.

## Inheritance

- object
- CertificateRevocationFetcher

## Remarks

OCSP is tried first; CRLs are fetched when no OCSP location returns a status signed by the issuer or its responder. Responses are cached by the instance until their nextUpdate. Only http and https locations are used and, while non-public addresses are refused, connections go directly to the server without a proxy. Non-public addresses are refused unless [CertificateRevocationFetcherOptions.AllowPrivateNetworkAddresses](/api/security/officeimo-security-certificaterevocationfetcheroptions/) is set; on .NET 8 and later every address is checked when the connection is made. Older frameworks check the resolved addresses before each request, send http requests to the checked address and rely on certificate validation to bind https connections to the host name.

Filter members 

Show inherited

## Constructors

`public CertificateRevocationFetcher(CertificateRevocationFetcherOptions? options = null)` [#](#constructor-ctor-officeimo-security-certificaterevocationfetcheroptions)

[CertificateRevocationFetcher.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Security/CertificateRevocationFetcher.cs#L49)

Creates a fetcher. The options are copied.

Parameters

**options OfficeIMO.Security.CertificateRevocationFetcherOptions? = null optional**

## Methods

`public void Dispose()` [#](#method-dispose)

[CertificateRevocationFetcher.cs:140](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Security/CertificateRevocationFetcher.cs#L140)

Releases the HTTP connection pool and abandons requests still in flight.

`public async Task<CertificateRevocationEvidence> FetchAsync(X509Certificate2 certificate, X509Certificate2 issuer, CancellationToken cancellationToken = default)` [#](#method-fetchasync-security-cryptography-x509certificates-x509certificate2-security-cryptography-x509certificates-x509certificate2-threading-cancellationtoken)

Fetches revocation data for certificate, issued by issuer. Returned data is untrusted input; validators check its signature, issuer and freshness themselves.

Parameters

**certificate System.Security.Cryptography.X509Certificates.X509Certificate2 required**

**issuer System.Security.Cryptography.X509Certificates.X509Certificate2 required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<CertificateRevocationEvidence>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:077B2351F32F9E73F7092CD9EA3E4E774DC397F84871B4AE74E37FD3A9C338AE -->
