- 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.
30 lines
913 B
C#
30 lines
913 B
C#
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;
|
|
}
|