#### [Abblix\.Utils](https://www.abblix.com/en/docs/api/abblix-utils 'index')
### [Abblix\.Utils](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils 'Abblix\.Utils')

## ICertificateProvider Interface

Resolves an [System\.Security\.Cryptography\.X509Certificates\.X509Certificate2](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2 'System\.Security\.Cryptography\.X509Certificates\.X509Certificate2') from a logical [CertificateId](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.CertificateId 'Abblix\.Utils\.CertificateId'), abstracting away the
physical source \(file system, certificate store, secret manager, etc\.\)\. Implementations are expected to be
thread\-safe and to surface format or access errors as [System\.InvalidOperationException](https://learn.microsoft.com/en-us/dotnet/api/system.invalidoperationexception 'System\.InvalidOperationException')\.

```csharp
public interface ICertificateProvider
```
### Methods

## ICertificateProvider\.GetCertificate\(CertificateId\) Method {#Abblix.Utils.ICertificateProvider.GetCertificate(Abblix.Utils.CertificateId)}

Retrieves an X\.509 certificate based on the specified certificate identifier\.

```csharp
System.Security.Cryptography.X509Certificates.X509Certificate2 GetCertificate(Abblix.Utils.CertificateId certificateId);
```
#### Parameters

###### `certificateId` [CertificateId](https://www.abblix.com/en/docs/api/abblix-utils/Abblix.Utils.CertificateId 'Abblix\.Utils\.CertificateId') {#Abblix.Utils.ICertificateProvider.GetCertificate(Abblix.Utils.CertificateId).certificateId}

The identifier of the certificate to retrieve\.

#### Returns
[System\.Security\.Cryptography\.X509Certificates\.X509Certificate2](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2 'System\.Security\.Cryptography\.X509Certificates\.X509Certificate2')  
An [System\.Security\.Cryptography\.X509Certificates\.X509Certificate2](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2 'System\.Security\.Cryptography\.X509Certificates\.X509Certificate2') instance representing the requested certificate\.

#### Exceptions

[System\.Collections\.Generic\.KeyNotFoundException](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.keynotfoundexception 'System\.Collections\.Generic\.KeyNotFoundException')  
Thrown if a certificate with the specified identifier is not found\.

[System\.InvalidOperationException](https://learn.microsoft.com/en-us/dotnet/api/system.invalidoperationexception 'System\.InvalidOperationException')  
Thrown if there is an issue in retrieving the certificate, such as issues with certificate format or storage\.
