| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using Azure.Core.Extensions; |
| | | 6 | | using Azure.Security.KeyVault.Certificates; |
| | | 7 | | |
| | | 8 | | namespace Microsoft.Extensions.Azure |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Extension methods to add <see cref="CertificateClient"/> to clients builder. |
| | | 12 | | /// </summary> |
| | | 13 | | public static class CertificateClientBuilderExtensions |
| | | 14 | | { |
| | | 15 | | /// <summary> |
| | | 16 | | /// Registers a <see cref="CertificateClient"/> instance with the provided <paramref name="vaultUri"/>. |
| | | 17 | | /// </summary> |
| | | 18 | | public static IAzureClientBuilder<CertificateClient, CertificateClientOptions> AddCertificateClient<TBuilder>(th |
| | | 19 | | where TBuilder : IAzureClientFactoryBuilderWithCredential |
| | | 20 | | { |
| | 0 | 21 | | return builder.RegisterClientFactory<CertificateClient, CertificateClientOptions>((options, cred) => new Cer |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// Registers a <see cref="CertificateClient"/> instance with connection options loaded from the provided <param |
| | | 26 | | /// </summary> |
| | | 27 | | public static IAzureClientBuilder<CertificateClient, CertificateClientOptions> AddCertificateClient<TBuilder, TC |
| | | 28 | | where TBuilder : IAzureClientFactoryBuilderWithConfiguration<TConfiguration> |
| | | 29 | | { |
| | 0 | 30 | | return builder.RegisterClientFactory<CertificateClient, CertificateClientOptions>(configuration); |
| | | 31 | | } |
| | | 32 | | } |
| | | 33 | | } |