| | | 1 | | using AsiBackbone.DependencyInjection; |
| | | 2 | | |
| | | 3 | | namespace AsiBackbone.Signing.ManagedKey; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Provides explicit builder facade extension methods for managed-key signing. |
| | | 7 | | /// </summary> |
| | | 8 | | public static class ManagedKeySigningBuilderExtensions |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Adds managed-key signing through the AsiBackbone builder facade with a host-owned managed-key client factory. |
| | | 12 | | /// </summary> |
| | | 13 | | public static IAsiBackboneBuilder UseManagedKeySigning( |
| | | 14 | | this IAsiBackboneBuilder builder, |
| | | 15 | | Action<ManagedKeySigningOptions> configure, |
| | | 16 | | Func<IServiceProvider, IManagedKeySigningClient> clientFactory) |
| | | 17 | | { |
| | 0 | 18 | | ArgumentNullException.ThrowIfNull(builder); |
| | 0 | 19 | | ArgumentNullException.ThrowIfNull(configure); |
| | 0 | 20 | | ArgumentNullException.ThrowIfNull(clientFactory); |
| | | 21 | | |
| | 0 | 22 | | _ = builder.Services.AddAsiBackboneManagedKeySigning(configure, clientFactory); |
| | 0 | 23 | | return builder; |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Adds managed-key signing through the AsiBackbone builder facade using an already-registered managed-key client. |
| | | 28 | | /// </summary> |
| | | 29 | | public static IAsiBackboneBuilder UseManagedKeySigning( |
| | | 30 | | this IAsiBackboneBuilder builder, |
| | | 31 | | Action<ManagedKeySigningOptions> configure) |
| | | 32 | | { |
| | 0 | 33 | | ArgumentNullException.ThrowIfNull(builder); |
| | 0 | 34 | | ArgumentNullException.ThrowIfNull(configure); |
| | | 35 | | |
| | 0 | 36 | | _ = builder.Services.AddAsiBackboneManagedKeySigning(configure); |
| | 0 | 37 | | return builder; |
| | | 38 | | } |
| | | 39 | | } |