Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
- Implemented LdapDistinguishedNameHelper for escaping RDN and filter values. - Created AuthorityCredentialAuditContext and IAuthorityCredentialAuditContextAccessor for managing credential audit context. - Developed StandardCredentialAuditLogger with tests for success, failure, and lockout events. - Introduced AuthorityAuditSink for persisting audit records with structured logging. - Added CryptoPro related classes for certificate resolution and signing operations.
51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
using StellaOps.Cryptography;
|
|
|
|
namespace StellaOps.Cryptography.Plugin.CryptoPro;
|
|
|
|
public sealed class CryptoProGostKeyOptions
|
|
{
|
|
[Required]
|
|
public string KeyId { get; set; } = string.Empty;
|
|
|
|
public string Algorithm { get; set; } = SignatureAlgorithms.GostR3410_2012_256;
|
|
|
|
/// <summary>
|
|
/// Optional CryptoPro provider name (defaults to standard CSP).
|
|
/// </summary>
|
|
public string ProviderName { get; set; } = "Crypto-Pro GOST R 34.10-2012 Cryptographic Service Provider";
|
|
|
|
/// <summary>
|
|
/// Optional container name. If omitted, the certificate private key association is used.
|
|
/// </summary>
|
|
public string? ContainerName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Thumbprint of the certificate that owns the CryptoPro private key.
|
|
/// </summary>
|
|
public string? CertificateThumbprint { get; set; }
|
|
|
|
/// <summary>
|
|
/// Alternative lookup if thumbprint is not supplied.
|
|
/// </summary>
|
|
public string? SubjectName { get; set; }
|
|
|
|
public StoreLocation CertificateStoreLocation { get; set; } = StoreLocation.CurrentUser;
|
|
|
|
public StoreName CertificateStoreName { get; set; } = StoreName.My;
|
|
|
|
public CryptoProGostKeyOptions Clone()
|
|
=> new()
|
|
{
|
|
KeyId = KeyId,
|
|
Algorithm = Algorithm,
|
|
ProviderName = ProviderName,
|
|
ContainerName = ContainerName,
|
|
CertificateThumbprint = CertificateThumbprint,
|
|
SubjectName = SubjectName,
|
|
CertificateStoreLocation = CertificateStoreLocation,
|
|
CertificateStoreName = CertificateStoreName
|
|
};
|
|
}
|