Add post-quantum cryptography support with PqSoftCryptoProvider
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
wine-csp-build / Build Wine CSP Image (push) Has been cancelled
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
wine-csp-build / Build Wine CSP Image (push) Has been cancelled
- Implemented PqSoftCryptoProvider for software-only post-quantum algorithms (Dilithium3, Falcon512) using BouncyCastle. - Added PqSoftProviderOptions and PqSoftKeyOptions for configuration. - Created unit tests for Dilithium3 and Falcon512 signing and verification. - Introduced EcdsaPolicyCryptoProvider for compliance profiles (FIPS/eIDAS) with explicit allow-lists. - Added KcmvpHashOnlyProvider for KCMVP baseline compliance. - Updated project files and dependencies for new libraries and testing frameworks.
This commit is contained in:
@@ -1,32 +1,44 @@
|
||||
using System;
|
||||
using System.CommandLine;
|
||||
|
||||
namespace StellaOps.Cli.Extensions;
|
||||
|
||||
/// <summary>
|
||||
/// Compatibility extensions for System.CommandLine 2.0.0-beta5+ API changes.
|
||||
/// These restore the older extension method patterns that were used in earlier versions.
|
||||
/// See: https://learn.microsoft.com/en-us/dotnet/standard/commandline/migration-guide-2.0.0-beta5
|
||||
/// These restore the older helper methods the codebase relied on.
|
||||
/// </summary>
|
||||
public static class CommandLineExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the default value for an option (compatibility shim for older API).
|
||||
/// In beta5+, this maps to DefaultValueFactory.
|
||||
/// Set a default value for an option.
|
||||
/// </summary>
|
||||
public static Option<T> SetDefaultValue<T>(this Option<T> option, T defaultValue)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(option);
|
||||
option.DefaultValueFactory = _ => defaultValue;
|
||||
return option;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restricts the option to accept only the specified values (compatibility shim).
|
||||
/// Works for both Option<string> and Option<string?>.
|
||||
/// Restrict the option to a fixed set of values and add completions.
|
||||
/// </summary>
|
||||
public static Option<T> FromAmong<T>(this Option<T> option, params string[] allowedValues)
|
||||
where T : class?
|
||||
{
|
||||
option.AcceptOnlyFromAmong(allowedValues);
|
||||
ArgumentNullException.ThrowIfNull(option);
|
||||
if (allowedValues is { Length: > 0 })
|
||||
{
|
||||
option.AcceptOnlyFromAmong(allowedValues);
|
||||
}
|
||||
|
||||
return option;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mark the option as required (compatibility shim for the old Required property).
|
||||
/// </summary>
|
||||
public static Option<T> Required<T>(this Option<T> option, bool isRequired = true)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(option);
|
||||
option.Required = isRequired;
|
||||
return option;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user