Add migrated to .NET 8.0 variant of Hcs.Client

This commit is contained in:
2025-09-26 19:48:32 +09:00
parent da127df8f6
commit 6cd2fb82e9
503 changed files with 223796 additions and 0 deletions

View File

@ -0,0 +1,42 @@
using GostCryptography.Asn1.Ber;
using GostCryptography.Properties;
namespace GostCryptography.Asn1.Gost.Gost_R3410
{
public abstract class Gost_R3410_PublicKey : Asn1OctetString
{
private readonly int _keySize;
protected Gost_R3410_PublicKey(int keySize)
{
_keySize = keySize;
}
public override void Decode(Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength)
{
base.Decode(buffer, explicitTagging, implicitLength);
if (Length != _keySize)
{
throw ExceptionUtility.CryptographicException(Resources.Asn1ConsVioException, nameof(Length), Length);
}
}
public override int Encode(Asn1BerEncodeBuffer buffer, bool explicitTagging)
{
if (Length != _keySize)
{
throw ExceptionUtility.CryptographicException(Resources.Asn1ConsVioException, nameof(Length), Length);
}
var len = base.Encode(buffer, false);
if (explicitTagging)
{
len += buffer.EncodeTagAndLength(Tag, len);
}
return len;
}
}
}