Add project
Basic formatting applied. Unnecessary comments have been removed. Suspicious code is covered by TODO.
This commit is contained in:
48
Hcs.Client/GostCryptography/Asn1/Ber/Asn1Null.cs
Normal file
48
Hcs.Client/GostCryptography/Asn1/Ber/Asn1Null.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using System;
|
||||
|
||||
namespace GostCryptography.Asn1.Ber
|
||||
{
|
||||
[Serializable]
|
||||
public class Asn1Null : Asn1Type
|
||||
{
|
||||
public static readonly Asn1Tag Tag = new Asn1Tag(0, 0, NullTypeCode);
|
||||
public static readonly Asn1Null NullValue = new Asn1Null();
|
||||
|
||||
public override void Decode(Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength)
|
||||
{
|
||||
if (explicitTagging)
|
||||
{
|
||||
MatchTag(buffer, Tag);
|
||||
}
|
||||
|
||||
buffer.TypeCode = NullTypeCode;
|
||||
}
|
||||
|
||||
public override int Encode(Asn1BerEncodeBuffer buffer, bool explicitTagging)
|
||||
{
|
||||
var len = 0;
|
||||
|
||||
if (explicitTagging)
|
||||
{
|
||||
len += buffer.EncodeTagAndLength(Tag, len);
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
public override void Encode(Asn1BerOutputStream outs, bool explicitTagging)
|
||||
{
|
||||
if (explicitTagging)
|
||||
{
|
||||
outs.EncodeTag(Tag);
|
||||
}
|
||||
|
||||
outs.EncodeLength(0);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "NULL";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user