feat(eidas): Implement eIDAS Crypto Plugin with dependency injection and signing capabilities
- Added ServiceCollectionExtensions for eIDAS crypto providers. - Implemented EidasCryptoProvider for handling eIDAS-compliant signatures. - Created LocalEidasProvider for local signing using PKCS#12 keystores. - Defined SignatureLevel and SignatureFormat enums for eIDAS compliance. - Developed TrustServiceProviderClient for remote signing via TSP. - Added configuration support for eIDAS options in the project file. - Implemented unit tests for SM2 compliance and crypto operations. - Introduced dependency injection extensions for SM software and remote plugins.
This commit is contained in:
@@ -12,7 +12,7 @@ using StellaOps.Attestor;
|
||||
using StellaOps.Scanner.Core.Configuration;
|
||||
using StellaOps.Scanner.Core.Contracts;
|
||||
using StellaOps.Scanner.Reachability;
|
||||
using StellaOps.Scanner.Reachability.Models;
|
||||
using StellaOps.Attestor;
|
||||
using StellaOps.Scanner.Worker.Orchestration;
|
||||
using StellaOps.Scanner.Worker.Processing;
|
||||
using StellaOps.Scanner.Worker.Processing.PoE;
|
||||
@@ -115,7 +115,7 @@ public class PoEGenerationStageExecutorTests : IDisposable
|
||||
|
||||
_resolverMock
|
||||
.Setup(x => x.ResolveBatchAsync(It.IsAny<IReadOnlyList<ReachabilityResolutionRequest>>(), It.IsAny<CancellationToken>()))
|
||||
.ReturnsAsync(new Dictionary<string, Subgraph?> { ["CVE-2021-44228"] = subgraph });
|
||||
.ReturnsAsync(new Dictionary<string, PoESubgraph?> { ["CVE-2021-44228"] = subgraph });
|
||||
|
||||
_emitterMock
|
||||
.Setup(x => x.EmitPoEAsync(It.IsAny<Subgraph>(), It.IsAny<ProofMetadata>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<CancellationToken>()))
|
||||
@@ -169,7 +169,7 @@ public class PoEGenerationStageExecutorTests : IDisposable
|
||||
|
||||
_resolverMock
|
||||
.Setup(x => x.ResolveBatchAsync(It.Is<IReadOnlyList<ReachabilityResolutionRequest>>(r => r.Count == 1), It.IsAny<CancellationToken>()))
|
||||
.ReturnsAsync(new Dictionary<string, Subgraph?> { ["CVE-2021-44228"] = subgraph });
|
||||
.ReturnsAsync(new Dictionary<string, PoESubgraph?> { ["CVE-2021-44228"] = subgraph });
|
||||
|
||||
_emitterMock
|
||||
.Setup(x => x.EmitPoEAsync(It.IsAny<Subgraph>(), It.IsAny<ProofMetadata>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<CancellationToken>()))
|
||||
@@ -219,7 +219,7 @@ public class PoEGenerationStageExecutorTests : IDisposable
|
||||
|
||||
_resolverMock
|
||||
.Setup(x => x.ResolveBatchAsync(It.IsAny<IReadOnlyList<ReachabilityResolutionRequest>>(), It.IsAny<CancellationToken>()))
|
||||
.ReturnsAsync(new Dictionary<string, Subgraph?>
|
||||
.ReturnsAsync(new Dictionary<string, PoESubgraph?>
|
||||
{
|
||||
["CVE-2021-44228"] = subgraph1,
|
||||
["CVE-2023-12345"] = subgraph2
|
||||
@@ -270,7 +270,7 @@ public class PoEGenerationStageExecutorTests : IDisposable
|
||||
|
||||
_resolverMock
|
||||
.Setup(x => x.ResolveBatchAsync(It.IsAny<IReadOnlyList<ReachabilityResolutionRequest>>(), It.IsAny<CancellationToken>()))
|
||||
.ReturnsAsync(new Dictionary<string, Subgraph?> { ["CVE-2021-44228"] = subgraph });
|
||||
.ReturnsAsync(new Dictionary<string, PoESubgraph?> { ["CVE-2021-44228"] = subgraph });
|
||||
|
||||
_emitterMock
|
||||
.Setup(x => x.EmitPoEAsync(It.IsAny<Subgraph>(), It.IsAny<ProofMetadata>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<CancellationToken>()))
|
||||
@@ -306,9 +306,9 @@ public class PoEGenerationStageExecutorTests : IDisposable
|
||||
);
|
||||
}
|
||||
|
||||
private Subgraph CreateTestSubgraph(string vulnId, string componentRef)
|
||||
private PoESubgraph CreateTestSubgraph(string vulnId, string componentRef)
|
||||
{
|
||||
return new Subgraph(
|
||||
return new PoESubgraph(
|
||||
BuildId: "gnu-build-id:test",
|
||||
ComponentRef: componentRef,
|
||||
VulnId: vulnId,
|
||||
|
||||
Reference in New Issue
Block a user