Add support for ГОСТ Р 34.10 digital signatures

- Implemented the GostKeyValue class for handling public key parameters in ГОСТ Р 34.10 digital signatures.
- Created the GostSignedXml class to manage XML signatures using ГОСТ 34.10, including methods for computing and checking signatures.
- Developed the GostSignedXmlImpl class to encapsulate the signature computation logic and public key retrieval.
- Added specific key value classes for ГОСТ Р 34.10-2001, ГОСТ Р 34.10-2012/256, and ГОСТ Р 34.10-2012/512 to support different signature algorithms.
- Ensured compatibility with existing XML signature standards while integrating ГОСТ cryptography.
This commit is contained in:
master
2025-11-09 21:59:57 +02:00
parent 75c2bcafce
commit cef4cb2c5a
486 changed files with 32952 additions and 801 deletions

View File

@@ -0,0 +1,29 @@
using System.ComponentModel.DataAnnotations;
namespace StellaOps.Cryptography.Plugin.OpenSslGost;
public sealed class OpenSslGostKeyOptions
{
[Required]
public string KeyId { get; set; } = string.Empty;
[Required]
public string Algorithm { get; set; } = SignatureAlgorithms.GostR3410_2012_256;
[Required]
public string PrivateKeyPath { get; set; } = string.Empty;
/// <summary>
/// Optional environment variable containing the passphrase for the private key PEM (avoids inline secrets).
/// </summary>
public string? PrivateKeyPassphraseEnvVar { get; set; }
/// <summary>
/// Optional certificate (PEM/DER/PFX) to populate JWK x5c entries.
/// </summary>
public string? CertificatePath { get; set; }
public string? CertificatePasswordEnvVar { get; set; }
public GostSignatureFormat SignatureFormat { get; set; } = GostSignatureFormat.Der;
}